Skip to content

Commit 4651745

Browse files
mchehabmstsirkin
authored andcommitted
acpi/ghes: rename etc/hardware_error file macros
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 <[email protected]> Reviewed-by: Igor Mammedov <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Message-Id: <e79a013bcd9f634b46ff6b34756d1b1403713af3.1736945236.git.mchehab+huawei@kernel.org> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 1acc8d4 commit 4651745

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

hw/acpi/ghes.c

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "hw/nvram/fw_cfg.h"
2929
#include "qemu/uuid.h"
3030

31-
#define ACPI_GHES_ERRORS_FW_CFG_FILE "etc/hardware_errors"
32-
#define ACPI_GHES_DATA_ADDR_FW_CFG_FILE "etc/hardware_errors_addr"
31+
#define ACPI_HW_ERROR_FW_CFG_FILE "etc/hardware_errors"
32+
#define ACPI_HW_ERROR_ADDR_FW_CFG_FILE "etc/hardware_errors_addr"
3333

3434
/* The max size in bytes for one error block */
3535
#define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB)
@@ -234,7 +234,7 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker)
234234
ACPI_GHES_MAX_RAW_DATA_LENGTH * ACPI_GHES_ERROR_SOURCE_COUNT);
235235

236236
/* Tell guest firmware to place hardware_errors blob into RAM */
237-
bios_linker_loader_alloc(linker, ACPI_GHES_ERRORS_FW_CFG_FILE,
237+
bios_linker_loader_alloc(linker, ACPI_HW_ERROR_FW_CFG_FILE,
238238
hardware_errors, sizeof(uint64_t), false);
239239

240240
for (i = 0; i < ACPI_GHES_ERROR_SOURCE_COUNT; i++) {
@@ -243,17 +243,21 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker)
243243
* corresponding "Generic Error Status Block"
244244
*/
245245
bios_linker_loader_add_pointer(linker,
246-
ACPI_GHES_ERRORS_FW_CFG_FILE, sizeof(uint64_t) * i,
247-
sizeof(uint64_t), ACPI_GHES_ERRORS_FW_CFG_FILE,
248-
error_status_block_offset + i * ACPI_GHES_MAX_RAW_DATA_LENGTH);
246+
ACPI_HW_ERROR_FW_CFG_FILE,
247+
sizeof(uint64_t) * i,
248+
sizeof(uint64_t),
249+
ACPI_HW_ERROR_FW_CFG_FILE,
250+
error_status_block_offset +
251+
i * ACPI_GHES_MAX_RAW_DATA_LENGTH);
249252
}
250253

251254
/*
252255
* tell firmware to write hardware_errors GPA into
253256
* hardware_errors_addr fw_cfg, once the former has been initialized.
254257
*/
255-
bios_linker_loader_write_pointer(linker, ACPI_GHES_DATA_ADDR_FW_CFG_FILE,
256-
0, sizeof(uint64_t), ACPI_GHES_ERRORS_FW_CFG_FILE, 0);
258+
bios_linker_loader_write_pointer(linker, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, 0,
259+
sizeof(uint64_t),
260+
ACPI_HW_ERROR_FW_CFG_FILE, 0);
257261
}
258262

259263
/* Build Generic Hardware Error Source version 2 (GHESv2) */
@@ -290,8 +294,10 @@ static void build_ghes_v2(GArray *table_data,
290294
build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 0x40, 0,
291295
4 /* QWord access */, 0);
292296
bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
293-
address_offset + GAS_ADDR_OFFSET, sizeof(uint64_t),
294-
ACPI_GHES_ERRORS_FW_CFG_FILE, source_id * sizeof(uint64_t));
297+
address_offset + GAS_ADDR_OFFSET,
298+
sizeof(uint64_t),
299+
ACPI_HW_ERROR_FW_CFG_FILE,
300+
source_id * sizeof(uint64_t));
295301

296302
/* Notification Structure */
297303
build_ghes_hw_error_notification(table_data, notify);
@@ -308,9 +314,11 @@ static void build_ghes_v2(GArray *table_data,
308314
build_append_gas(table_data, AML_AS_SYSTEM_MEMORY, 0x40, 0,
309315
4 /* QWord access */, 0);
310316
bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE,
311-
address_offset + GAS_ADDR_OFFSET,
312-
sizeof(uint64_t), ACPI_GHES_ERRORS_FW_CFG_FILE,
313-
(ACPI_GHES_ERROR_SOURCE_COUNT + source_id) * sizeof(uint64_t));
317+
address_offset + GAS_ADDR_OFFSET,
318+
sizeof(uint64_t),
319+
ACPI_HW_ERROR_FW_CFG_FILE,
320+
(ACPI_GHES_ERROR_SOURCE_COUNT + source_id)
321+
* sizeof(uint64_t));
314322

315323
/*
316324
* Read Ack Preserve field
@@ -346,11 +354,11 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,
346354
GArray *hardware_error)
347355
{
348356
/* Create a read-only fw_cfg file for GHES */
349-
fw_cfg_add_file(s, ACPI_GHES_ERRORS_FW_CFG_FILE, hardware_error->data,
357+
fw_cfg_add_file(s, ACPI_HW_ERROR_FW_CFG_FILE, hardware_error->data,
350358
hardware_error->len);
351359

352360
/* Create a read-write fw_cfg file for Address */
353-
fw_cfg_add_file_callback(s, ACPI_GHES_DATA_ADDR_FW_CFG_FILE, NULL, NULL,
361+
fw_cfg_add_file_callback(s, ACPI_HW_ERROR_ADDR_FW_CFG_FILE, NULL, NULL,
354362
NULL, &(ags->ghes_addr_le), sizeof(ags->ghes_addr_le), false);
355363

356364
ags->present = true;

0 commit comments

Comments
 (0)