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

2024-12-09 Thread Mauro Carvalho Chehab
Em Wed, 4 Dec 2024 10:24:13 +0100 Igor Mammedov escreveu: > On Wed, 4 Dec 2024 09:56:35 +0100 > Mauro Carvalho Chehab wrote: > > > Em Wed, 4 Dec 2024 08:54:40 +0100 > > Igor Mammedov escreveu: > > > > > On Tue, 3 Dec 2024 14:47:30 +010

Re: [PATCH v2 02/13] tests/acpi: virt: allow acpi table changes for a new table: HEST

2025-01-31 Thread Mauro Carvalho Chehab
Em Thu, 30 Jan 2025 15:38:30 +0100 Igor Mammedov escreveu: > On Thu, 30 Jan 2025 14:03:24 +0100 > Mauro Carvalho Chehab wrote: > > > Em Wed, 29 Jan 2025 16:03:28 +0100 > > Igor Mammedov escreveu: > > > > > On Wed, 29 Jan 2025 09:04:08 +010

Re: [PATCH v2 03/13] acpi/ghes: add a firmware file with HEST address

2025-01-31 Thread Mauro Carvalho Chehab
Em Wed, 29 Jan 2025 16:23:28 +0100 Igor Mammedov escreveu: > > + > > +/* > > + * Tell firmware to write into GPA the address of HEST via fw_cfg, > > + * once initialized. > > + */ > > +bios_linker_loader_write_pointer(linker, > > + ACPI_HEST

[PATCH v3 14/14] scripts/ghes_inject: add a script to generate GHES error inject

2025-01-31 Thread Mauro Carvalho Chehab
Such script allows customizing the error data, allowing to change all fields at the record. Please use: $ ghes_inject.py arm -h For more details about its usage. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS| 3 + scripts/arm_processor_error.py | 476

[PATCH v3 09/14] acpi/generic_event_device: add an APEI error device

2025-01-31 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 v3 11/14] arm/virt: Wire up a GED error device for ACPI / GHES

2025-01-31 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling generic error ACPI Event via GED & error source 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: Jona

[PATCH v3 00/14] Change ghes to use HEST-based offsets and add support for error inject

2025-01-31 Thread Mauro Carvalho Chehab
if (ags && addr) { ram_addr = qemu_ram_addr_from_host(addr); if (ram_addr != RAM_ADDR_INVALID && diff --git a/tests/data/acpi/aarch64/virt/HEST b/tests/data/acpi/aarch64/virt/HEST deleted file mode 100644 index 8b0cf87700fa.. Binary files a/tests/data/

[PATCH v3 13/14] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-31 Thread Mauro Carvalho Chehab
Carvalho Chehab; Co-authored-by: Jonathan Cameron Co-authored-by: Shiju Jose Co-authored-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Cameron Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov --- Changes since v9: - ARM source IDs renamed to

[PATCH v3 02/14] acpi/ghes: add a firmware file with HEST address

2025-01-31 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its the start of the table at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 16 include/hw/acpi/ghes.h | 1 + 2 files changed, 17 insertions(+) diff --git a/hw

[PATCH v3 03/14] acpi/ghes: Use HEST table offsets when preparing GHES records

2025-01-31 Thread Mauro Carvalho Chehab
structures. Yet, keep the old code, as this is needed for migration purposes. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 132 - include/hw/acpi/ghes.h | 1 + 2 files changed, 119 insertions(+), 14 deletions(-) diff --git a/hw/acpi

[PATCH v3 01/14] acpi/ghes: Prepare to support multiple sources on ghes

2025-01-31 Thread Mauro Carvalho Chehab
inter 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 Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 47 +--- hw/arm/virt-acpi-build.c | 5 + in

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

2025-01-31 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 10.0 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan

[PATCH v3 04/14] acpi/generic_event_device: Update GHES migration to cover hest addr

2025-01-31 Thread Mauro Carvalho Chehab
The GHES migration logic should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi

[PATCH v3 08/14] acpi/ghes: Cleanup the code which gets ghes ged state

2025-01-31 Thread Mauro Carvalho Chehab
Move the check logic into a common function and simplify the code which checks if GHES is enabled and was properly setup. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- hw/acpi/ghes-stub.c| 7 --- hw/acpi/ghes.c | 40

[PATCH v3 12/14] tests/acpi: virt: add a HEST table to aarch64 virt and update DSDT

2025-01-31 Thread Mauro Carvalho Chehab
*/) // _HID: Hardware ID Name (_UID, Zero) // _UID: Unique ID } + +Device (GEDD) +{ +Name (_HID, "PNP0C33" /* Error Device */) // _HID: Hardware ID +Name (_UID, Zero) // _UID: Unique ID + } } } Signed-off-b

[PATCH v3 10/14] tests/acpi: virt: allow acpi table changes for a new table: HEST

2025-01-31 Thread Mauro Carvalho Chehab
The DSDT table will also be affected by such change. Signed-off-by: Mauro Carvalho Chehab --- tests/data/acpi/aarch64/virt/HEST | 0 tests/qtest/bios-tables-test-allowed-diff.h | 1 + 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/aarch64/virt/HEST diff --git a

[PATCH v3 07/14] acpi/ghes: add a notifier to notify when error data is ready

2025-01-31 Thread Mauro Carvalho Chehab
Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 5 - include/hw/acpi/ghes.h | 3 +++ 2 files

[PATCH v3 06/14] acpi/ghes: only set hw_error_le or hest_addr_le

2025-01-31 Thread Mauro Carvalho Chehab
The hw_error_le pointer is used for legacy support (virt-9.2). Starting from virt-10.0, HEST table is accessed via hest_addr_le. Remove fw_cfg logic for legacy support if virt is 10.0 or upper. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 30 -- 1 file

Re: [PATCH v2 12/13] tests/acpi: virt: add a HEST table to aarch64 virt and update DSDT

2025-01-31 Thread Mauro Carvalho Chehab
Em Wed, 29 Jan 2025 16:29:53 +0100 Igor Mammedov escreveu: > On Wed, 29 Jan 2025 09:04:18 +0100 > Mauro Carvalho Chehab wrote: > > > DSDT has gained a GED device to notify errors: > > > > --- a/DSDT.dsl2025-01-28 09:38:15.155347858 +0100 > > +++ b

Re: [PATCH v2 02/13] tests/acpi: virt: allow acpi table changes for a new table: HEST

2025-01-30 Thread Mauro Carvalho Chehab
Em Wed, 29 Jan 2025 16:03:28 +0100 Igor Mammedov escreveu: > On Wed, 29 Jan 2025 09:04:08 +0100 > Mauro Carvalho Chehab wrote: > > > The DSDT table will also be affected by such change. > > > > Signed-off-by: Mauro Carvalho Chehab > > move it right bef

Re: [PATCH v2 08/13] acpi/ghes: Cleanup the code which gets ghes ged state

2025-01-30 Thread Mauro Carvalho Chehab
Em Wed, 29 Jan 2025 15:55:30 +0100 Igor Mammedov escreveu: > On Wed, 29 Jan 2025 09:04:14 +0100 > Mauro Carvalho Chehab wrote: > > > Move the check logic into a common function and simplify the > > code which checks if GHES is enabled and was properly setup. > >

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

2024-11-22 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 v2 1/5] acpi/ghes: Prepare to support multiple sources on ghes

2024-11-22 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 v2 2/5] acpi/ghes: add a firmware file with HEST address

2024-11-22 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- 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

[PATCH v2 3/5] acpi/ghes: Use HEST table offsets when preparing GHES records

2024-11-22 Thread Mauro Carvalho Chehab
and the type of the 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

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

2024-11-22 Thread Mauro Carvalho Chehab
nction which gets hw error offsets) was merged on the cleanup series. Mauro Carvalho Chehab (5): acpi/ghes: Prepare to support multiple sources on ghes acpi/ghes: add a firmware file with HEST address acpi/ghes: Use HEST table offsets when preparing GHES records acpi/generic_event_device:

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

2024-11-22 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c

[PATCH 24/31] target/arm: add an experimental mpidr arm cpu property object

2024-12-06 Thread Mauro Carvalho Chehab
it to be queried via QMP using qom-get function. Signed-off-by: Mauro Carvalho Chehab --- target/arm/cpu.c| 1 + target/arm/cpu.h| 1 + target/arm/helper.c | 10 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index

[PATCH 23/31] scripts/ghes_inject: add a script to generate GHES error inject

2024-12-06 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 21/31] arm/virt: Wire up a GED error device for ACPI / GHES

2024-12-06 Thread Mauro Carvalho Chehab
than Cameron Co-authored-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov --- Changes from v8: - Added a call to the function that produces GHES generic records, as this is now added earlier in this series. Signed-off-by: Mauro Carvalho Chehab --- hw/arm/

[PATCH 26/31] acpi/ghes: move offset calculus to a separate function

2024-12-06 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 Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 40

[PATCH 14/31] acpi/ghes: Prepare to support multiple sources on ghes

2024-12-06 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 07/31] acpi/ghes: Change the type for source_id

2024-12-06 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 Reviewed-by: Igor

[PATCH 20/31] acpi/generic_event_device: add an APEI error device

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

[PATCH 30/31] docs: acpi_hest_ghes: fix documentation for CPER size

2024-12-06 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 Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- docs

[PATCH 10/31] acpi/ghes: better name GHES memory error function

2024-12-06 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. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c

[PATCH 25/31] scripts/arm_processor_error.py: retrieve mpidr if not filled

2024-12-06 Thread Mauro Carvalho Chehab
Add support to retrieve mpidr value via qom-get. Signed-off-by: Mauro Carvalho Chehab --- 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

[PATCH 13/31] acpi/ghes: better name the offset of the hardware error firmware

2024-12-06 Thread Mauro Carvalho Chehab
Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- hw/acpi/generic_event_device.c | 4 ++-- hw/acpi/ghes.c | 4 ++-- include/hw/acpi/ghes.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw

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

2024-12-06 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 05/31] acpi/ghes: Fix acpi_ghes_record_errors() argument

2024-12-06 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 17/31] acpi/generic_event_device: Update GHES migration to cover hest addr

2024-12-06 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b

[PATCH 08/31] acpi/ghes: don't check if physical_address is not zero

2024-12-06 Thread Mauro Carvalho Chehab
The 'physical_address' value is a faulty page. As such, 0 is as valid as any other value. Suggested-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/gh

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

2024-12-06 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 Reviewed-by: Jonathan

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

2024-12-06 Thread Mauro Carvalho Chehab
. The actual preparation will be moved to this series: 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 C

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

2024-12-06 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

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

2024-12-06 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 27/31] DEBUG

2024-12-06 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index abca351b18de..1fe4c536611a 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -534,9 +534,11 @@ void ghes_record_cper_errors(const void *cper

[PATCH 22/31] qapi/acpi-hest: add an interface to do generic CPER error injection

2024-12-06 Thread Mauro Carvalho Chehab
Carvalho Chehab; Co-authored-by: Jonathan Cameron Signed-off-by: Jonathan Cameron Co-authored-by: Shiju Jose Signed-off-by: Shiju Jose Co-authored-by: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- Changes since v9: - ARM source IDs renamed to reflect SYNC/ASYNC; - command

[PATCH 31/31] FIXME: acpi/ghes: properly set data record size

2024-12-06 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 1fe4c536611a..856551df2103 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -211,6 +211,12

[PATCH 16/31] acpi/ghes: Use HEST table offsets when preparing GHES records

2024-12-06 Thread Mauro Carvalho Chehab
and the type of the HEST error block structures. Yet, keep the old code, as this is needed for migration purposes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 106 - 1 file changed, 96 insertions(+), 10

[PATCH 15/31] acpi/ghes: add a firmware file with HEST address

2024-12-06 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- 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

[PATCH 11/31] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-12-06 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. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1

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

2024-12-06 Thread Mauro Carvalho Chehab
caller function to fill both. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- 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

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

2024-12-06 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 28/31] acpi/ghes: Change ghes fill logic to work with only one source

2024-12-06 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 Reviewed-by: Jonathan Cameron

[PATCH 09/31] acpi/ghes: make the GHES record generation more generic

2024-12-06 Thread Mauro Carvalho Chehab
described at: ACPI 6.2: 18.3.2.7.1 Generic Error Data The remaining code 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 Reviewed-by: Jonathan Cameron Reviewed-by: Igor

[PATCH 29/31] HACK: use GPIO as source ID for virt-9.1 machines

2024-12-06 Thread Mauro Carvalho Chehab
This reverts commit 692373fc8838a6450ff5b5a8708646a673b693dd. Signed-off-by: Mauro Carvalho Chehab --- hw/arm/virt-acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 31f2db01458d..55d12562e83e 100644 --- a

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

2024-12-06 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 19/31] acpi/ghes: add a notifier to notify when error data is ready

2024-12-06 Thread Mauro Carvalho Chehab
Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - include/hw/acpi/ghes.h | 3 +++ 2 files changed, 7 insertions(+), 1

Re: [PATCH 27/31] DEBUG

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:16:31 +0100 Markus Armbruster escreveu: > Ani Sinha writes: > > > On Fri, Dec 6, 2024 at 10:51 PM Mauro Carvalho Chehab > > wrote: > >> > >> Signed-off-by: Mauro Carvalho Chehab > >> --- > >> hw/acpi/ghes.c | 2 +

Re: [PATCH 00/31] Prepare GHES driver to support error injection

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:15:19 +0100 Markus Armbruster escreveu: > Markus Armbruster writes: > > > This is v10, right? > > Scratch that, the cover letter explains: "As agreed duing v10 review, > I'll be splitting the big patch series into separate pull requests, > starting with the cleanup ser

Re: [PATCH 31/31] FIXME: acpi/ghes: properly set data record size

2024-12-07 Thread Mauro Carvalho Chehab
Em Sat, 07 Dec 2024 07:17:42 +0100 Markus Armbruster escreveu: > Another subject line that suggests this isn't fully baked. Respin to > reduce confusion? The last 3 patches on this series were purely to debug some things, and aren't meant to be submitted. This particular one is just a potential

[PATCH v6 14/16] acpi/ghes: move offset calculus to a separate function

2024-12-07 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 | 40

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

2024-12-07 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 (16): acpi/ghes: get r

[PATCH v6 04/16] acpi/ghes: better handle source_id and notification

2024-12-07 Thread Mauro Carvalho Chehab
caller function to fill both. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- 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

[PATCH v6 16/16] docs: acpi_hest_ghes: fix documentation for CPER size

2024-12-07 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 Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- docs

[PATCH v6 02/16] acpi/ghes: simplify acpi_ghes_record_errors() code

2024-12-07 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 v6 03/16] acpi/ghes: simplify the per-arch caller to build HEST table

2024-12-07 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 v6 15/16] acpi/ghes: Change ghes fill logic to work with only one source

2024-12-07 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 Reviewed-by: Jonathan Cameron

[PATCH v6 09/16] acpi/ghes: make the GHES record generation more generic

2024-12-07 Thread Mauro Carvalho Chehab
described at: ACPI 6.2: 18.3.2.7.1 Generic Error Data The remaining code 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 # Conflicts: # roms/edk2 --- hw/acpi/ghes.c

[PATCH v6 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-12-07 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. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1

[PATCH v6 05/16] acpi/ghes: Fix acpi_ghes_record_errors() argument

2024-12-07 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 v6 10/16] acpi/ghes: better name GHES memory error function

2024-12-07 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 Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c

[PATCH v6 12/16] acpi/ghes: rename etc/hardware_error file macros

2024-12-07 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 v6 08/16] acpi/ghes: don't check if physical_address is not zero

2024-12-07 Thread Mauro Carvalho Chehab
The 'physical_address' value is a faulty page. As such, 0 is as valid as any other value. Suggested-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index edc74c38bf8a..a3

[PATCH v6 07/16] acpi/ghes: Change the type for source_id

2024-12-07 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 Reviewed-by: Igor

[PATCH v6 06/16] acpi/ghes: Remove a duplicated out of bounds check

2024-12-07 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 v6 01/16] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED

2024-12-07 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

[PATCH v6 13/16] acpi/ghes: better name the offset of the hardware error firmware

2024-12-07 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

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

2025-01-08 Thread Mauro Carvalho Chehab
Em Wed, 8 Jan 2025 09:08:51 -0500 "Michael S. Tsirkin" escreveu: > On Wed, Dec 04, 2024 at 04:57:54PM +0100, Mauro Carvalho Chehab wrote: > > This series was part of the previous PR to add generic error injection > > support on GHES. It depends on a cleanup patch seri

[PATCH 01/11] acpi/ghes: Prepare to support multiple sources on ghes

2025-01-22 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 06/11] acpi/ghes: add a notifier to notify when error data is ready

2025-01-22 Thread Mauro Carvalho Chehab
Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - include/hw/acpi/ghes.h | 3 +++ 2 files changed, 7 insertions(+), 1

[PATCH 03/11] acpi/ghes: Use HEST table offsets when preparing GHES records

2025-01-22 Thread Mauro Carvalho Chehab
and the type of the 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

[PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-22 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- 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

[PATCH 04/11] acpi/generic_event_device: Update GHES migration to cover hest addr

2025-01-22 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c

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

2025-01-22 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 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-22 Thread Mauro Carvalho Chehab
Carvalho Chehab; Co-authored-by: Jonathan Cameron Co-authored-by: Shiju Jose Co-authored-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Cameron Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab --- Changes since v9: - ARM source IDs renamed to reflect SYNC/ASYNC; - command

[PATCH 07/11] acpi/ghes: Cleanup the code which gets ghes ged state

2025-01-22 Thread Mauro Carvalho Chehab
Move the check logic into a common function and simplify the code which checks if GHES is enabled and was properly setup. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 4 ++-- hw/acpi/ghes.c | 33 +++-- include/hw/acpi/ghes.h | 9

[PATCH 00/11] Change ghes to use HEST-based offsets and add support for error inject

2025-01-22 Thread Mauro Carvalho Chehab
ew QAPI to allow injecting GHESv2 errors, and a script using such QAPI to inject ARM Processor Error records. PS.: If I'm counting well, this is the 18th version of this series rebase. Mauro Carvalho Chehab (11): acpi/ghes: Prepare to support multiple sources on ghes acpi/ghes: add a fir

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

2025-01-22 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 08/11] acpi/generic_event_device: add an APEI error device

2025-01-22 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 09/11] arm/virt: Wire up a GED error device for ACPI / GHES

2025-01-22 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling generic error ACPI Event via GED & error source 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: Jona

Re: [PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-23 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:02:17 + Jonathan Cameron escreveu: > > --- > > > > Change from v8: > > - hest_addr_lr is now pointing to the error source size and data. > > > > Signed-off-by: Mauro Carvalho Chehab > Bonus. I guess you really like this

Re: [PATCH 03/11] acpi/ghes: Use HEST table offsets when preparing GHES records

2025-01-23 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:29:19 + Jonathan Cameron escreveu: > On Wed, 22 Jan 2025 16:46:20 +0100 > Mauro Carvalho Chehab wrote: > > > There are two pointers that are needed during error injection: > > > > 1. The start address of the CPER block to be stored; &g

Re: [PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-28 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:02:17 + Jonathan Cameron escreveu: > On Wed, 22 Jan 2025 16:46:19 +0100 > Mauro Carvalho Chehab wrote: > > > Store HEST table address at GPA, placing its content at > > hest_addr_le variable. > > > > Signed-off-by: Mauro Carvalho

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

2025-01-28 Thread Mauro Carvalho Chehab
Em Fri, 24 Jan 2025 11:23:46 +0100 Igor Mammedov escreveu: > On Wed, 22 Jan 2025 16:46:22 +0100 > Mauro Carvalho Chehab wrote: > > > 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 > &

Re: [PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-28 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 18:01:35 +0100 Igor Mammedov escreveu: > On Thu, 23 Jan 2025 10:02:17 + > Jonathan Cameron wrote: > > > On Wed, 22 Jan 2025 16:46:19 +0100 > > Mauro Carvalho Chehab wrote: > > > > > Store HEST table address at GPA, placing its co

Re: [PATCH 08/11] acpi/generic_event_device: add an APEI error device

2025-01-28 Thread Mauro Carvalho Chehab
Em Fri, 24 Jan 2025 13:30:54 +0100 Igor Mammedov escreveu: > On Wed, 22 Jan 2025 16:46:25 +0100 > Mauro Carvalho Chehab wrote: > > > Adds a generic error device to handle generic hardware error > > events as specified at ACPI 6.5 specification at 18.3.2.7.2: > > http

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

2025-01-28 Thread Mauro Carvalho Chehab
Em Tue, 28 Jan 2025 12:29:51 +0100 Mauro Carvalho Chehab escreveu: > Em Fri, 24 Jan 2025 11:23:46 +0100 > Igor Mammedov escreveu: > > > On Wed, 22 Jan 2025 16:46:22 +0100 > > Mauro Carvalho Chehab wrote: > > > > > Create a new property (x-has-hest-add

[PATCH v2 11/13] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-29 Thread Mauro Carvalho Chehab
Carvalho Chehab; Co-authored-by: Jonathan Cameron Co-authored-by: Shiju Jose Co-authored-by: Mauro Carvalho Chehab Signed-off-by: Jonathan Cameron Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov --- Changes since v9: - ARM source IDs renamed to

<    1   2   3   4   5   6   >