[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 10/10] scripts/arm_processor_error.py: retrieve mpidr if not f
From: |
Mauro Carvalho Chehab |
Subject: |
[PATCH v6 10/10] scripts/arm_processor_error.py: retrieve mpidr if not filled |
Date: |
Thu, 8 Aug 2024 14:26:36 +0200 |
Add support to retrieve mpidr value via qom-get.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
scripts/arm_processor_error.py | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/scripts/arm_processor_error.py b/scripts/arm_processor_error.py
index b464254c8b7c..756935a2263c 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
@@ -168,11 +166,27 @@ def send_cper(self, args):
else:
cper["running-state"] = 0
+ if args.mpidr:
+ cper["mpidr-el1"] = arg["mpidr"]
+ elif cpus:
+ get_mpidr = {
+ "execute": "qom-get",
+ "arguments": {
+ 'path': cpus[0],
+ 'property': "x-mpidr"
+ }
+ }
+ ret = qmp_cmd.send_cmd(get_mpidr, may_open=True)
+ if isinstance(ret, int):
+ cper["mpidr-el1"] = ret
+ 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:
@@ -360,7 +374,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.45.2
- [PATCH v6 05/10] acpi/ghes: rework the logic to handle HEST source ID, (continued)
- [PATCH v6 05/10] acpi/ghes: rework the logic to handle HEST source ID, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 06/10] acpi/ghes: add support for generic error injection via QAPI, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 02/10] arm/virt: Wire up a GED error device for ACPI / GHES, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 03/10] acpi/ghes: Add support for GED error device, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 09/10] target/arm: add an experimental mpidr arm cpu property object, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 07/10] docs: acpi_hest_ghes: fix documentation for CPER size, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 10/10] scripts/arm_processor_error.py: retrieve mpidr if not filled,
Mauro Carvalho Chehab <=
- [PATCH v6 01/10] acpi/generic_event_device: add an APEI error device, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 08/10] scripts/ghes_inject: add a script to generate GHES error inject, Mauro Carvalho Chehab, 2024/08/08
- [PATCH v6 04/10] qapi/ghes-cper: add an interface to do generic CPER error injection, Mauro Carvalho Chehab, 2024/08/08
- Re: [PATCH v6 00/10] Add ACPI CPER firmware first error injection on ARM emulation, Mauro Carvalho Chehab, 2024/08/08