[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/31] scripts/arm_processor_error.py: retrieve mpidr if not fill
From: |
Mauro Carvalho Chehab |
Subject: |
[PATCH 25/31] scripts/arm_processor_error.py: retrieve mpidr if not filled |
Date: |
Fri, 6 Dec 2024 18:12:47 +0100 |
Add support to retrieve mpidr value via qom-get.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
scripts/arm_processor_error.py | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/scripts/arm_processor_error.py b/scripts/arm_processor_error.py
index 62e0c5662232..b4321ff45517 100644
--- a/scripts/arm_processor_error.py
+++ b/scripts/arm_processor_error.py
@@ -5,12 +5,10 @@
#
# Copyright (C) 2024 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-# TODO: current implementation has dummy defaults.
-#
-# For a better implementation, a QMP addition/call is needed to
-# retrieve some data for ARM Processor Error injection:
-#
-# - ARM registers: power_state, mpidr.
+# Note: currently it lacks a method to fill the ARM Processor Error CPER
+# psci field from emulation. On a real hardware, this is filled only
+# when a CPU is not running. Implementing support for it to simulate a
+# real hardware is not trivial.
import argparse
import re
@@ -174,11 +172,26 @@ def send_cper(self, args):
else:
cper["running-state"] = 0
+ if args.mpidr:
+ cper["mpidr-el1"] = arg["mpidr"]
+ elif cpus:
+ cmd_arg = {
+ 'path': cpus[0],
+ 'property': "x-mpidr"
+ }
+ ret = qmp_cmd.send_cmd("qom-get", cmd_arg, may_open=True)
+ if isinstance(ret, int):
+ cper["mpidr-el1"] = ret
+ else:
+ cper["mpidr-el1"] = 0
+ else:
+ cper["mpidr-el1"] = 0
+
if arm_valid_init:
if args.affinity:
cper["valid"] |= self.arm_valid_bits["affinity"]
- if args.mpidr:
+ if "mpidr-el1" in cper:
cper["valid"] |= self.arm_valid_bits["mpidr"]
if "running-state" in cper:
@@ -362,7 +375,7 @@ def send_cper(self, args):
if isinstance(ret, int):
arg["midr-el1"] = ret
- util.data_add(data, arg.get("mpidr-el1", 0), 8)
+ util.data_add(data, cper["mpidr-el1"], 8)
util.data_add(data, arg.get("midr-el1", 0), 8)
util.data_add(data, cper["running-state"], 4)
util.data_add(data, arg.get("psci-state", 0), 4)
--
2.47.1
- [PATCH 29/31] HACK: use GPIO as source ID for virt-9.1 machines, (continued)
- [PATCH 29/31] HACK: use GPIO as source ID for virt-9.1 machines, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 20/31] acpi/generic_event_device: add an APEI error device, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 16/31] acpi/ghes: Use HEST table offsets when preparing GHES records, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 13/31] acpi/ghes: better name the offset of the hardware error firmware, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 14/31] acpi/ghes: Prepare to support multiple sources on ghes, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 24/31] target/arm: add an experimental mpidr arm cpu property object, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 09/31] acpi/ghes: make the GHES record generation more generic, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 26/31] acpi/ghes: move offset calculus to a separate function, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 22/31] qapi/acpi-hest: add an interface to do generic CPER error injection, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 30/31] docs: acpi_hest_ghes: fix documentation for CPER size, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 25/31] scripts/arm_processor_error.py: retrieve mpidr if not filled,
Mauro Carvalho Chehab <=
- [PATCH 28/31] acpi/ghes: Change ghes fill logic to work with only one source, Mauro Carvalho Chehab, 2024/12/06
- Re: [PATCH 00/31] Prepare GHES driver to support error injection, Markus Armbruster, 2024/12/07