[PATCH v10 10/21] acpi/ghes: make the GHES record generation more generic

2024-09-13 Thread Mauro Carvalho Chehab
to generate a memory error now belongs to acpi_ghes_record_errors() function. A further patch will give it a better name. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 101 ++--- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git

[PATCH v10 13/21] acpi/ghes: better name GHES memory error function

2024-09-13 Thread Mauro Carvalho Chehab
The current function used to generate GHES data is specific for memory errors. Give a better name for it, as we now have a generic function as well. Reviewed-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c | 2 +- include/hw/acpi

[PATCH v10 12/21] acpi/ghes: rename etc/hardware_error file macros

2024-09-13 Thread Mauro Carvalho Chehab
Now that we have also have a file to store HEST data location, which is part of GHES, better name the file where CPER records are stored. No functional changes. Reviewed-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 32 +++- 1 file

[PATCH v10 06/21] acpi/ghes: Remove a duplicated out of bounds check

2024-09-13 Thread Mauro Carvalho Chehab
acpi_ghes_record_errors() has an assert() at the beginning to ensure that source_id will be lower than ACPI_GHES_ERROR_SOURCE_COUNT. Remove a duplicated check. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/acpi

[PATCH v10 04/21] acpi/ghes: simplify acpi_ghes_record_errors() code

2024-09-13 Thread Mauro Carvalho Chehab
if physical_address is not defined, just return with an error set. That reduces the ident of the function and prepares it for the next changes. No functional changes. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 56 ++ 1 file

[PATCH v10 15/21] acpi/generic_event_device: add an APEI error device

2024-09-13 Thread Mauro Carvalho Chehab
errors to the guest via ACPI APEI Generic Hardware Error Source (GHES). Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan Cameron Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/aml-build.c| 10

[PATCH v10 00/21] Add ACPI CPER firmware first error injection on ARM emulation

2024-09-13 Thread Mauro Carvalho Chehab
asily be extended to other GHES notification types. Mauro Carvalho Chehab (21): acpi/ghes: add a firmware file with HEST address acpi/generic_event_device: Update GHES migration to cover hest addr acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED acpi/ghes: simplify acpi_ghes_record_errors()

[PATCH v10 21/21] scripts/arm_processor_error.py: retrieve mpidr if not filled

2024-09-13 Thread Mauro Carvalho Chehab
Add support to retrieve mpidr value via qom-get. Signed-off-by: Mauro Carvalho Chehab --- scripts/arm_processor_error.py | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/arm_processor_error.py b/scripts/arm_processor_error.py index

[PATCH v10 18/21] docs: acpi_hest_ghes: fix documentation for CPER size

2024-09-13 Thread Mauro Carvalho Chehab
While the spec defines a CPER size of 4KiB for each record, currently it is set to 1KiB. Fix the documentation and add a pointer to the macro name there, as this may help to keep it updated. Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov --- docs/specs/acpi_hest_ghes.rst | 6

[PATCH 2/6] acpi/ghes: Support GPIO error source.

2024-07-11 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 8 ++-- include/hw/acpi/ghes.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/acpi

[PATCH 4/6] target/arm: preserve mpidr value

2024-07-11 Thread Mauro Carvalho Chehab
There is a logic at helper to properly fill the mpidr information. This is needed for ARM Processor error injection, so store the value inside a cpu opaque value, to allow it to be used. Signed-off-by: Mauro Carvalho Chehab --- target/arm/cpu.h| 1 + target/arm/helper.c | 10 -- 2

[PATCH 5/6] acpi/ghes: update comments to point to newer ACPI specs

2024-07-11 Thread Mauro Carvalho Chehab
ontained on a HEST record. So, while it is probably safe to update it, there's no real need. So, let's keep the implementation using an ACPI 6.4 compatible table, e. g. HEST revision 1. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 48

[PATCH 6/6] acpi/ghes: extend arm error injection logic

2024-07-11 Thread Mauro Carvalho Chehab
"arguments": { "error": [ {"type": [ "cache-error" ]}, {"type": [ "tlb-error" ]} ] } } This would generate both cache and TLB errors, using default values for other fields. As all fields from ARM Processor CPER are

[PATCH 1/6] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-11 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Creates a GED - Generic Event Device and set a GPIO to be used or error injection. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 29 + hw/arm/virt.c| 12 +++- include

[PATCH 3/6] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-11 Thread Mauro Carvalho Chehab
t;: "arm-inject-error", "arguments": { "errortypes": ['cache-error', 'tlb-error'] } } { "execute": "arm-inject-error", "arguments": { "errortypes": ['cache-error&#x

[PATCH 0/6] Add ACPI CPER firmware first error injection for Arm Processor

2024-07-11 Thread Mauro Carvalho Chehab
r|bus error|micro-architectural error [ 925.359590] [Firmware Warn]: GHES: Unhandled processor error type 0x10: micro-architectural error [ 925.359935] [Firmware Warn]: GHES: Unhandled processor error type 0x04: TLB error [ 925.360235] [Firmware Warn]: GHES: Unhandled processor error type 0x08:

[PATCH v2 3/7] acpi/ghes: Support GPIO error source.

2024-07-12 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 8 ++-- include/hw/acpi/ghes.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/acpi

[PATCH v2 7/7] acpi/ghes: extend arm error injection logic

2024-07-12 Thread Mauro Carvalho Chehab
"arguments": { "error": [ {"type": [ "cache-error" ]}, {"type": [ "tlb-error" ]} ] } } This would generate both cache and TLB errors, using default values for other fields. As all fields from ARM Processor CPER are

[PATCH v2 5/7] target/arm: preserve mpidr value

2024-07-12 Thread Mauro Carvalho Chehab
There is a logic at helper to properly fill the mpidr information. This is needed for ARM Processor error injection, so store the value inside a cpu opaque value, to allow it to be used. Signed-off-by: Mauro Carvalho Chehab --- target/arm/cpu.h| 1 + target/arm/helper.c | 10 -- 2

[PATCH v2 6/7] acpi/ghes: update comments to point to newer ACPI specs

2024-07-12 Thread Mauro Carvalho Chehab
ontained on a HEST record. So, while it is probably safe to update it, there's no real need. So, let's keep the implementation using an ACPI 6.4 compatible table, e. g. HEST revision 1. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 48

[PATCH v2 1/7] arm/virt: place power button pin number on a define

2024-07-12 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 3 ++- include/hw/arm/virt.h| 3 +++ 3 files

[PATCH v2 2/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-12 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Creates a GED - Generic Event Device and set a GPIO to be used or error injection. [mchehab: use a define for the generic event pin number and do some cleanups] Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 30

[PATCH v2 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-12 Thread Mauro Carvalho Chehab
t;: "arm-inject-error", "arguments": { "errortypes": ['cache-error', 'tlb-error'] } } { "execute": "arm-inject-error", "arguments": { "errortypes": ['cache-error&#x

[PATCH v2 0/7] Add ACPI CPER firmware first error injection for Arm Processor

2024-07-12 Thread Mauro Carvalho Chehab
processor error type 0x04: TLB error [ 925.360235] [Firmware Warn]: GHES: Unhandled processor error type 0x08: bus error [ 925.360534] [Firmware Warn]: GHES: Unhandled processor error type 0x02: cache error --- Changes since v1: - added a new patch using a define for GPIO power pin; - patch

[PATCH v3 6/7] acpi/ghes: update comments to point to newer ACPI specs

2024-07-21 Thread Mauro Carvalho Chehab
ontained on a HEST record. So, while it is probably safe to update it, there's no real need. So, let's keep the implementation using an ACPI 6.4 compatible table, e. g. HEST revision 1. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 48

[PATCH v3 7/7] acpi/ghes: extend arm error injection logic

2024-07-21 Thread Mauro Carvalho Chehab
"arguments": { "error": [ {"type": [ "cache-error" ]}, {"type": [ "tlb-error" ]} ] } } This would generate both cache and TLB errors, using default values for other fields. As all fields from ARM Processor CPER are

[PATCH v3 5/7] target/arm: preserve mpidr value

2024-07-21 Thread Mauro Carvalho Chehab
There is a logic at helper to properly fill the mpidr information. This is needed for ARM Processor error injection, so store the value inside a cpu opaque value, to allow it to be used. Signed-off-by: Mauro Carvalho Chehab --- target/arm/cpu.h| 1 + target/arm/helper.c | 10 -- 2

[PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-21 Thread Mauro Carvalho Chehab
t;: "arm-inject-error", "arguments": { "errortypes": ['cache-error', 'tlb-error'] } } { "execute": "arm-inject-error", "arguments": { "errortypes": ['cache-error&#x

[PATCH v3 2/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-21 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Creates a GED - Generic Event Device and set a GPIO to be used or error injection. [mchehab: use a define for the generic event pin number and do some cleanups] Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 30

[PATCH v3 0/7] Add ACPI CPER firmware first error injection for Arm Processor

2024-07-21 Thread Mauro Carvalho Chehab
ere the poweroff GPIO define should be used. No changes on other patches (except due to conflict resolution). v2: - added a new patch using a define for GPIO power pin; - patch 2 changed to also use a define for generic error GPIO pin; - a couple cleanups at patch 2 removing uneeded else clauses. J

[PATCH v3 1/7] arm/virt: place power button pin number on a define

2024-07-21 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 7 --- include/hw

[PATCH v3 3/7] acpi/ghes: Support GPIO error source.

2024-07-21 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 8 ++-- include/hw/acpi/ghes.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/acpi

Re: [PATCH v3 7/7] acpi/ghes: extend arm error injection logic

2024-07-29 Thread Mauro Carvalho Chehab
Em Fri, 26 Jul 2024 14:22:25 +0100 Jonathan Cameron escreveu: > On Mon, 22 Jul 2024 08:45:59 +0200 > Mauro Carvalho Chehab wrote: > > > Enrich CPER error injection logic for ARM processor to allow > > setting values to from UEFI 2.10 tables N.16 and N.17. > > &g

Re: [PATCH v3 7/7] acpi/ghes: extend arm error injection logic

2024-07-29 Thread Mauro Carvalho Chehab
Em Thu, 25 Jul 2024 12:03:46 +0200 Markus Armbruster escreveu: > Mauro Carvalho Chehab writes: > > > Enrich CPER error injection logic for ARM processor to allow > > setting values to from UEFI 2.10 tables N.16 and N.17. > > > > It should be noticed that, with

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-29 Thread Mauro Carvalho Chehab
Em Fri, 26 Jul 2024 13:44:12 +0100 Jonathan Cameron escreveu: > On Mon, 22 Jul 2024 08:45:56 +0200 > Mauro Carvalho Chehab wrote: > > > From: Jonathan Cameron > > > > 1. Some GHES functions require handling addresses. Add a helper function > >to suppor

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-29 Thread Mauro Carvalho Chehab
Em Thu, 25 Jul 2024 11:48:12 +0200 Markus Armbruster escreveu: > Mauro Carvalho Chehab writes: > > > From: Jonathan Cameron > > > > 1. Some GHES functions require handling addresses. Add a helper function > >to support it. > > > > 2. Add

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-29 Thread Mauro Carvalho Chehab
Em Fri, 26 Jul 2024 13:46:46 +0100 Jonathan Cameron escreveu: > A few quick replies from me. > I'm sure Mauro will add more info. > > > > + 'tlb-error', > > > + 'bus-error', > > > + 'micro-arch-error'] > > > +} > > > + > > > +## > > > +# @arm-inject-error: > > > +#

[PATCH v4 4/6] acpi/ghes: update comments to point to newer ACPI specs

2024-07-29 Thread Mauro Carvalho Chehab
ontained on a HEST record. So, while it is probably safe to update it, there's no real need. So, let's keep the implementation using an ACPI 6.4 compatible table, e. g. HEST revision 1. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 48

[PATCH v4 3/6] target/arm: preserve mpidr value

2024-07-29 Thread Mauro Carvalho Chehab
There is a logic at helper to properly fill the mpidr information. This is needed for ARM Processor error injection, so store the value inside a cpu opaque value, to allow it to be used. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- target/arm/cpu.h| 1 + target

[PATCH v4 5/6] acpi/ghes: Support GPIO error source.

2024-07-29 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 8 ++-- include/hw/acpi/ghes.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/acpi

[PATCH v4 1/6] arm/virt: place power button pin number on a define

2024-07-29 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 7 --- include/hw

[PATCH v4 2/6] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-29 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 30 ++ hw/arm/virt.c| 14 -- include/hw/arm/virt.h| 1 + include/hw/boards.h | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt-acpi

[PATCH v4 0/6] Add ACPI CPER firmware first error injection for Arm Processor

2024-07-29 Thread Mauro Carvalho Chehab
_device_notify(); - GED patch description fixed; - running_state/psci logic fixed. v3: - patch 1 cleanups with some comment changes and adding another place where the poweroff GPIO define should be used. No changes on other patches (except due to conflict resolution). v2: - added a new patc

[PATCH v4 6/6] acpi/ghes: Add a logic to inject ARM processor CPER

2024-07-29 Thread Mauro Carvalho Chehab
irtual addresses, register dumps, vendor-specific data, etc. This patch is co-authored: - ghes logic to inject a simple ARM record by Shiju Jose; - generic logic to handle block addresses by Jonathan Cameron; - logic to allow changing all fields by Mauro Carvalho Chehab; Co-authored-by: Jonathan Ca

Re: [PATCH v4 2/6] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-29 Thread Mauro Carvalho Chehab
Em Mon, 29 Jul 2024 17:08:40 +0100 Jonathan Cameron escreveu: > On Mon, 29 Jul 2024 15:21:06 +0200 > Mauro Carvalho Chehab wrote: > > > From: Jonathan Cameron > > > > Creates a Generic Event Device (GED) as specified at > > I wrote this a while back and

Re: [PATCH v4 6/6] acpi/ghes: Add a logic to inject ARM processor CPER

2024-07-29 Thread Mauro Carvalho Chehab
Em Mon, 29 Jul 2024 17:31:09 +0100 Jonathan Cameron escreveu: > On Mon, 29 Jul 2024 15:21:10 +0200 > Mauro Carvalho Chehab wrote: ... > Markus suggested: > > > A target-specific command like this one should be conditional. Try > > this: > > > >

Re: [PATCH v3 2/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-30 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 10:36:15 +0200 Igor Mammedov escreveu: > On Mon, 22 Jul 2024 08:45:54 +0200 > Mauro Carvalho Chehab wrote: > > > From: Jonathan Cameron > > > > Creates a GED - Generic Event Device and set a GPIO to > > be used or error injection. >

Re: [PATCH v4 2/6] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-07-30 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 16:11:42 +0800 Zhao Liu escreveu: > Hi Mauro, > > On Mon, Jul 29, 2024 at 03:21:06PM +0200, Mauro Carvalho Chehab wrote: > > Date: Mon, 29 Jul 2024 15:21:06 +0200 > > From: Mauro Carvalho Chehab > > Subject: [PATCH v4 2/6] arm/virt: Wire up GPIO e

Re: [PATCH v3 6/7] acpi/ghes: update comments to point to newer ACPI specs

2024-07-30 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 07:36:32 -0400 "Michael S. Tsirkin" escreveu: > On Tue, Jul 30, 2024 at 01:24:30PM +0200, Igor Mammedov wrote: > > On Mon, 22 Jul 2024 08:45:58 +0200 > > Mauro Carvalho Chehab wrote: > > > > > There is one reference to ACPI 4.0

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-31 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 13:17:09 +0200 Igor Mammedov escreveu: > On Mon, 22 Jul 2024 08:45:56 +0200 > Mauro Carvalho Chehab wrote: > > that's quite a bit of code that in 99% won't ever be used > (assuming error injection testing scenario), > not to mention it's

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-07-31 Thread Mauro Carvalho Chehab
Em Wed, 31 Jul 2024 09:57:19 +0100 Jonathan Cameron escreveu: > On Wed, 31 Jul 2024 09:11:33 +0200 > Mauro Carvalho Chehab wrote: > > > Em Tue, 30 Jul 2024 13:17:09 +0200 > > Igor Mammedov escreveu: > > > > > On Mon, 22 Jul 2024 08:45:56 +020

Re: [PATCH v3 3/7] acpi/ghes: Support GPIO error source.

2024-08-01 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 10:40:28 +0200 Igor Mammedov escreveu: > > diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h > > index 674f6958e905..4f1ab1a73a06 100644 > > --- a/include/hw/acpi/ghes.h > > +++ b/include/hw/acpi/ghes.h > > @@ -58,6 +58,7 @@ enum AcpiGhesNotifyType { > > > > enum

Re: [PATCH v3 1/7] arm/virt: place power button pin number on a define

2024-08-01 Thread Mauro Carvalho Chehab
Em Tue, 30 Jul 2024 13:26:20 +0200 Igor Mammedov escreveu: > On Tue, 30 Jul 2024 09:29:37 +0100 > Peter Maydell wrote: > > > On Tue, 30 Jul 2024 at 08:26, Igor Mammedov wrote: > > > > > > On Mon, 22 Jul 2024 08:45:53 +0200 > > > Mauro Carvalho Che

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-08-01 Thread Mauro Carvalho Chehab
Em Thu, 1 Aug 2024 10:36:23 +0200 Igor Mammedov escreveu: > On Wed, 31 Jul 2024 09:57:19 +0100 > Jonathan Cameron wrote: > > > On Wed, 31 Jul 2024 09:11:33 +0200 > > Mauro Carvalho Chehab wrote: > > > > > Em Tue, 30 Jul 2024 13:17:09

Re: [PATCH v3 4/7] acpi/ghes: Add a logic to handle block addresses and FW first ARM processor error injection

2024-08-01 Thread Mauro Carvalho Chehab
Em Mon, 29 Jul 2024 16:32:41 +0200 Markus Armbruster escreveu: > Yes, as this CPER record is defined only for arm. There are three other > > processor error info: > > - for x86; > > - for ia32; > > - for "generic cpu". > > > > They have different structures, with different fields.

[PATCH v4 6/7] acpi/ghes: add support for generic error injection via QAPI

2024-08-01 Thread Mauro Carvalho Chehab
Provide a generic interface for error injection via GHESv2. This patch is co-authored: - original ghes logic to inject a simple ARM record by Shiju Jose; - generic logic to handle block addresses by Jonathan Cameron; - generic GHESv2 error inject by Mauro Carvalho Chehab; Co-authored

[PATCH v4 5/7] qapi/ghes-cper: add an interface to do generic CPER error injection

2024-08-01 Thread Mauro Carvalho Chehab
Creates a QAPI to be used for generic ACPI APEI hardware error injection (HEST) via GHESv2. The actual GHES code will be added at the followup patch. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS| 7 ++ hw/acpi/Kconfig| 5 hw/acpi/ghes_cper.c| 53

[PATCH v4 7/7] scripts/ghes_inject: add a script to generate GHES error inject

2024-08-01 Thread Mauro Carvalho Chehab
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 --- MAINTAINERS| 1 + scripts

[PATCH v4 4/7] acpi/ghes: Support GPIO error source

2024-08-01 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. [mchehab: do some cleanups at ACPI_HEST_SRC_ID_* checks] Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 16 ++-- include/hw/acpi/ghes.h | 3 ++- 2

[PATCH v4 2/7] acpi/generic_event_device: add an APEI error device

2024-08-01 Thread Mauro Carvalho Chehab
PNP0C33 device is used to report hardware errors to the bios via ACPI APEI Generic Hardware Error Source (GHES). Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan Cameron Cc: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 17

[PATCH v4 1/7] arm/virt: place power button pin number on a define

2024-08-01 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 7 --- include/hw

[PATCH v4 3/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-08-01 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling a General Purpose Event (GPE) via GED error device. It is aligned with Linux Kernel patch: https://lore.kernel.org/lkml/1272350481-27951-8-git-send-email-ying.hu...@intel.com/ Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan

[PATCH v4 0/7] Add ACPI CPER firmware first error injection on ARM emulation

2024-08-01 Thread Mauro Carvalho Chehab
dding support for mpidr query was removed. v3: - patch 1 cleanups with some comment changes and adding another place where the poweroff GPIO define should be used. No changes on other patches (except due to conflict resolution). v2: - added a new patch using a define for GPIO power pin; - pa

[PATCH v5 6/7] acpi/ghes: add support for generic error injection via QAPI

2024-08-02 Thread Mauro Carvalho Chehab
Provide a generic interface for error injection via GHESv2. This patch is co-authored: - original ghes logic to inject a simple ARM record by Shiju Jose; - generic logic to handle block addresses by Jonathan Cameron; - generic GHESv2 error inject by Mauro Carvalho Chehab; Co-authored

[PATCH v5 0/7] Add ACPI CPER firmware first error injection on ARM emulation

2024-08-02 Thread Mauro Carvalho Chehab
use a define for generic error GPIO pin; - a couple cleanups at patch 2 removing uneeded else clauses. Jonathan Cameron (1): acpi/ghes: Support GPIO error source Mauro Carvalho Chehab (6): arm/virt: place power button pin number on a define acpi/generic_event_device: add an APEI error device

[PATCH v5 4/7] acpi/ghes: Support GPIO error source

2024-08-02 Thread Mauro Carvalho Chehab
From: Jonathan Cameron Add error notification to GHES v2 using the GPIO source. [mchehab: do some cleanups at ACPI_HEST_SRC_ID_* checks] Signed-off-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 16 ++-- include/hw/acpi/ghes.h | 3 ++- 2

[PATCH v5 5/7] qapi/ghes-cper: add an interface to do generic CPER error injection

2024-08-02 Thread Mauro Carvalho Chehab
Creates a QMP command to be used for generic ACPI APEI hardware error injection (HEST) via GHESv2. The actual GHES code will be added at the followup patch. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS | 7 + hw/acpi/Kconfig | 5 hw/acpi/ghes_cper.c

[PATCH v5 1/7] arm/virt: place power button pin number on a define

2024-08-02 Thread Mauro Carvalho Chehab
Having magic numbers inside the code is not a good idea, as it is error-prone. So, instead, create a macro with the number definition. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/arm/virt-acpi-build.c | 6 +++--- hw/arm/virt.c| 7 --- include/hw

[PATCH v5 7/7] scripts/ghes_inject: add a script to generate GHES error inject

2024-08-02 Thread Mauro Carvalho Chehab
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 --- MAINTAINERS| 3

[PATCH v5 3/7] arm/virt: Wire up GPIO error source for ACPI / GHES

2024-08-02 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling a General Purpose Event (GPE) via GED error device. It is aligned with Linux Kernel patch: https://lore.kernel.org/lkml/1272350481-27951-8-git-send-email-ying.hu...@intel.com/ Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan

[PATCH v5 2/7] acpi/generic_event_device: add an APEI error device

2024-08-02 Thread Mauro Carvalho Chehab
PNP0C33 device is used to report hardware errors to the bios via ACPI APEI Generic Hardware Error Source (GHES). Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan Cameron Cc: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 17

[PATCH 1/6] acpi/ghes: Prepare to support multiple sources on ghes

2024-11-13 Thread Mauro Carvalho Chehab
add a HEST table bios pointer and change the logic at acpi_ghes_record_errors() to dynamically use the new size. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 43 ++-- hw/arm/virt-acpi-build.c | 5 + in

[PATCH 2/6] acpi/ghes: add a firmware file with HEST address

2024-11-13 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab --- Change from v8: - hest_addr_lr is now pointing to the error source size and data. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 15

[PATCH 3/6] acpi/ghes: rename the function which gets hw error offsets

2024-11-13 Thread Mauro Carvalho Chehab
Rename: get_ghes_offsets->get_hw_error_offsets to make clear that this function return offsets based on the hardware error firmware. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/a

Re: [PATCH RFC 0/5] Change ghes driver to use HEST-based offsets

2024-11-12 Thread Mauro Carvalho Chehab
Em Wed, 13 Nov 2024 07:54:18 +0100 Mauro Carvalho Chehab escreveu: > Em Wed, 2 Oct 2024 15:45:34 +0200 > Igor Mammedov escreveu: > > > On Tue, 1 Oct 2024 13:42:45 +0200 > > Mauro Carvalho Chehab wrote: > > > > > This RFC series was part of the previo

Re: [PATCH RFC 0/5] Change ghes driver to use HEST-based offsets

2024-11-12 Thread Mauro Carvalho Chehab
Em Wed, 2 Oct 2024 15:45:34 +0200 Igor Mammedov escreveu: > On Tue, 1 Oct 2024 13:42:45 +0200 > Mauro Carvalho Chehab wrote: > > > This RFC series was part of the previous PR to add generic error injection > > support on GHES. > > > > It contains onl

[PATCH 0/6] Change ghes driver to use HEST-based offsets

2024-11-13 Thread Mauro Carvalho Chehab
migration using both virt-9.1 and virt-9.2 machines on qemu 9.2. I also tested migration with: qemu-9.1 -M virt-9.1 -cpu cortex-a57 => qemu-9.2 -M virt-9.1 -cpu cortex-a57 qemu-9.2 -M virt-9.1 -cpu cortex-a57 => qemu-9.1 -M virt-9.1 -cpu cortex-a57 Mauro Carvalho Chehab (6):

[PATCH 5/6] acpi/generic_event_device: Update GHES migration to cover hest addr

2024-11-13 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Increase migration version and change needed to check for both ghes_addr_le and hest_addr_le. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 + 1 file changed

[PATCH 4/6] acpi/ghes: Use HEST table offsets when preparing GHES records

2024-11-13 Thread Mauro Carvalho Chehab
the type of HEST error block structures. Yet, keep the old code, as this is needed for migration purposes. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 98 -- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/hw/acpi

[PATCH 6/6] acpi/generic_event_device: add logic to detect if HEST addr is available

2024-11-13 Thread Mauro Carvalho Chehab
Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 9.2 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi

[PATCH v3 04/15] acpi/ghes: better handle source_id and notification

2024-11-12 Thread Mauro Carvalho Chehab
caller function to fill both. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- Chenges from v10: - Some changes got moved to the previous patch. Changes from v8: - Non-rename/cleanup changes merged altogether; - source ID is now more generic, defined per guest target

[PATCH v3 02/15] acpi/ghes: simplify acpi_ghes_record_errors() code

2024-11-12 Thread Mauro Carvalho Chehab
Reduce the ident of the function and prepares it for the next changes. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 56 ++ 1 file changed, 29

[PATCH v3 01/15] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED

2024-11-12 Thread Mauro Carvalho Chehab
This is just duplicating ACPI_GHES_ERROR_SOURCE_COUNT, which has a better name. So, drop the duplication. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 7 ++- include/hw/acpi/ghes.h | 3 ++- 2 files changed, 4

Re: [PATCH RFC 4/5] acpi/generic_event_device: add logic to detect if HEST addr is available

2024-11-12 Thread Mauro Carvalho Chehab
Em Tue, 12 Nov 2024 15:55:57 +0100 Mauro Carvalho Chehab escreveu: > Em Thu, 3 Oct 2024 16:27:28 +0200 > Igor Mammedov escreveu: > > > > +++ b/hw/acpi/ghes.c > > > @@ -513,7 +513,7 @@ void ghes_record_cper_errors(const void *cper, size_t > > &

Re: [PATCH RFC 4/5] acpi/generic_event_device: add logic to detect if HEST addr is available

2024-11-12 Thread Mauro Carvalho Chehab
Em Thu, 3 Oct 2024 16:27:28 +0200 Igor Mammedov escreveu: > > +++ b/hw/acpi/ghes.c > > @@ -513,7 +513,7 @@ void ghes_record_cper_errors(const void *cper, size_t > > len, > > } > > ags = &acpi_ged_state->ghes_state; > > > > -if (!ags->hest_addr_le) { > > +if (!ags->hest_lookup

[PATCH v3 07/15] acpi/ghes: Change the type for source_id

2024-11-12 Thread Mauro Carvalho Chehab
As described at: ACPI 6.5 spec at: 18.3.2. ACPI Error Source In particular at GHES/GHESv2 table: Table 18.10 Generic Hardware Error Source Structure HEST source ID is actually a 16-bit value. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes

[PATCH v3 12/15] acpi/ghes: better name the offset of the hardware error firmware

2024-11-12 Thread Mauro Carvalho Chehab
The hardware error firmware is where HEST error structures are stored. Those can be GHESv2, but they can also be other types. Better name the location of the hardware error. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov

[PATCH v3 05/15] acpi/ghes: Fix acpi_ghes_record_errors() argument

2024-11-12 Thread Mauro Carvalho Chehab
Align the header file with the actual implementation of this function, as the first argument is source ID and not notification type. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- Changes from v8: - Non-rename/cleanup changes merged

[PATCH v3 00/15] Prepare GHES driver to support error injection

2024-11-12 Thread Mauro Carvalho Chehab
eries: https://lore.kernel.org/qemu-devel/cover.1727782588.git.mchehab+hua...@kernel.org/ v2: - some indentation fixes; - some description improvements; - fixed a badly-solved merge conflict that ended renaming a parameter. Mauro Carvalho Chehab (15): acpi/ghes: get rid of ACPI_HEST_SRC_ID_RES

[PATCH v3 13/15] acpi/ghes: move offset calculus to a separate function

2024-11-12 Thread Mauro Carvalho Chehab
, in preparation for a patch that will be changing the logic to calculate it from the HEST table. While here, properly name the variable which stores the cper address. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 41

[PATCH v3 15/15] docs: acpi_hest_ghes: fix documentation for CPER size

2024-11-12 Thread Mauro Carvalho Chehab
While the spec defines a CPER size of 4KiB for each record, currently it is set to 1KiB. Fix the documentation and add a pointer to the macro name there, as this may help to keep it updated. Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- docs

[PATCH v3 10/15] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-11-12 Thread Mauro Carvalho Chehab
Make error handling within ghes_record_cper_errors() consistent, i.e. instead abort just print a error in case ghes GED is not found. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c

[PATCH v3 09/15] acpi/ghes: better name GHES memory error function

2024-11-12 Thread Mauro Carvalho Chehab
The current function used to generate GHES data is specific for memory errors. Give a better name for it, as we now have a generic function as well. Reviewed-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c | 2 +- include/hw/acpi

[PATCH v3 08/15] acpi/ghes: make the GHES record generation more generic

2024-11-12 Thread Mauro Carvalho Chehab
to generate a memory error now belongs to acpi_ghes_record_errors() function. A further patch will give it a better name. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 122 +++-- include/hw/acpi/ghes.h | 3 + 2 files changed, 73

[PATCH v3 11/15] acpi/ghes: rename etc/hardware_error file macros

2024-11-12 Thread Mauro Carvalho Chehab
Now that we have also have a file to store HEST data location, which is part of GHES, better name the file where CPER records are stored. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 38

[PATCH v3 03/15] acpi/ghes: simplify the per-arch caller to build HEST table

2024-11-12 Thread Mauro Carvalho Chehab
The GHES driver requires not only a HEST table, but also a separate firmware file to store Error Structure records. It can't do one without the other. Simplify the caller logic for it to require one function. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jon

[PATCH v3 14/15] acpi/ghes: Change ghes fill logic to work with only one source

2024-11-12 Thread Mauro Carvalho Chehab
Extending to multiple sources require a BIOS pointer to the beginning of the HEST table, which in turn requires a backward-compatible code. So, the current code supports only one source. Ensure that and simplify the code. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 11

[PATCH v3 06/15] acpi/ghes: Remove a duplicated out of bounds check

2024-11-12 Thread Mauro Carvalho Chehab
acpi_ghes_record_errors() has an assert() at the beginning to ensure that source_id will be lower than ACPI_GHES_ERROR_SOURCE_COUNT. Remove a duplicated check. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 4 +--- 1 file

[PATCH 01/15] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED

2024-09-24 Thread Mauro Carvalho Chehab
This is just duplicating ACPI_GHES_ERROR_SOURCE_COUNT, which has a better name. So, drop the duplication. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 7 ++- include/hw/acpi/ghes.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions

[PATCH 00/15] Prepare GHES driver to support error injection

2024-09-24 Thread Mauro Carvalho Chehab
such preparation patches. The next series will contain the shift to use offsets from the location of the HEST table, together with a migration logic to make it compatible with 9.1. Mauro Carvalho Chehab (15): acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED acpi/ghes: sim

<    1   2   3   4   5   6   >