[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/14] acpi/ghes: only set hw_error_le or hest_addr_le
From: |
Mauro Carvalho Chehab |
Subject: |
[PATCH v3 06/14] acpi/ghes: only set hw_error_le or hest_addr_le |
Date: |
Fri, 31 Jan 2025 18:42:47 +0100 |
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 <mchehab+huawei@kernel.org>
---
hw/acpi/ghes.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
index a91dcd777433..ba8b1a3a13dc 100644
--- a/hw/acpi/ghes.c
+++ b/hw/acpi/ghes.c
@@ -232,8 +232,8 @@ ghes_gen_err_data_uncorrectable_recoverable(GArray *block,
* Initialize "etc/hardware_errors" and "etc/hardware_errors_addr" fw_cfg
blobs.
* See docs/specs/acpi_hest_ghes.rst for blobs format.
*/
-static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker,
- int num_sources)
+static void build_ghes_error_table(AcpiGhesState *ags, GArray *hardware_errors,
+ BIOSLinker *linker, int num_sources)
{
int i, error_status_block_offset;
@@ -278,13 +278,15 @@ static void build_ghes_error_table(GArray
*hardware_errors, BIOSLinker *linker,
i * ACPI_GHES_MAX_RAW_DATA_LENGTH);
}
- /*
- * tell firmware to write hardware_errors GPA into
- * hardware_errors_addr fw_cfg, once the former has been initialized.
- */
- bios_linker_loader_write_pointer(linker, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, 0,
- sizeof(uint64_t),
- ACPI_HW_ERROR_FW_CFG_FILE, 0);
+ if (!ags->use_hest_addr) {
+ /*
+ * Tell firmware to write hardware_errors GPA into
+ * hardware_errors_addr fw_cfg, once the former has been initialized.
+ */
+ bios_linker_loader_write_pointer(linker,
ACPI_HW_ERROR_ADDR_FW_CFG_FILE,
+ 0, sizeof(uint64_t),
+ ACPI_HW_ERROR_FW_CFG_FILE, 0);
+ }
}
/* Build Generic Hardware Error Source version 2 (GHESv2) */
@@ -373,7 +375,7 @@ void acpi_build_hest(AcpiGhesState *ags, GArray *table_data,
hest_offset = table_data->len;
- build_ghes_error_table(hardware_errors, linker, num_sources);
+ build_ghes_error_table(ags, hardware_errors, linker, num_sources);
acpi_table_begin(&table, table_data);
@@ -404,13 +406,13 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState
*s,
fw_cfg_add_file(s, ACPI_HW_ERROR_FW_CFG_FILE, hardware_error->data,
hardware_error->len);
- /* Create a read-write fw_cfg file for Address */
- fw_cfg_add_file_callback(s, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, NULL, NULL,
- NULL, &(ags->hw_error_le), sizeof(ags->hw_error_le), false);
-
if (ags->use_hest_addr) {
fw_cfg_add_file_callback(s, ACPI_HEST_ADDR_FW_CFG_FILE, NULL, NULL,
NULL, &(ags->hest_addr_le), sizeof(ags->hest_addr_le), false);
+ } else {
+ /* Create a read-write fw_cfg file for Address */
+ fw_cfg_add_file_callback(s, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, NULL, NULL,
+ NULL, &(ags->hw_error_le), sizeof(ags->hw_error_le), false);
}
ags->present = true;
--
2.48.1
- [PATCH v3 00/14] Change ghes to use HEST-based offsets and add support for error inject, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 10/14] tests/acpi: virt: allow acpi table changes for a new table: HEST, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 11/14] arm/virt: Wire up a GED error device for ACPI / GHES, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 07/14] acpi/ghes: add a notifier to notify when error data is ready, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 09/14] acpi/generic_event_device: add an APEI error device, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 08/14] acpi/ghes: Cleanup the code which gets ghes ged state, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 06/14] acpi/ghes: only set hw_error_le or hest_addr_le,
Mauro Carvalho Chehab <=
- [PATCH v3 01/14] acpi/ghes: Prepare to support multiple sources on ghes, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 13/14] qapi/acpi-hest: add an interface to do generic CPER error injection, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 02/14] acpi/ghes: add a firmware file with HEST address, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 14/14] scripts/ghes_inject: add a script to generate GHES error inject, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 04/14] acpi/generic_event_device: Update GHES migration to cover hest addr, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 12/14] tests/acpi: virt: add a HEST table to aarch64 virt and update DSDT, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 03/14] acpi/ghes: Use HEST table offsets when preparing GHES records, Mauro Carvalho Chehab, 2025/01/31
- [PATCH v3 05/14] acpi/generic_event_device: add logic to detect if HEST addr is available, Mauro Carvalho Chehab, 2025/01/31