From nobody Sat Nov 23 15:18:20 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7B1A1DF250 for ; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; cv=none; b=NBvAGNPs1is4ciEm7xp6fBbgzmhY0etN6dU44zMp2bzSQlr8vWTDSqNYyHV95iIBLTQBaMdtv6m6B708lzd4Uq1sMAnyVhRctfGnmHLOkaEVSAbigrQ+5tqSy9KKM21k/wGuLSPHB7jc3/r2ppVPZdi0izeR7WqGouVT7zL7m40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; c=relaxed/simple; bh=zWs77Bv9LDN+nj6UdLSrqXLaTY2BokIUNOhx+BmRi3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DHw/NCu3lQsBywknDwjRNI86QkYJ3216eZyqcmzK4kSgU1EdFLBRICAEqJcsHIvRdLbS0Y++Q732kQmBPai0T73rXPRm7mih+/z9ijCNveKUNoXTSvXzMN7IYM0VhGI9mBFhDedq1LTtyLmrGZyAMeAukRthv4D+8cwz77zzsNc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RULDHQug; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RULDHQug" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15A95C4CED1; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732281264; bh=zWs77Bv9LDN+nj6UdLSrqXLaTY2BokIUNOhx+BmRi3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RULDHQugjhg1S651NaI61CtQEwH+bmUw18TRsb3q1niDZBeNzPHgUpUgOXhCX2VAO +r0X0I1Yjj3Z4JHyMbJT3O4BWuoSmBStAZULNzCI0GeXD4/eabbqLmcMo9w1xM4Ac/ mpRjde36Wx8XC4GDHP4KVgeI0SncEVDQ2KkGt7Qgb0DWtNcZf7VgiDCeknu/2oPu9p DSJWT6YI1KkWnBJJO+CeDPj1DK5bot/8dGwnoDmfY4CWo9gzPqwVo4lW3xctaCuSz0 so2Xgcc0+F8DPP89HkfB5H9/79g0LX33K4VTOJDXONrnul0O69EdGT1jctZ9ZAi9df Ojg68K+tO3cng== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tETUM-00000006v9i-06zm; Fri, 22 Nov 2024 14:14:22 +0100 From: Mauro Carvalho Chehab To: Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Igor Mammedov , Peter Maydell , Shannon Zhao , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 1/5] acpi/ghes: Prepare to support multiple sources on ghes Date: Fri, 22 Nov 2024 14:14:11 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" The current code is actually dependent on having just one error structure with a single source. As the number of sources should be arch-dependent, as it will depend on what kind of synchronous/assynchronous notifications will exist, change the logic to dynamically build the table. Yet, for a proper support, we need to get the number of sources by reading the number from the HEST table. However, bios currently doesn't store a pointer to it. For now just change the logic at table build time, while enforcing that it will behave like before with a single source ID. A future patch will add a HEST table bios pointer and change the logic at acpi_ghes_record_errors() to dynamically use the new size. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 43 ++++++++++++++++++++++++++-------------- hw/arm/virt-acpi-build.c | 5 +++++ include/hw/acpi/ghes.h | 21 +++++++++++++------- 3 files changed, 47 insertions(+), 22 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index b0b1865dc8d3..8c7d0d5cdb0c 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -206,17 +206,26 @@ ghes_gen_err_data_uncorrectable_recoverable(GArray *b= lock, * 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 *li= nker) +static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *li= nker, + int num_sources) { int i, error_status_block_offset; =20 + /* + * TODO: Current version supports only one source. + * A further patch will drop this check, after adding a proper migrati= on + * code, as, for the code to work, we need to store a bios pointer to = the + * HEST table. + */ + assert(num_sources =3D=3D 1); + /* Build error_block_address */ - for (i =3D 0; i < ACPI_GHES_ERROR_SOURCE_COUNT; i++) { + for (i =3D 0; i < num_sources; i++) { build_append_int_noprefix(hardware_errors, 0, sizeof(uint64_t)); } =20 /* Build read_ack_register */ - for (i =3D 0; i < ACPI_GHES_ERROR_SOURCE_COUNT; i++) { + for (i =3D 0; i < num_sources; i++) { /* * Initialize the value of read_ack_register to 1, so GHES can be * writable after (re)boot. @@ -231,13 +240,13 @@ static void build_ghes_error_table(GArray *hardware_e= rrors, BIOSLinker *linker) =20 /* Reserve space for Error Status Data Block */ acpi_data_push(hardware_errors, - ACPI_GHES_MAX_RAW_DATA_LENGTH * ACPI_GHES_ERROR_SOURCE_COUNT); + ACPI_GHES_MAX_RAW_DATA_LENGTH * num_sources); =20 /* Tell guest firmware to place hardware_errors blob into RAM */ bios_linker_loader_alloc(linker, ACPI_HW_ERROR_FW_CFG_FILE, hardware_errors, sizeof(uint64_t), false); =20 - for (i =3D 0; i < ACPI_GHES_ERROR_SOURCE_COUNT; i++) { + for (i =3D 0; i < num_sources; i++) { /* * Tell firmware to patch error_block_address entries to point to * corresponding "Generic Error Status Block" @@ -263,10 +272,12 @@ static void build_ghes_error_table(GArray *hardware_e= rrors, BIOSLinker *linker) /* Build Generic Hardware Error Source version 2 (GHESv2) */ static void build_ghes_v2(GArray *table_data, BIOSLinker *linker, - enum AcpiGhesNotifyType notify, - uint16_t source_id) + const AcpiNotificationSourceId *notif_src, + uint16_t index, int num_sources) { uint64_t address_offset; + const uint16_t notify =3D notif_src->notify; + const uint16_t source_id =3D notif_src->source_id; =20 /* * Type: @@ -297,7 +308,7 @@ static void build_ghes_v2(GArray *table_data, address_offset + GAS_ADDR_OFFSET, sizeof(uint64_t), ACPI_HW_ERROR_FW_CFG_FILE, - source_id * sizeof(uint64_t)); + index * sizeof(uint64_t)); =20 /* Notification Structure */ build_ghes_hw_error_notification(table_data, notify); @@ -317,8 +328,7 @@ static void build_ghes_v2(GArray *table_data, address_offset + GAS_ADDR_OFFSET, sizeof(uint64_t), ACPI_HW_ERROR_FW_CFG_FILE, - (ACPI_GHES_ERROR_SOURCE_COUNT + source_= id) - * sizeof(uint64_t)); + (num_sources + index) * sizeof(uint64_t= )); =20 /* * Read Ack Preserve field @@ -333,19 +343,23 @@ static void build_ghes_v2(GArray *table_data, /* Build Hardware Error Source Table */ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, BIOSLinker *linker, + const AcpiNotificationSourceId * const notif_source, + int num_sources, const char *oem_id, const char *oem_table_id) { AcpiTable table =3D { .sig =3D "HEST", .rev =3D 1, .oem_id =3D oem_id, .oem_table_id =3D oem_table_id= }; + int i; =20 - build_ghes_error_table(hardware_errors, linker); + build_ghes_error_table(hardware_errors, linker, num_sources); =20 acpi_table_begin(&table, table_data); =20 /* Error Source Count */ - build_append_int_noprefix(table_data, ACPI_GHES_ERROR_SOURCE_COUNT, 4); - build_ghes_v2(table_data, linker, - ACPI_GHES_NOTIFY_SEA, ACPI_HEST_SRC_ID_SEA); + build_append_int_noprefix(table_data, num_sources, 4); + for (i =3D 0; i < num_sources; i++) { + build_ghes_v2(table_data, linker, ¬if_source[i], i, num_sources= ); + } =20 acpi_table_end(linker, &table); } @@ -410,7 +424,6 @@ void ghes_record_cper_errors(const void *cper, size_t l= en, } ags =3D &acpi_ged_state->ghes_state; =20 - assert(ACPI_GHES_ERROR_SOURCE_COUNT =3D=3D 1); get_hw_error_offsets(le64_to_cpu(ags->hw_error_le), &cper_addr, &read_ack_register_addr); =20 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e059317b002e..bd5582bc75f8 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -889,6 +889,10 @@ static void acpi_align_size(GArray *blob, unsigned ali= gn) g_array_set_size(blob, ROUND_UP(acpi_data_len(blob), align)); } =20 +static const AcpiNotificationSourceId hest_ghes_notify[] =3D { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -944,6 +948,7 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTa= bles *tables) if (vms->ras) { acpi_add_table(table_offsets, tables_blob); acpi_build_hest(tables_blob, tables->hardware_errors, tables->link= er, + hest_ghes_notify, ARRAY_SIZE(hest_ghes_notify), vms->oem_id, vms->oem_table_id); } =20 diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 39619a2457cb..9f0120d0d596 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -57,20 +57,27 @@ enum AcpiGhesNotifyType { ACPI_GHES_NOTIFY_RESERVED =3D 12 }; =20 -enum { - ACPI_HEST_SRC_ID_SEA =3D 0, - /* future ids go here */ - - ACPI_GHES_ERROR_SOURCE_COUNT -}; - typedef struct AcpiGhesState { uint64_t hw_error_le; bool present; /* True if GHES is present at all on this board */ } AcpiGhesState; =20 +/* + * ID numbers used to fill HEST source ID field + */ +enum AcpiGhesSourceID { + ACPI_HEST_SRC_ID_SYNC, +}; + +typedef struct AcpiNotificationSourceId { + enum AcpiGhesSourceID source_id; + enum AcpiGhesNotifyType notify; +} AcpiNotificationSourceId; + void acpi_build_hest(GArray *table_data, GArray *hardware_errors, BIOSLinker *linker, + const AcpiNotificationSourceId * const notif_source, + int num_sources, const char *oem_id, const char *oem_table_id); void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s, GArray *hardware_errors); --=20 2.47.0 From nobody Sat Nov 23 15:18:20 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A9E21DEFC8 for ; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; cv=none; b=HMTBoBYtztNbZWZLP9Ln19nH670dCOQmolqECEsn7YjYmzyftUCcGx/XqXoCRFi7CkGzpv2ToWpBoNA3TgsmVWn4M/FPu018QsrXG4Y0eHwwbtGk2U1o6M++vpXSGiuI1tQCm+KOBzsX2dPZtvyQOw8NFAUjetRANVHHuusOaPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; c=relaxed/simple; bh=doZIE/N48jfI+gtG9UrfyFhDLPR7ZyHz+PuyPm64C0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rH43tQ2iVXCuZsfYbzPqLNQTGgvF36Ont1p9dIL6XZKW14DM6KA2o7JUaGMiHkaR/v/3g/Ew3qAumV0xHxiw9wGGvJM52nRe1aeSWmGFZzAid9rS6aqD5Xr8gNUgLU0G7J4Zhn3dZPeqQHeDVfLRvjw6rKZ19mm49IOTeL37et8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FzIRhSZ2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FzIRhSZ2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 131DEC4CECE; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732281264; bh=doZIE/N48jfI+gtG9UrfyFhDLPR7ZyHz+PuyPm64C0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzIRhSZ2GD29EOUyT1QbOegmc4UjN5oXmh+UOOL+z3qjMRkPyVwydl5ukf5c4LqtM jCwH7Y9NvUVrtMoSw9IafY+9lQYc2/xYwHAyuCOJxSFuGrmJojM7mLMvFKSob3xvZR K6PuN2rZodulcNDJHmmX+zKX84RC6HXjM4fCSC7UtSzzHkibkXkXdlNnm5ZV2FQpNM rhs7oLi3WC4bnuBxAySAA+t86ZPs7yWEzBA1dzAsw9J0dKyyWvzcZVRnCB2nW/uHW/ f67vKpq53Gy5zqt4AInthKSyZ7EaYbhi42wZfclUL4jbwpzz90De3yMVKjml9UXhoa lplbUKrIIYANg== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tETUM-00000006v9l-0Dol; Fri, 22 Nov 2024 14:14:22 +0100 From: Mauro Carvalho Chehab To: Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Igor Mammedov , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 2/5] acpi/ghes: add a firmware file with HEST address Date: Fri, 22 Nov 2024 14:14:12 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- Change from v8: - hest_addr_lr is now pointing to the error source size and data. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 17 ++++++++++++++++- include/hw/acpi/ghes.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 8c7d0d5cdb0c..680cada0e487 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -30,6 +30,7 @@ =20 #define ACPI_HW_ERROR_FW_CFG_FILE "etc/hardware_errors" #define ACPI_HW_ERROR_ADDR_FW_CFG_FILE "etc/hardware_errors_addr" +#define ACPI_HEST_ADDR_FW_CFG_FILE "etc/acpi_table_hest_addr" =20 /* The max size in bytes for one error block */ #define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB) @@ -261,7 +262,7 @@ static void build_ghes_error_table(GArray *hardware_err= ors, BIOSLinker *linker, } =20 /* - * tell firmware to write hardware_errors GPA into + * 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_FIL= E, 0, @@ -355,6 +356,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardwa= re_errors, =20 acpi_table_begin(&table, table_data); =20 + int hest_offset =3D table_data->len; + /* Error Source Count */ build_append_int_noprefix(table_data, num_sources, 4); for (i =3D 0; i < num_sources; i++) { @@ -362,6 +365,15 @@ void acpi_build_hest(GArray *table_data, GArray *hardw= are_errors, } =20 acpi_table_end(linker, &table); + + /* + * tell firmware to write into GPA the address of HEST via fw_cfg, + * once initialized. + */ + bios_linker_loader_write_pointer(linker, + ACPI_HEST_ADDR_FW_CFG_FILE, 0, + sizeof(uint64_t), + ACPI_BUILD_TABLE_FILE, hest_offset); } =20 void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, @@ -375,6 +387,9 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgStat= e *s, 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); =20 + 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); + ags->present =3D true; } =20 diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 9f0120d0d596..237721fec0a2 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -58,6 +58,7 @@ enum AcpiGhesNotifyType { }; =20 typedef struct AcpiGhesState { + uint64_t hest_addr_le; uint64_t hw_error_le; bool present; /* True if GHES is present at all on this board */ } AcpiGhesState; --=20 2.47.0 From nobody Sat Nov 23 15:18:20 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C0DC1DEFE0 for ; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; cv=none; b=QHDLL1yOXTMBBDcgHZpSXJtLQ+7iA79SZo/aPEMIMGXe1lQuLJo2MzTZ09e9hq+YDyQ/7AqcXSnVtrcR+Xt0UULdx2+D5FljSl/9X8nrAJw6DjUq3N7MZ6KsTvaRLWfkW58F6XcXmKpbn1NEEz20GfvpFPJ/bagBWWBTljsXNBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; c=relaxed/simple; bh=l5YIT7r9+eyuGodc37+aZZKgd5HU/rzw9Cubbh+qJT8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GBO8RouEDzRQ8pCtHHjKHih8SiZ6W3Hfp528j9zcjKMmU1x7nEM+mQ7BjVTyVAVMGDxeuQW4+BKqW2OvOrxdo48xM8J1Jki1TNg2GeH0kNmxmdw+5FmTxJSCBPt23HBFSDUbJKt5o5OuriTrmVd8R1giIO5RbnKaQgq8mzfg+ts= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dhv0IWR2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dhv0IWR2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E973C4CED0; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732281264; bh=l5YIT7r9+eyuGodc37+aZZKgd5HU/rzw9Cubbh+qJT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dhv0IWR2T6kR9BT/vfH6cXOsL6gTYlQXTthIEaigcIlT24qYQMcC1qTDSgFMFi2T0 TOZ27pbqSIxBY+6SkGvLRXbMvpPEiOqWPMA6eg8NEeHn0UbfCZ0iIY9Cgksr+RSi9v t/lG0dumQYUfNAfx1kLJaGKFAV+zXU9Yk3Egpvn/Vi4Ojic/VPyUz/beZE9EquZ2P1 acqV7TWPHGH2YN18tE9sOW08ep1MA6zH2Aj2LDgJ5sKO3t9LYq1Y1HNSUXcNL+dBdL Q1lqpQOdz+SUFLkrNK3y0VCU0yI5BxhgIKDlIA5wJQP3pjWdkhFKWkdHpnri5Hnojo 57Yrti2CaW2kA== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tETUM-00000006v9o-0Kkk; Fri, 22 Nov 2024 14:14:22 +0100 From: Mauro Carvalho Chehab To: Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Dongjiu Geng , Igor Mammedov , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 3/5] acpi/ghes: Use HEST table offsets when preparing GHES records Date: Fri, 22 Nov 2024 14:14:13 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" There are two pointers that are needed during error injection: 1. The start address of the CPER block to be stored; 2. The address of the ack, which needs a reset before next error. It is preferable to calculate them from the HEST table. This allows checking the source ID, the size of the table and the type of the HEST error block structures. Yet, keep the old code, as this is needed for migration purposes. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 98 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 680cada0e487..b5e3e2891445 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -61,6 +61,23 @@ */ #define ACPI_GHES_GESB_SIZE 20 =20 +/* + * Offsets with regards to the start of the HEST table stored at + * ags->hest_addr_le, according with the memory layout map at + * docs/specs/acpi_hest_ghes.rst. + */ + +/* ACPI 6.2: 18.3.2.8 Generic Hardware Error Source version 2 + * Table 18-382 Generic Hardware Error Source version 2 (GHESv2) Structure + */ +#define HEST_GHES_V2_TABLE_SIZE 92 +#define GHES_ACK_OFFSET (64 + GAS_ADDR_OFFSET) + +/* ACPI 6.2: 18.3.2.7: Generic Hardware Error Source + * Table 18-380: 'Error Status Address' field + */ +#define GHES_ERR_ST_ADDR_OFFSET (20 + GAS_ADDR_OFFSET) + /* * Values for error_severity field */ @@ -212,14 +229,6 @@ static void build_ghes_error_table(GArray *hardware_er= rors, BIOSLinker *linker, { int i, error_status_block_offset; =20 - /* - * TODO: Current version supports only one source. - * A further patch will drop this check, after adding a proper migrati= on - * code, as, for the code to work, we need to store a bios pointer to = the - * HEST table. - */ - assert(num_sources =3D=3D 1); - /* Build error_block_address */ for (i =3D 0; i < num_sources; i++) { build_append_int_noprefix(hardware_errors, 0, sizeof(uint64_t)); @@ -419,6 +428,70 @@ static void get_hw_error_offsets(uint64_t ghes_addr, *read_ack_register_addr =3D ghes_addr + sizeof(uint64_t); } =20 +static void get_ghes_source_offsets(uint16_t source_id, uint64_t hest_addr, + uint64_t *cper_addr, + uint64_t *read_ack_start_addr, + Error **errp) +{ + uint64_t hest_err_block_addr, hest_read_ack_addr; + uint64_t err_source_struct, error_block_addr; + uint32_t num_sources, i; + + if (!hest_addr) { + return; + } + + cpu_physical_memory_read(hest_addr, &num_sources, sizeof(num_sources)); + num_sources =3D le32_to_cpu(num_sources); + + err_source_struct =3D hest_addr + sizeof(num_sources); + + /* + * Currently, HEST Error source navigates only for GHESv2 tables + */ + + for (i =3D 0; i < num_sources; i++) { + uint64_t addr =3D err_source_struct; + uint16_t type, src_id; + + cpu_physical_memory_read(addr, &type, sizeof(type)); + type =3D le16_to_cpu(type); + + /* For now, we only know the size of GHESv2 table */ + if (type !=3D ACPI_GHES_SOURCE_GENERIC_ERROR_V2) { + error_setg(errp, "HEST: type %d not supported.", type); + return; + } + + /* Compare CPER source address at the GHESv2 structure */ + addr +=3D sizeof(type); + cpu_physical_memory_read(addr, &src_id, sizeof(src_id)); + + if (src_id =3D=3D source_id) { + break; + } + + err_source_struct +=3D HEST_GHES_V2_TABLE_SIZE; + } + if (i =3D=3D num_sources) { + error_setg(errp, "HEST: Source %d not found.", source_id); + return; + } + + /* Navigate though table address pointers */ + hest_err_block_addr =3D err_source_struct + GHES_ERR_ST_ADDR_OFFSET; + hest_read_ack_addr =3D err_source_struct + GHES_ACK_OFFSET; + + cpu_physical_memory_read(hest_err_block_addr, &error_block_addr, + sizeof(error_block_addr)); + + cpu_physical_memory_read(error_block_addr, cper_addr, + sizeof(*cper_addr)); + + cpu_physical_memory_read(hest_read_ack_addr, read_ack_start_addr, + sizeof(*read_ack_start_addr)); +} + void ghes_record_cper_errors(const void *cper, size_t len, uint16_t source_id, Error **errp) { @@ -439,8 +512,13 @@ void ghes_record_cper_errors(const void *cper, size_t = len, } ags =3D &acpi_ged_state->ghes_state; =20 - get_hw_error_offsets(le64_to_cpu(ags->hw_error_le), - &cper_addr, &read_ack_register_addr); + if (!ags->hest_addr_le) { + get_hw_error_offsets(le64_to_cpu(ags->hw_error_le), + &cper_addr, &read_ack_register_addr); + } else { + get_ghes_source_offsets(source_id, le64_to_cpu(ags->hest_addr_le), + &cper_addr, &read_ack_register_addr, errp); + } =20 cper_addr =3D le64_to_cpu(cper_addr); if (!cper_addr) { --=20 2.47.0 From nobody Sat Nov 23 15:18:20 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 882B81DE2DF for ; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; cv=none; b=aXsuZFtw9FbDo3WuHXxvZCjgLgPZH2Lt0DOytuiud+GBabYzF2n92hD4WxC8LPmzo7B2XGplc0tg07EdP+Iq3F9TpPAAWDdf6cit9Fh5Cc5Zh4jZKWKiAtIgagqhj2rs87ZWog1hGhzozkT5GyzYn9MEq1PcJ7MHQEtqFwSxbr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; c=relaxed/simple; bh=knD0TP3MMmZwwVXl9X/8uUAw8uoJGhkCzWhBHEKXJzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kv6aBVz2p/IBRXPJT6aWQRPB+R2GaEr5ioCdmF7DHwSTz1JiIynooe/xRvMCibXtpTXzVKSAWSpaNd2NOeGrkukapYnpZ7nhNyXpZWwMxbV0pOnxeEjxgGOwv6VpZrJBKb8SYMbLjkjhDbcq/ccssHWf9FWkTTb60uzjcZlUS/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JXmXQ1jq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JXmXQ1jq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A77C4CED3; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732281264; bh=knD0TP3MMmZwwVXl9X/8uUAw8uoJGhkCzWhBHEKXJzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXmXQ1jqNFtcWhfXXxUQ4miScwPVF9LXnSKIOjjKm9YvfM7eQcWpEZPGhqQhH4nk6 EtyYax4oYDZOC2LlgMOBx5ekXIoMjhO8/Ox/nfcGzZL1q9OZ4nKABKUduJxFCupVcu ROgdMAJcJ27A1xxPse0Sam2Wd6TXZNfaeqzU1hmWUX0dkrT2cEe3tJimL2/Pluc4m2 4qldJRY9MtfZ5rKpKSpyX/fzcImaZFgrw8aaSYB+31/GIGcWzJvTaS60/vTGxbcgEI k6w1n28etemef+T1uofsUdIanA/Jqm075F6Lg8Zf4z4yORmFL+8JJWVTzHmh9zCwJT 9pqtIFEk6CayQ== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tETUM-00000006v9r-0RNX; Fri, 22 Nov 2024 14:14:22 +0100 From: Mauro Carvalho Chehab To: Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , Ani Sinha , Igor Mammedov , linux-kernel@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH v2 4/5] acpi/generic_event_device: Update GHES migration to cover hest addr Date: Fri, 22 Nov 2024 14:14:14 +0100 Message-ID: <9aa962a596769f5fa35c8af84b5a522cb12947f2.1732281080.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 17baf36132a8..c1116dd8d7ae 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -387,6 +387,34 @@ static const VMStateDescription vmstate_ghes_state =3D= { } }; =20 +static const VMStateDescription vmstate_hest =3D { + .name =3D "acpi-hest", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT64(hest_addr_le, AcpiGhesState), + VMSTATE_END_OF_LIST() + }, +}; + +static bool hest_needed(void *opaque) +{ + AcpiGedState *s =3D opaque; + return s->ghes_state.hest_addr_le; +} + +static const VMStateDescription vmstate_hest_state =3D { + .name =3D "acpi-ged/hest", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D hest_needed, + .fields =3D (const VMStateField[]) { + VMSTATE_STRUCT(ghes_state, AcpiGedState, 1, + vmstate_hest, AcpiGhesState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_acpi_ged =3D { .name =3D "acpi-ged", .version_id =3D 1, @@ -399,6 +427,7 @@ static const VMStateDescription vmstate_acpi_ged =3D { &vmstate_memhp_state, &vmstate_cpuhp_state, &vmstate_ghes_state, + &vmstate_hest_state, NULL } }; --=20 2.47.0 From nobody Sat Nov 23 15:18:20 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE1231DF255 for ; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; cv=none; b=n/jSQ3TriSXyfgeXiGFBcsM9bCLrgEEBuuAs3NljkNKsHktv3b4sza5tGQrPgcE+HYcey8hVAh+we1tvWHJ3qTd76hbOj1PrxVOkIAI01UELasBxu1/K+yqJIgwcIEJ1886qnPUC5CtKIkuu6szQGsM8yyxZR5Z8HZ+zsezqm80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732281264; c=relaxed/simple; bh=Pf05cBXdyni1wyrDC8/6pBUg2HAAj3lp4+Zp/z88sBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ikXA64GtfkQ4QDD4C8wKn20NLI9hIVmoV6AJEblq2hZvQ/voCuL2f8aJYIIxLpsszwI/00PTJmL7yDKw82SnQy8GYDZB9d8T/YxPQjp4alNzNo334U5n0shRu1rTYs/nVQ2y+mrsyZN3oTI5RqIExmHhFxaub0MT+i1AGJuJn4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cr/4ZjCb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cr/4ZjCb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F350C4CEDC; Fri, 22 Nov 2024 13:14:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732281264; bh=Pf05cBXdyni1wyrDC8/6pBUg2HAAj3lp4+Zp/z88sBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cr/4ZjCbqBS2n1dp81M6Uu40MNgHHF2BUf9CYbc167TFcohCNX2ZMn7jjGxg4CshJ gD7V0JuhEfEIl3OrV5NwgAiTG291OKRSx4/3Duuo+js9hG3hmNwzxKjm0kdyi70QAQ eSNcfPXgrjj5Ek+A8q4391zlOeRXnrUfOyteCWKD5D/4y8tlIpJXrS0oOUroCqwHJa /xrdO/e0HqP+1Ne1by61SC/USjdfEPWTJP0YQNAvEi2qi6bFgoNfPnaFCF6nRNXYUU rvJd0gigxen8kGkhgf3MnqtBqaxvILeYznmR3C+gt/8eB9XcSS9jFa1GNN7C6rjhY9 GUqdaAl72X9mw== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tETUM-00000006v9u-0YTL; Fri, 22 Nov 2024 14:14:22 +0100 From: Mauro Carvalho Chehab To: Cc: Jonathan Cameron , Shiju Jose , Mauro Carvalho Chehab , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Dongjiu Geng , Eduardo Habkost , Igor Mammedov , Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Yanan Wang , Zhao Liu , linux-kernel@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 5/5] acpi/generic_event_device: add logic to detect if HEST addr is available Date: Fri, 22 Nov 2024 14:14:15 +0100 Message-ID: <7505ad000ed66099bf443fd7769c83bd7d5d4136.1732281080.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 9.2 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 1 + hw/acpi/ghes.c | 28 +++++++++++++++++++++------- hw/arm/virt-acpi-build.c | 30 ++++++++++++++++++++++++++---- hw/core/machine.c | 2 ++ include/hw/acpi/ghes.h | 1 + 5 files changed, 51 insertions(+), 11 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index c1116dd8d7ae..df6b4fab2d30 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -318,6 +318,7 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, Acp= iEventStatusBits ev) =20 static Property acpi_ged_properties[] =3D { DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0), + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, ghes_state.hest_look= up, true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index b5e3e2891445..a10f7e266a6a 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -359,6 +359,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardwa= re_errors, { AcpiTable table =3D { .sig =3D "HEST", .rev =3D 1, .oem_id =3D oem_id, .oem_table_id =3D oem_table_id= }; + AcpiGedState *acpi_ged_state; + AcpiGhesState *ags =3D NULL; int i; =20 build_ghes_error_table(hardware_errors, linker, num_sources); @@ -379,10 +381,20 @@ void acpi_build_hest(GArray *table_data, GArray *hard= ware_errors, * tell firmware to write into GPA the address of HEST via fw_cfg, * once initialized. */ - bios_linker_loader_write_pointer(linker, - ACPI_HEST_ADDR_FW_CFG_FILE, 0, - sizeof(uint64_t), - ACPI_BUILD_TABLE_FILE, hest_offset); + + acpi_ged_state =3D ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED, + NULL)); + if (!acpi_ged_state) { + return; + } + + ags =3D &acpi_ged_state->ghes_state; + if (ags->hest_lookup) { + bios_linker_loader_write_pointer(linker, + ACPI_HEST_ADDR_FW_CFG_FILE, 0, + sizeof(uint64_t), + ACPI_BUILD_TABLE_FILE, hest_offse= t); + } } =20 void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, @@ -396,8 +408,10 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgSta= te *s, 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); =20 - 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); + if (ags && ags->hest_lookup) { + 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); + } =20 ags->present =3D true; } @@ -512,7 +526,7 @@ void ghes_record_cper_errors(const void *cper, size_t l= en, } ags =3D &acpi_ged_state->ghes_state; =20 - if (!ags->hest_addr_le) { + if (!ags->hest_lookup) { get_hw_error_offsets(le64_to_cpu(ags->hw_error_le), &cper_addr, &read_ack_register_addr); } else { diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index bd5582bc75f8..46ce3f3bb07a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -893,6 +893,10 @@ static const AcpiNotificationSourceId hest_ghes_notify= [] =3D { { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, }; =20 +static const AcpiNotificationSourceId hest_ghes_notify_9_1[] =3D { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -946,10 +950,28 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuild= Tables *tables) build_dbg2(tables_blob, tables->linker, vms); =20 if (vms->ras) { - acpi_add_table(table_offsets, tables_blob); - acpi_build_hest(tables_blob, tables->hardware_errors, tables->link= er, - hest_ghes_notify, ARRAY_SIZE(hest_ghes_notify), - vms->oem_id, vms->oem_table_id); + AcpiGhesState *ags; + AcpiGedState *acpi_ged_state; + + acpi_ged_state =3D ACPI_GED(object_resolve_path_type("", TYPE_ACPI= _GED, + NULL)); + if (acpi_ged_state) { + ags =3D &acpi_ged_state->ghes_state; + + acpi_add_table(table_offsets, tables_blob); + + if (!ags->hest_lookup) { + acpi_build_hest(tables_blob, tables->hardware_errors, + tables->linker, hest_ghes_notify_9_1, + ARRAY_SIZE(hest_ghes_notify_9_1), + vms->oem_id, vms->oem_table_id); + } else { + acpi_build_hest(tables_blob, tables->hardware_errors, + tables->linker, hest_ghes_notify, + ARRAY_SIZE(hest_ghes_notify), + vms->oem_id, vms->oem_table_id); + } + } } =20 if (ms->numa_state->num_nodes > 0) { diff --git a/hw/core/machine.c b/hw/core/machine.c index a35c4a8faecb..00521a1963ba 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -34,10 +34,12 @@ #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" +#include "hw/acpi/generic_event_device.h" #include "audio/audio.h" =20 GlobalProperty hw_compat_9_1[] =3D { { TYPE_PCI_DEVICE, "x-pcie-ext-tag", "false" }, + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, }; const size_t hw_compat_9_1_len =3D G_N_ELEMENTS(hw_compat_9_1); =20 diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h index 237721fec0a2..164ed8b0f9a3 100644 --- a/include/hw/acpi/ghes.h +++ b/include/hw/acpi/ghes.h @@ -61,6 +61,7 @@ typedef struct AcpiGhesState { uint64_t hest_addr_le; uint64_t hw_error_le; bool present; /* True if GHES is present at all on this board */ + bool hest_lookup; /* True if HEST address is present */ } AcpiGhesState; =20 /* --=20 2.47.0