[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 31/31] FIXME: acpi/ghes: properly set data record size
From: |
Mauro Carvalho Chehab |
Subject: |
[PATCH 31/31] FIXME: acpi/ghes: properly set data record size |
Date: |
Fri, 6 Dec 2024 18:12:53 +0100 |
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
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 @@ ghes_gen_err_data_uncorrectable_recoverable(GArray *block,
*/
QemuUUID fru_id = {};
+ /*
+ * Calculate the size with this block. No need to check for
+ * too big CPER, as CPER size is checked at ghes_record_cper_errors()
+ */
+ data_length += ACPI_GHES_GESB_SIZE;
+
/* Build the new generic error status block header */
acpi_ghes_generic_error_status(block, ACPI_GEBS_UNCORRECTABLE,
0, 0, data_length, ACPI_CPER_SEV_RECOVERABLE);
@@ -580,21 +586,12 @@ int acpi_ghes_memory_errors(uint16_t source_id, uint64_t
physical_address)
UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \
0xED, 0x7C, 0x83, 0xB1);
Error *errp = NULL;
- int data_length;
GArray *block;
block = g_array_new(false, true /* clear */, 1);
- data_length = ACPI_GHES_DATA_LENGTH + ACPI_GHES_MEM_CPER_LENGTH;
- /*
- * It should not run out of the preallocated memory if adding a new generic
- * error data entry
- */
- assert((data_length + ACPI_GHES_GESB_SIZE) <=
- ACPI_GHES_MAX_RAW_DATA_LENGTH);
-
ghes_gen_err_data_uncorrectable_recoverable(block, guid,
- data_length);
+ ACPI_GHES_MAX_RAW_DATA_LENGTH);
/* Build the memory section CPER for above new generic error data entry */
acpi_ghes_build_append_mem_cper(block, physical_address);
--
2.47.1
- [PATCH 05/31] acpi/ghes: Fix acpi_ghes_record_errors() argument, (continued)
- [PATCH 05/31] acpi/ghes: Fix acpi_ghes_record_errors() argument, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 15/31] acpi/ghes: add a firmware file with HEST address, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 01/31] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 11/31] acpi/ghes: don't crash QEMU if ghes GED is not found, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 08/31] acpi/ghes: don't check if physical_address is not zero, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 17/31] acpi/generic_event_device: Update GHES migration to cover hest addr, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 10/31] acpi/ghes: better name GHES memory error function, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 12/31] acpi/ghes: rename etc/hardware_error file macros, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 03/31] acpi/ghes: simplify the per-arch caller to build HEST table, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 07/31] acpi/ghes: Change the type for source_id, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 31/31] FIXME: acpi/ghes: properly set data record size,
Mauro Carvalho Chehab <=
- [PATCH 19/31] acpi/ghes: add a notifier to notify when error data is ready, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 23/31] scripts/ghes_inject: add a script to generate GHES error inject, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 27/31] DEBUG, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 21/31] arm/virt: Wire up a GED error device for ACPI / GHES, Mauro Carvalho Chehab, 2024/12/06
- [PATCH 18/31] acpi/generic_event_device: add logic to detect if HEST addr is available, Mauro Carvalho Chehab, 2024/12/06