28
28
#include "hw/nvram/fw_cfg.h"
29
29
#include "qemu/uuid.h"
30
30
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"
33
33
34
34
/* The max size in bytes for one error block */
35
35
#define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB)
@@ -234,7 +234,7 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker)
234
234
ACPI_GHES_MAX_RAW_DATA_LENGTH * ACPI_GHES_ERROR_SOURCE_COUNT );
235
235
236
236
/* 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 ,
238
238
hardware_errors , sizeof (uint64_t ), false);
239
239
240
240
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)
243
243
* corresponding "Generic Error Status Block"
244
244
*/
245
245
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 );
249
252
}
250
253
251
254
/*
252
255
* tell firmware to write hardware_errors GPA into
253
256
* hardware_errors_addr fw_cfg, once the former has been initialized.
254
257
*/
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 );
257
261
}
258
262
259
263
/* Build Generic Hardware Error Source version 2 (GHESv2) */
@@ -290,8 +294,10 @@ static void build_ghes_v2(GArray *table_data,
290
294
build_append_gas (table_data , AML_AS_SYSTEM_MEMORY , 0x40 , 0 ,
291
295
4 /* QWord access */ , 0 );
292
296
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 ));
295
301
296
302
/* Notification Structure */
297
303
build_ghes_hw_error_notification (table_data , notify );
@@ -308,9 +314,11 @@ static void build_ghes_v2(GArray *table_data,
308
314
build_append_gas (table_data , AML_AS_SYSTEM_MEMORY , 0x40 , 0 ,
309
315
4 /* QWord access */ , 0 );
310
316
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 ));
314
322
315
323
/*
316
324
* Read Ack Preserve field
@@ -346,11 +354,11 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,
346
354
GArray * hardware_error )
347
355
{
348
356
/* 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 ,
350
358
hardware_error -> len );
351
359
352
360
/* 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 ,
354
362
NULL , & (ags -> ghes_addr_le ), sizeof (ags -> ghes_addr_le ), false);
355
363
356
364
ags -> present = true;
0 commit comments