2 * Support for generating APEI tables and recording CPER for Guests
4 * Copyright (c) 2020 HUAWEI TECHNOLOGIES CO., LTD.
6 * Author: Dongjiu Geng <gengdongjiu@huawei.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, see <http://www.gnu.org/licenses/>.
25 #include "hw/acpi/bios-linker-loader.h"
28 * Values for Hardware Error Notification Type field
30 enum AcpiGhesNotifyType
{
32 ACPI_GHES_NOTIFY_POLLED
= 0,
33 /* External Interrupt */
34 ACPI_GHES_NOTIFY_EXTERNAL
= 1,
36 ACPI_GHES_NOTIFY_LOCAL
= 2,
38 ACPI_GHES_NOTIFY_SCI
= 3,
40 ACPI_GHES_NOTIFY_NMI
= 4,
41 /* CMCI, ACPI 5.0: 18.3.2.7, Table 18-290 */
42 ACPI_GHES_NOTIFY_CMCI
= 5,
43 /* MCE, ACPI 5.0: 18.3.2.7, Table 18-290 */
44 ACPI_GHES_NOTIFY_MCE
= 6,
45 /* GPIO-Signal, ACPI 6.0: 18.3.2.7, Table 18-332 */
46 ACPI_GHES_NOTIFY_GPIO
= 7,
47 /* ARMv8 SEA, ACPI 6.1: 18.3.2.9, Table 18-345 */
48 ACPI_GHES_NOTIFY_SEA
= 8,
49 /* ARMv8 SEI, ACPI 6.1: 18.3.2.9, Table 18-345 */
50 ACPI_GHES_NOTIFY_SEI
= 9,
51 /* External Interrupt - GSIV, ACPI 6.1: 18.3.2.9, Table 18-345 */
52 ACPI_GHES_NOTIFY_GSIV
= 10,
53 /* Software Delegated Exception, ACPI 6.2: 18.3.2.9, Table 18-383 */
54 ACPI_GHES_NOTIFY_SDEI
= 11,
55 /* 12 and greater are reserved */
56 ACPI_GHES_NOTIFY_RESERVED
= 12
60 ACPI_HEST_SRC_ID_SEA
= 0,
61 /* future ids go here */
62 ACPI_HEST_SRC_ID_RESERVED
,
65 typedef struct AcpiGhesState
{
66 uint64_t ghes_addr_le
;
69 void build_ghes_error_table(GArray
*hardware_errors
, BIOSLinker
*linker
);
70 void acpi_build_hest(GArray
*table_data
, BIOSLinker
*linker
);
71 void acpi_ghes_add_fw_cfg(AcpiGhesState
*vms
, FWCfgState
*s
,
72 GArray
*hardware_errors
);
73 int acpi_ghes_record_errors(uint8_t notify
, uint64_t error_physical_addr
);