From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Igor Mammedov <imammedo@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Shiju Jose <shiju.jose@huawei.com>, <qemu-arm@nongnu.org>,
<qemu-devel@nongnu.org>, Cleber Rosa <crosa@redhat.com>,
John Snow <jsnow@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 11/11] scripts/ghes_inject: add a script to generate GHES error inject
Date: Thu, 23 Jan 2025 12:10:07 +0000 [thread overview]
Message-ID: <20250123121007.000008a0@huawei.com> (raw)
In-Reply-To: <8c1f7e8e85f98aae26811ab88f8a85a3a51ff1f9.1737560101.git.mchehab+huawei@kernel.org>
On Wed, 22 Jan 2025 16:46:28 +0100
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
> Using the QMP GHESv2 API requires preparing a raw data array
> containing a CPER record.
>
> Add a helper script with subcommands to prepare such data.
>
> Currently, only ARM Processor error CPER record is supported.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
My Python is poor at best, so take that into account!
Some usage examples might be good to have as well.
Either in explicit docs or the patch description.
Jonathan
> ---
> MAINTAINERS | 3 +
> scripts/arm_processor_error.py | 377 ++++++++++++++++++
> scripts/ghes_inject.py | 51 +++
> scripts/qmp_helper.py | 702 +++++++++++++++++++++++++++++++++
> 4 files changed, 1133 insertions(+)
> create mode 100644 scripts/arm_processor_error.py
> create mode 100755 scripts/ghes_inject.py
> create mode 100644 scripts/qmp_helper.py
>
> diff --git a/scripts/qmp_helper.py b/scripts/qmp_helper.py
> new file mode 100644
> index 000000000000..357ebc6e8359
> --- /dev/null
> +++ b/scripts/qmp_helper.py
> + def send_cper(self, notif_type, payload):
> + """Send commands to QEMU though QMP TCP socket"""
> +
> + # Fill CPER record header
> +
> + # NOTE: bits 4 to 13 of block status contain the number of
> + # data entries in the data section. This is currently unsupported.
Not controllable, so always set to 0 or 1? Or not set?
...
> + self.send_cper_raw(cper_data)
> +
Trivial but maybe can improve consistency on spacing. 1 or 2 lines
between functions. I don't care which.
> +
> + def search_qom(self, path, prop, regex):
> +class cper_guid:
> + """
> + Contains CPER GUID, as per:
> + https://uefi.org/specs/UEFI/2.10/Apx_N_Common_Platform_Error_Record.html
> + """
> +
> + CPER_PROC_X86 = guid(0xDC3EA0B0, 0xA144, 0x4797,
Maybe follow the spec naming as IA32_X64?
> + [0xB9, 0x5B, 0x53, 0xFA,
> + 0x24, 0x2B, 0x6E, 0x1D])
> +
> + CPER_PROC_ITANIUM = guid(0xe429faf1, 0x3cb7, 0x11d4,
> + [0xbc, 0xa7, 0x00, 0x80,
To stop people falling down a hole, maybe call out that this
is not the format in the spec which is weird for this one case.
> + 0xc7, 0x3c, 0x88, 0x81])
> +
> +
> +
> + CPER_PLATFORM_MEM2 = guid(0x61EC04FC, 0x48E6, 0xD813,
> + [0x25, 0xC9, 0x8D, 0xAA,
> + 0x44, 0x75, 0x0B, 0x12])
Huh. they missed this one in the big spec table but is
there in N.2.6
> + CPER_PCI_DEV = guid(0xEB5E4685, 0xCA66, 0x4769,
CPER_PCI_COMPONENT would match N.2.9 naming.
If I recall PCI terminology right, component covers a bunch
of things that Device doesn't.
> + [0xB6, 0xA2, 0x26, 0x06,
> + 0x8B, 0x00, 0x13, 0x26])
> +
> + CPER_FW_ERROR = guid(0x81212A96, 0x09ED, 0x4996,
Another one oddly missing from the big table but not the broken
out sections. Not our problem but this chunk of the
spec could do with tidying up!
> + [0x94, 0x71, 0x8D, 0x72,
> + 0x9C, 0x8E, 0x69, 0xED])
> +
> + CPER_DMA_GENERIC = guid(0x5B51FEF7, 0xC79D, 0x4434,
CPER_DMAR
Nothing to do with DMA in general. All about x86 IOMMUs I think.
> + [0x8F, 0x1B, 0xAA, 0x62,
> + 0xDE, 0x3E, 0x2C, 0x64])
> +
> +
> + CPER_CXL_PROT_ERR = guid(0x80B9EFB4, 0x52B5, 0x4DE3,
> + [0xA7, 0x77, 0x68, 0x78,
> + 0x4B, 0x77, 0x10, 0x48])
Maybe add the one for FRU Memory poison from the new 2.11 UEFI spec.
This will constantly need updating with new specs so no problem
if you'd rather stick to 2.10 only for now.
next prev parent reply other threads:[~2025-01-23 12:10 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-22 15:46 [PATCH 00/11] Change ghes to use HEST-based offsets and add support for error inject Mauro Carvalho Chehab
2025-01-22 15:46 ` [PATCH 01/11] acpi/ghes: Prepare to support multiple sources on ghes Mauro Carvalho Chehab
2025-01-23 9:56 ` Jonathan Cameron
2025-01-23 16:48 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 02/11] acpi/ghes: add a firmware file with HEST address Mauro Carvalho Chehab
2025-01-23 10:02 ` Jonathan Cameron
2025-01-23 11:46 ` Mauro Carvalho Chehab
2025-01-23 17:01 ` Igor Mammedov
2025-01-28 10:12 ` Mauro Carvalho Chehab
2025-01-28 10:00 ` Mauro Carvalho Chehab
2025-01-28 14:10 ` Jonathan Cameron
2025-01-29 13:33 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 03/11] acpi/ghes: Use HEST table offsets when preparing GHES records Mauro Carvalho Chehab
2025-01-23 10:29 ` Jonathan Cameron
2025-01-23 18:23 ` Mauro Carvalho Chehab
2025-01-24 9:59 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 04/11] acpi/generic_event_device: Update GHES migration to cover hest addr Mauro Carvalho Chehab
2025-01-23 10:31 ` Jonathan Cameron
2025-01-24 10:08 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 05/11] acpi/generic_event_device: add logic to detect if HEST addr is available Mauro Carvalho Chehab
2025-01-23 10:52 ` Jonathan Cameron
2025-01-24 10:23 ` Igor Mammedov
2025-01-28 11:29 ` Mauro Carvalho Chehab
2025-01-29 6:26 ` Mauro Carvalho Chehab
2025-01-22 15:46 ` [PATCH 06/11] acpi/ghes: add a notifier to notify when error data is ready Mauro Carvalho Chehab
2025-01-23 10:52 ` Jonathan Cameron
2025-01-22 15:46 ` [PATCH 07/11] acpi/ghes: Cleanup the code which gets ghes ged state Mauro Carvalho Chehab
2025-01-23 10:54 ` Jonathan Cameron
2025-01-24 12:25 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 08/11] acpi/generic_event_device: add an APEI error device Mauro Carvalho Chehab
2025-01-24 12:30 ` Igor Mammedov
2025-01-28 17:42 ` Mauro Carvalho Chehab
2025-01-28 17:45 ` Michael S. Tsirkin
2025-01-22 15:46 ` [PATCH 09/11] arm/virt: Wire up a GED error device for ACPI / GHES Mauro Carvalho Chehab
2025-01-23 10:56 ` Jonathan Cameron
2025-01-22 15:46 ` [PATCH 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection Mauro Carvalho Chehab
2025-01-23 11:00 ` Jonathan Cameron
2025-01-24 12:40 ` Igor Mammedov
2025-01-24 12:38 ` Igor Mammedov
2025-01-22 15:46 ` [PATCH 11/11] scripts/ghes_inject: add a script to generate GHES error inject Mauro Carvalho Chehab
2025-01-23 12:10 ` Jonathan Cameron [this message]
2025-01-24 12:47 ` [PATCH 00/11] Change ghes to use HEST-based offsets and add support for " Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250123121007.000008a0@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=crosa@redhat.com \
--cc=imammedo@redhat.com \
--cc=jsnow@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mst@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shiju.jose@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox