From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127658; cv=none; d=zohomail.com; s=zohoarc; b=aA8hXdEqfZO5UUhdNQTFO/SizNwFLFgsHRbaHHmwiK0ke530N68bxwfVAKyxF3OJ/vohC4thyDWtcxkPC6Cfj7c/COZ9iT/Mi6Yech+dg1P5x7oUh+1p3CrRtP4Zh3ZaTJRWG/Pt68tKvtXtr9h2EFdSFQzoPqVzYFpZh1EdPoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127658; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I2XLjCfdJI80b8H8+Sz+cjBAZ3Uf9N57rJCQ1mkeRFY=; b=PlTw8FyxeODip/UUu+IYzJHTu39IKLDZpl2zCbiBMwPtCeOFw6a3CEeTNKnmiN/zTCq7kuhRapzLnsxdPZUm2sHL28HqviibZuoRIzeBX30r/Kk8A6/EnTP340vGHf65sy49LYZe4cxbv5u8zppdihlXmjGWlm+VTeDbrw8kHhE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127658442834.8955387541992; Sun, 8 Nov 2026 00:47:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWo-0007aF-Ij; Sun, 08 Nov 2026 03:45:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWm-0007Yb-Pv; Sun, 08 Nov 2026 03:45:29 -0500 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000Ha-Dv; Sun, 08 Nov 2026 03:45:28 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A960D4467C; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87F681F008A5; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TML-2HQ4; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=I2XLjCfdJI80b8H8+Sz+cjBAZ3Uf9N57rJCQ1mkeRFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bkEwYqRneVmNYXtB3rLc60BWxDoJpumJvbX1cIq5XWXl5bpwvdgfCTg5oByUl6Me7 bzOrgq84BkGZd1lHb/FfD+Hww7epXpMXni6XIJWiEQNO8HGvxtMwcQvSBWodUMNHei HRhDFX0LG4JLigYBvlevzKJEYHaZ6X/0vq5rcKwVgvKhNMOjaGSxfGAUmO3UUoYcF0 DmA2x6ZzewLF1Ju358uKSaItUrRIKGistOSk0Rggw0BLFYc1NpMsiqTDAMsb7NnUNT SciaW+TF2gm4r+yHPPyM6kD6Mvdm+M4lVfEToSmkxtnYIKfa05kuX4awxe7GhJ8pV/ CWuahAN8qwbaA== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH v2 1/8] acpi_dev_interface: add ghes support state at AcpiDeviceIfClass Date: Sun, 8 Nov 2026 09:45:02 +0100 Message-ID: X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127660270158500 Currently, ghes.c assumes that GHES support can be checked by looking at GED. This is valid only for aarch64. As we're now adding support for other architectures, this needs to be done on a different way. For instance, on x86, it needs to detect if GHES is supported inside ICH9 and PIIX4 PM. Add an ancillary method at acpi_dev_interface to share information if ghes is supported on an arch-independent way. It should be noticed that, with this change, there's no need to include anymore hw/acpi/generic_event_device.h, as this were the aarch64-specific GED interface sits and the code is now generic. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/acpi_interface.c | 7 +++++++ hw/acpi/generic_event_device.c | 6 ++++++ hw/acpi/ghes.c | 30 +++++++++++++++++----------- include/hw/acpi/acpi_dev_interface.h | 6 ++++++ 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c index a44679017ead..bf11acfbb54b 100644 --- a/hw/acpi/acpi_interface.c +++ b/hw/acpi/acpi_interface.c @@ -3,6 +3,13 @@ #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" =20 +AcpiGhesState *acpi_device_get_ghes_state(AcpiDeviceIf *adev) +{ + AcpiDeviceIfClass *klass =3D ACPI_DEVICE_IF_GET_CLASS(adev); + + return klass->get_ghes_state ? klass->get_ghes_state(adev) : NULL; +} + static void register_types(void) { static const TypeInfo acpi_dev_if_info =3D { diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 65a5d1612fa4..c0913d458ff5 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -324,6 +324,11 @@ static void acpi_ged_ospm_status(AcpiDeviceIf *adev, A= CPIOSTInfoList ***list) acpi_cpu_ospm_status(&s->cpuhp_state, list); } =20 +static AcpiGhesState *acpi_ged_get_ghes_state(AcpiDeviceIf *adev) +{ + return &ACPI_GED(adev)->ghes_state; +} + static void acpi_ged_send_event(AcpiDeviceIf *adev, AcpiEventStatusBits ev) { AcpiGedState *s =3D ACPI_GED(adev); @@ -610,6 +615,7 @@ static void acpi_ged_class_init(ObjectClass *class, con= st void *data) =20 adevc->ospm_status =3D acpi_ged_ospm_status; adevc->send_event =3D acpi_ged_send_event; + adevc->get_ghes_state =3D acpi_ged_get_ghes_state; =20 object_class_property_add_uint16_ptr(class, ACPI_PCIHP_IO_BASE_PROP, offsetof(AcpiGedState, diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index b2d5e3499320..3989fd4d7e91 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -24,7 +24,7 @@ #include "hw/acpi/ghes.h" #include "hw/acpi/aml-build.h" #include "qemu/error-report.h" -#include "hw/acpi/generic_event_device.h" +#include "hw/acpi/acpi_dev_interface.h" #include "hw/nvram/fw_cfg.h" #include "qemu/uuid.h" #include "exec/cpu-common.h" @@ -587,21 +587,27 @@ bool acpi_ghes_memory_errors(AcpiGhesState *ags, uint= 16_t source_id, source_id, errp); } =20 -AcpiGhesState *acpi_ghes_get_state(void) +static int acpi_ghes_find_state(Object *obj, void *opaque) { - AcpiGedState *acpi_ged_state; + Object *adev =3D object_dynamic_cast(obj, TYPE_ACPI_DEVICE_IF); AcpiGhesState *ags; =20 - acpi_ged_state =3D ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED, - NULL)); - - if (!acpi_ged_state) { - return NULL; + if (!adev) { + return 0; } - ags =3D &acpi_ged_state->ghes_state; - - if (!ags->hw_error_le && !ags->hest_addr_le) { - return NULL; + ags =3D acpi_device_get_ghes_state(ACPI_DEVICE_IF(adev)); + if (!ags || (!ags->hw_error_le && !ags->hest_addr_le)) { + return 0; } + *(AcpiGhesState **)opaque =3D ags; + return 1; +} + +AcpiGhesState *acpi_ghes_get_state(void) +{ + AcpiGhesState *ags =3D NULL; + + object_child_foreach_recursive(object_get_root(), acpi_ghes_find_state, + &ags); return ags; } diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index 65debb90a8d4..644e0006ff6a 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -26,6 +26,7 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF, TYPE_ACPI_DEVICE_IF) =20 typedef struct AcpiDeviceIf AcpiDeviceIf; +typedef struct AcpiGhesState AcpiGhesState; =20 /** * AcpiDeviceIfClass: @@ -33,6 +34,7 @@ typedef struct AcpiDeviceIf AcpiDeviceIf; * ospm_status: returns status of ACPI device objects, reported * via _OST method if device supports it. * send_event: inject a specified event into guest + * get_ghes_state: returns the controller's GHES state, if supported * madt_cpu: fills @entry with Interrupt Controller Structure * for CPU indexed by @uid in @apic_ids array, * returned structure types are: @@ -50,5 +52,9 @@ struct AcpiDeviceIfClass { /* */ void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); + + AcpiGhesState *(*get_ghes_state)(AcpiDeviceIf *adev); }; + +AcpiGhesState *acpi_device_get_ghes_state(AcpiDeviceIf *adev); #endif --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127582; cv=none; d=zohomail.com; s=zohoarc; b=CfN6ndXK5HVg/N2GqTsRE/P2oAiLaj+58e3xBEYUOQoWgkM9kiMwgUVMr1h4bcKRp8LIGpTjW3zPNLJv2sM7FI6mxzHWt2lBdZhFHWaMztTzqxA68G6EMzd3SoZGp20vzNOkq9GJo6ZFVWbq6em1vI4y/MXs3MqrdY23AOT1xvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127582; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/CSl8lAcUCmig49S7F/exLJyC2folrj9gXTelPXpoAg=; b=BX8aE0yeD0PG+O5H8DymGwl9o/mMl0efcwaSGtUQyTCVnXTt9rdP/jh0oloFimzCO0H+UMP/1zPul6c35KdOR/TfmZIxWCgrIwpTyhFZsc5+dDY63mI8rKPu7UkxOoehVKmEHOnYeeEqGkNPS6SAEC9MjcM/3mYkkD6zKDUs5TY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127582090529.5572662234368; Sun, 8 Nov 2026 00:46:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWr-0007bs-3x; Sun, 08 Nov 2026 03:45:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWm-0007YT-De; Sun, 08 Nov 2026 03:45:28 -0500 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000HX-Dv; Sun, 08 Nov 2026 03:45:28 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9F99343335; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 816AB1F008A2; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMP-2OCc; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=/CSl8lAcUCmig49S7F/exLJyC2folrj9gXTelPXpoAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E/Sre320ala3SG+5ghsxVgo07C0h4hsouEMMu5Pgc/8f8oZtwAdhexNNAyA5DMvss Nfr+KuhOPpl69p7lshjmwbWJMF48WMUj3e1pksl4xkZFp/uDYUg4lzD8bopJDHy0pB 2zzKpdXPYAC3dllPw/xsx8taXag2Ua08BKv9h8jAp1jwHzg9ORqHiGsZZi4cqa1Hzm 7GaNA42ng0F3IE125dsBA8dVDItRdrJ7ZPWG8Q0Al4aC6ucWvh91rvaQpZCOXXFL03 bGL5dLZNXQIkw87fz2E4QPtft/qeY8oo6mgDUz1lSK+5r05v2yNK9q21IQ+Ku04Ye6 FkjiSra4Zbh8Q== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH v2 2/8] tests/acpi: virt: reserve expected tables for PC GHES SCI support Date: Sun, 8 Nov 2026 09:45:03 +0100 Message-ID: X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127583305158500 Prepare to modify x86 firmware files, disabling DSDT and HEST table check until we update it to new firmware file changes. Notice that we're adding a SPDX header at the new files just to shut up checkpatch. This will be dropped when we add the BIOS binaries there. Signed-off-by: Mauro Carvalho Chehab --- tests/data/acpi/x86/pc/DSDT.ras | 1 + tests/data/acpi/x86/pc/HEST.ras | 1 + tests/data/acpi/x86/q35/DSDT.ras | 1 + tests/data/acpi/x86/q35/HEST.ras | 1 + tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 5 files changed, 8 insertions(+) create mode 100644 tests/data/acpi/x86/pc/DSDT.ras create mode 100644 tests/data/acpi/x86/pc/HEST.ras create mode 100644 tests/data/acpi/x86/q35/DSDT.ras create mode 100644 tests/data/acpi/x86/q35/HEST.ras diff --git a/tests/data/acpi/x86/pc/DSDT.ras b/tests/data/acpi/x86/pc/DSDT.= ras new file mode 100644 index 000000000000..73fa78ef14ea --- /dev/null +++ b/tests/data/acpi/x86/pc/DSDT.ras @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ diff --git a/tests/data/acpi/x86/pc/HEST.ras b/tests/data/acpi/x86/pc/HEST.= ras new file mode 100644 index 000000000000..73fa78ef14ea --- /dev/null +++ b/tests/data/acpi/x86/pc/HEST.ras @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ diff --git a/tests/data/acpi/x86/q35/DSDT.ras b/tests/data/acpi/x86/q35/DSD= T.ras new file mode 100644 index 000000000000..73fa78ef14ea --- /dev/null +++ b/tests/data/acpi/x86/q35/DSDT.ras @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ diff --git a/tests/data/acpi/x86/q35/HEST.ras b/tests/data/acpi/x86/q35/HES= T.ras new file mode 100644 index 000000000000..73fa78ef14ea --- /dev/null +++ b/tests/data/acpi/x86/q35/HEST.ras @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8bf4..b3761468accc 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,5 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT.ras", +"tests/data/acpi/x86/pc/HEST.ras", +"tests/data/acpi/x86/q35/DSDT.ras", +"tests/data/acpi/x86/q35/HEST.ras", --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127585; cv=none; d=zohomail.com; s=zohoarc; b=HKQwYaFggDXL/bbYiU+YhzBZm8P1wczTOYlZsCbJnw9YTl7GA0fLXo4oBuwslNywbSaFm9Wrri8uByVWyQ2dfEIZxVowO4rjX5NQ+EmNJWmZG2NQ/6fNM66G7XwxIYL9NBpFm/3aJPFshnXCl+BkQaksNIN9VsWe0iapfzPIVVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=epOF4OJpnItDTMQe4XsS/qKrRz2EeKyDCsW0kSFF+kQ=; b=jAtgoFmH8i/yKjsnMeaMmtyB2QHczq9OHaXs0NNn2e1D5OoMkUOvZc/ARYbIQYkJglk5hrDJ4mopXWUprDU7gle5CGz/wv+bVNrOJz/dRE2yqWlPp+sZJyf3V52q/93adGMYPaoHuYno+RZzx8r4BziMfW0ciKcBh3oecmwFSVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127585748541.8318996643334; Sun, 8 Nov 2026 00:46:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWw-0007eE-1v; Sun, 08 Nov 2026 03:45:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWp-0007aj-Kl; Sun, 08 Nov 2026 03:45:31 -0500 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWn-0000J4-D9; Sun, 08 Nov 2026 03:45:31 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C0BEB4496E; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B8F11F0089F; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMT-2Uni; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=epOF4OJpnItDTMQe4XsS/qKrRz2EeKyDCsW0kSFF+kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Rd2Y+mqvDWdkdpkqh6OHvP0xcANDSm6J6tF/ydw60GPR8llCabl+b7hHx5QHij24Z N7FNtn7eluePu1wNMkyUgnnVa9hyOdLzvLSckLKUxH5F8ziAUtU4ugpsbIKHQFJ3CD T4e5dacpcT+L8LIcy3Ika7A/gJ08fx2V0q3q51yPMh+uNox324T5GrOk87SEnv900p 8fswvWLefrLRSbBTFjiWL1UXmMxV6tzmBBPXVXD7cQiuqPTrAD5jRepin3RGBAIRww e23W/fMlThEeHB3kd84uiqmhypLbiTmSpG5Pa6yGI8j6xl3yISvdzxYL/n3x14vKtq gDdtak08VWqSQ== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Paolo Bonzini Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha , Richard Henderson Subject: [PATCH v2 3/8] hw/i186: add support for HEST table with SCI Date: Sun, 8 Nov 2026 09:45:04 +0100 Message-ID: X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127587342158500 The _OSC device configuration object evaluates some platform software specific support. Among them, there are bits there to indicate if APEI support is enabled. Those are sitting at the UUID 0811B06E-4A27-44F9-8D60-3CBBC22E7B48. Bit 4 is APEI support. it has to be enabled to let x86 use APEI/HEST/GHES. Signed-off-by: Mauro Carvalho Chehab --- hw/i386/Kconfig | 1 + hw/i386/acpi-build.c | 102 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc.c | 41 +++++++++++++++++ include/hw/i386/pc.h | 5 +++ 4 files changed, 149 insertions(+) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index e27d8816e5bb..b1fbfaf33f9b 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -47,6 +47,7 @@ config PC select MC146818RTC # For ACPI builder: select SERIAL_ISA + select ACPI_APEI select ACPI_PCI select ACPI_VMGENID select ACPI_VMCLOCK diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 985515434974..6f960c66e2a4 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -71,6 +71,7 @@ #include "hw/acpi/utils.h" #include "hw/acpi/pci.h" #include "hw/acpi/cxl.h" +#include "hw/acpi/ghes.h" =20 #include "qom/qom-qobject.h" #include "hw/i386/amd_iommu.h" @@ -852,6 +853,56 @@ static void build_acpi0017(Aml *table) aml_append(table, scope); } =20 +/* ACPI 5.0, 6.2.10.2: Platform-Wide OSPM Capabilities. */ +#define ACPI_PLAT_OSPM_CAP "0811B06E-4A27-44F9-8D60-3CBBC22E7B48" + +/* ACPI 5.0: Table 6-151: Platform-Wide _OSC caps DWORD 2 */ +#define ACPI_OSC_CAP_APEI (1U << 4) + +static Aml *build_apei_osc(uint32_t mask, uint32_t bits) +{ + Aml *method =3D aml_method("_OSC", 4, AML_SERIALIZED); + uint8_t failure[8] =3D { 2 }; /* _OSC failure */ + uint32_t disabled =3D mask & ~bits; + Aml *support =3D aml_name("CDW2"); + Aml *status =3D aml_name("CDW1"); + Aml *if_ctx; + + if_ctx =3D aml_if(aml_lless(aml_sizeof(aml_arg(3)), aml_int(8))); + aml_append(if_ctx, aml_return(aml_buffer(sizeof(failure), failure))); + aml_append(method, if_ctx); + aml_append(method, aml_create_dword_field(aml_arg(3), aml_int(0), "CDW= 1")); + aml_append(method, aml_create_dword_field(aml_arg(3), aml_int(4), "CDW= 2")); + + /* Arg0: UUID */ + if_ctx =3D aml_if(aml_lnot(aml_equal(aml_arg(0), + aml_touuid(ACPI_PLAT_OSPM_CAP)))); + aml_append(if_ctx, aml_or(status, aml_int(4), status)); + aml_append(if_ctx, aml_return(aml_arg(3))); + aml_append(method, if_ctx); + + /* Arg1: Revision ID: 1 */ + if_ctx =3D aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(1)))); + aml_append(if_ctx, aml_or(status, aml_int(8), status)); + aml_append(if_ctx, aml_return(aml_arg(3))); + aml_append(method, if_ctx); + + /* Arg2: count of entries in Arg3: 2 dwords */ + if_ctx =3D aml_if(aml_lnot(aml_equal(aml_arg(2), aml_int(2)))); + aml_append(if_ctx, aml_or(status, aml_int(2), status)); + aml_append(if_ctx, aml_return(aml_arg(3))); + aml_append(method, if_ctx); + + /* Arg3: Second DWORD: caps - update according with mask */ + aml_append(method, aml_and(support, aml_int(~disabled), aml_local(0))); + if_ctx =3D aml_if(aml_lnot(aml_equal(support, aml_local(0)))); + aml_append(if_ctx, aml_or(status, aml_int(mask), status)); + aml_append(method, if_ctx); + aml_append(method, aml_store(aml_local(0), support)); + aml_append(method, aml_return(aml_arg(3))); + return method; +} + static void build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, @@ -1284,6 +1335,21 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dsdt, scope); } =20 + if (pcms->ras) { + sb_scope =3D aml_scope("_SB"); + aml_append(sb_scope, build_apei_osc(ACPI_OSC_CAP_APEI, + ACPI_OSC_CAP_APEI)); + aml_append(sb_scope, aml_error_device()); + aml_append(dsdt, sb_scope); + + scope =3D aml_scope("_GPE"); + method =3D aml_method("_E07", 0, AML_NOTSERIALIZED); + aml_append(method, aml_notify(aml_name("\\_SB." ACPI_APEI_ERROR_DE= VICE), + aml_int(0x80))); + aml_append(scope, method); + aml_append(dsdt, scope); + } + /* copy AML table into ACPI tables blob and patch header there */ g_array_append_vals(table_data, dsdt->buf->data, dsdt->buf->len); acpi_table_end(linker, &table); @@ -2043,6 +2109,10 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) return true; } =20 +static const AcpiNotificationSourceId hest_ghes_notify[] =3D { + {ACPI_HEST_SRC_ID_QMP, ACPI_GHES_NOTIFY_SCI}, +}; + static void acpi_build(AcpiBuildTables *tables, MachineState *machine) { @@ -2199,6 +2269,16 @@ void acpi_build(AcpiBuildTables *tables, MachineStat= e *machine) cxl_build_cedt(table_offsets, tables_blob, tables->linker, x86ms->oem_id, x86ms->oem_table_id, &pcms->cxl_devi= ces_state); } + if (pcms->ras) { + AcpiGhesState *ags =3D + acpi_device_get_ghes_state(ACPI_DEVICE_IF(x86ms->acpi_dev)); + + acpi_add_table(table_offsets, tables_blob); + acpi_build_hest(ags, tables_blob, tables->hardware_errors, + tables->linker, hest_ghes_notify, + ARRAY_SIZE(hest_ghes_notify), + x86ms->oem_id, x86ms->oem_table_id); + } =20 acpi_add_table(table_offsets, tables_blob); build_waet(tables_blob, tables->linker, x86ms->oem_id, x86ms->oem_tabl= e_id); @@ -2315,6 +2395,21 @@ void acpi_setup(void) static FwCfgTPMConfig tpm_config; #endif =20 + if (pcms->ras) { + AcpiGhesState *ags =3D NULL; + + if (x86ms->acpi_dev) { + ags =3D acpi_device_get_ghes_state(ACPI_DEVICE_IF(x86ms->acpi_= dev)); + } + if (!x86ms->fw_cfg || !pcms->acpi_build_enabled || + !x86_machine_is_acpi_enabled(x86ms) || !ags) { + error_report("ras=3Don requires ACPI table generation and a PC= " + "ACPI controller"); + exit(EXIT_FAILURE); + } + ags->use_hest_addr =3D true; + } + if (!x86ms->fw_cfg) { ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); return; @@ -2361,6 +2456,13 @@ void acpi_setup(void) } #endif =20 + if (pcms->ras) { + AcpiGhesState *ags =3D + acpi_device_get_ghes_state(ACPI_DEVICE_IF(x86ms->acpi_dev)); + + acpi_ghes_add_fw_cfg(ags, x86ms->fw_cfg, tables.hardware_errors); + } + vmgenid_dev =3D find_vmgenid_dev(); if (vmgenid_dev) { vmgenid_add_fw_cfg(VMGENID(vmgenid_dev), x86ms->fw_cfg, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4737eb471c14..28af7f507dab 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -51,6 +51,7 @@ #include "qemu/error-report.h" #include "hw/acpi/acpi.h" #include "hw/acpi/pc-hotplug.h" +#include "hw/acpi/ghes.h" #include "acpi-build.h" #include "hw/mem/nvdimm.h" #include "hw/cxl/cxl_host.h" @@ -1608,6 +1609,34 @@ static void pc_machine_set_max_fw_size(Object *obj, = Visitor *v, pcms->max_fw_size =3D value; } =20 +static bool pc_machine_get_ras(Object *obj, Error **errp) +{ + PCMachineState *pcms =3D PC_MACHINE(obj); + + return pcms->ras; +} + +static void pc_machine_set_ras(Object *obj, bool value, Error **errp) +{ + PCMachineState *pcms =3D PC_MACHINE(obj); + + pcms->ras =3D value; +} + +static void pc_sci_error(Notifier *n, void *opaque) +{ + PCMachineState *pcms =3D container_of(n, PCMachineState, ghes_sci_noti= fier); + X86MachineState *x86ms =3D X86_MACHINE(pcms); + uint16_t *source_id =3D opaque; + + /* Currently, only QMP injection is supported */ + if (!pcms->ras || !x86ms->acpi_dev || + *source_id !=3D ACPI_HEST_SRC_ID_QMP) { + return; + } + + acpi_send_event(DEVICE(x86ms->acpi_dev), ACPI_GENERIC_ERROR); +} =20 static void pc_machine_initfn(Object *obj) { @@ -1642,12 +1671,18 @@ static void pc_machine_initfn(Object *obj) if (pcmc->pci_enabled) { cxl_machine_init(obj, &pcms->cxl_devices_state); } + + pcms->ghes_sci_notifier.notify =3D pc_sci_error; + notifier_list_add(&acpi_generic_error_notifiers, + &pcms->ghes_sci_notifier); } =20 static void pc_machine_finalize(Object *obj) { PCMachineState *pcms =3D PC_MACHINE(obj); =20 + notifier_remove(&pcms->ghes_sci_notifier); + if (pcms->pcspk && !qdev_is_realized(DEVICE(pcms->pcspk))) { object_unref(OBJECT(pcms->pcspk)); } @@ -1773,6 +1808,12 @@ static void pc_machine_class_init(ObjectClass *oc, c= onst void *data) object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP, "SMBIOS Entry Point type [32, 64]"); =20 + object_class_property_add_bool(oc, "ras", pc_machine_get_ras, + pc_machine_set_ras); + object_class_property_set_description(oc, "ras", + "Set on/off to enable/disable re= porting host memory errors " + "to a KVM guest using ACPI and g= uest external abort exceptions"); + object_class_property_add_bool(oc, "fd-bootchk", pc_machine_get_fd_bootchk, pc_machine_set_fd_bootchk); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 844ae835784f..533612194f32 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -30,6 +30,9 @@ typedef struct PCMachineState { /* State for other subsystems/APIs: */ Notifier machine_done; =20 + /* Triggered when a new SCI GHES error raises */ + Notifier ghes_sci_notifier; + /* Pointers to devices and objects: */ PCIBus *pcibus; I2CBus *smbus; @@ -57,6 +60,8 @@ typedef struct PCMachineState { bool i8042_enabled; bool default_bus_bypass_iommu; bool fd_bootchk; + bool ras; + uint64_t max_fw_size; =20 /* ACPI Memory hotplug IO base address */ --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127593; cv=none; d=zohomail.com; s=zohoarc; b=Fbm2p+Xy5kvZzX7eNdwT3Mv/5IUjD5fAGRrOlfS3R701a2pSRTpzoDTSv4uo3bdEXG30KoO/4tHUFNsicnOUQiHdTe2VLGv2e7JbqVLPYQWH5GoH6x79fqk5YK13sI/6uXuwVBxnO04xjieClgrfsW45TmOp5HC3xNa6LWzgNzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127593; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dtj/JRYxHWgoRtzy0x5ktxY1NkPyMJTom3ccS1vcjsA=; b=IJTbJTDa7QqAwlESAjTARfYxmDXSRByYv3GWHqvn7uPKRTQ5MCMaGgQ7f/FrdIfwaKf+Wkf0lNvzHl2WEHzFT5SrBzJ65nCgx8YopTIQWYIHa7SrTU0J12A2+4vTSbiTPUnjqtlZdag47nl+M3uoVur7NQtyO5GkZdgl2RU7bG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127593704941.8376448610185; Sun, 8 Nov 2026 00:46:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWr-0007br-1z; Sun, 08 Nov 2026 03:45:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWm-0007YY-Of; Sun, 08 Nov 2026 03:45:29 -0500 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000HZ-DZ; Sun, 08 Nov 2026 03:45:28 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B710E448DB; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DEAB1F008AB; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMX-2bfH; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=dtj/JRYxHWgoRtzy0x5ktxY1NkPyMJTom3ccS1vcjsA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iPj6395RmOlKm9HvPCW+J4JuYZtVTUt1oJSBplNAAKS5WHP5bQazVOpIACBpz7SlN XdEjYA6WfSe+VPKc/8hinxVbJRQUFbNn2Z6KKxstXmrha+337DmoomecysecmB8xYB x9rGdPo7SaRvyRyWnnJGbs4+Akx+4wnfLt5Xnoe0p+gOhYlqRCKC9pddNjrTnpOGST qrKpsS5BKY/O4PVMQnSTh0cLku2OC4Ti2OmgJJbyZzx8VKCI+u1k+V2aHinypspOa+ 0EXaDxeAuVOYEYtX6DDbjAn8nL2CRiSAw2k++JsiuvpOpiayvFPOSs/0g6RvUs02xX kYmEDPWAXLViA== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Aurelien Jarno Subject: [PATCH v2 4/8] hw/i386: add GHES support at ICH9 and PIIX4 PM Date: Sun, 8 Nov 2026 09:45:05 +0100 Message-ID: X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127595597158500 Enabling GHES support on x86 means that both PIIX4 and ICH9 PM controllers need to expose ghes state. Implement that, as suggested by Igor. Suggested-by: Igor Mammedov Link: https://lore.kernel.org/qemu-devel/20250530164134.6c666b2e@imammedo.u= sers.ipa.redhat.com/ Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ich9.c | 19 +++++++++++++++++++ hw/acpi/piix4.c | 25 +++++++++++++++++++++++++ hw/isa/lpc_ich9.c | 6 ++++++ include/hw/acpi/ich9.h | 2 ++ include/hw/acpi/piix4.h | 2 ++ 5 files changed, 54 insertions(+) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 91a22a8e9480..39303e681406 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -223,6 +223,24 @@ static const VMStateDescription vmstate_pcihp_state = =3D { } }; =20 +static bool ich9_hest_needed(void *opaque) +{ + ICH9LPCPMRegs *pm =3D opaque; + + return pm->ghes_state.hest_addr_le !=3D 0; +} + +static const VMStateDescription vmstate_ich9_hest =3D { + .name =3D "ich9_pm/hest", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D ich9_hest_needed, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT64(ghes_state.hest_addr_le, ICH9LPCPMRegs), + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_ich9_pm =3D { .name =3D "ich9_pm", .version_id =3D 1, @@ -245,6 +263,7 @@ const VMStateDescription vmstate_ich9_pm =3D { &vmstate_tco_io_state, &vmstate_cpuhp_state, &vmstate_pcihp_state, + &vmstate_ich9_hest, NULL } }; diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index a7d5356340be..854a1008deff 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -224,6 +224,24 @@ static bool vmstate_test_migrate_acpi_index(void *opaq= ue, int version_id) !s->not_migrate_acpi_index; } =20 +static bool piix4_hest_needed(void *opaque) +{ + PIIX4PMState *s =3D opaque; + + return s->ghes_state.hest_addr_le !=3D 0; +} + +static const VMStateDescription vmstate_piix4_hest =3D { + .name =3D "piix4_pm/hest", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D piix4_hest_needed, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT64(ghes_state.hest_addr_le, PIIX4PMState), + VMSTATE_END_OF_LIST() + } +}; + /* qemu-kvm 1.2 uses version 3 but advertised as 2 * To support incoming qemu-kvm 1.2 migration, change version_id * and minimum_version_id to 2 below (which breaks migration from @@ -259,6 +277,7 @@ static const VMStateDescription vmstate_acpi =3D { .subsections =3D (const VMStateDescription * const []) { &vmstate_memhp_state, &vmstate_cpuhp_state, + &vmstate_piix4_hest, NULL } }; @@ -561,6 +580,11 @@ static void piix4_ospm_status(AcpiDeviceIf *adev, ACPI= OSTInfoList ***list) acpi_cpu_ospm_status(&s->cpuhp_state, list); } =20 +static AcpiGhesState *piix4_get_ghes_state(AcpiDeviceIf *adev) +{ + return &PIIX4_PM(adev)->ghes_state; +} + static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) { PIIX4PMState *s =3D PIIX4_PM(adev); @@ -617,6 +641,7 @@ static void piix4_pm_class_init(ObjectClass *klass, con= st void *data) hc->is_hotpluggable_bus =3D piix4_is_hotpluggable_bus; adevc->ospm_status =3D piix4_ospm_status; adevc->send_event =3D piix4_send_gpe; + adevc->get_ghes_state =3D piix4_get_ghes_state; =20 object_class_property_add_uint16_ptr(klass, ACPI_PCIHP_IO_BASE_PROP, offsetof(PIIX4PMState, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index b55b5136a385..f321c2d6e95f 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -833,6 +833,11 @@ static const Property ich9_lpc_properties[] =3D { pm.periodic_timer_enabled, true), }; =20 +static AcpiGhesState *ich9_get_ghes_state(AcpiDeviceIf *adev) +{ + return &ICH9_LPC_DEVICE(adev)->pm.ghes_state; +} + static void ich9_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) { ICH9LPCState *s =3D ICH9_LPC_DEVICE(adev); @@ -900,6 +905,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, con= st void *data) hc->is_hotpluggable_bus =3D ich9_pm_is_hotpluggable_bus; adevc->ospm_status =3D ich9_pm_ospm_status; adevc->send_event =3D ich9_send_gpe; + adevc->get_ghes_state =3D ich9_get_ghes_state; amldevc->build_dev_aml =3D build_ich9_isa_aml; =20 object_class_property_add_uint8_ptr(klass, ACPI_PM_PROP_SCI_INT, diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 6956b2b9c9a2..67db16d93523 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -27,6 +27,7 @@ #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/ich9_tco.h" +#include "hw/acpi/ghes.h" #include "hw/acpi/cpu.h" =20 #define ACPI_PCIHP_ADDR_ICH9 0x0cc0 @@ -38,6 +39,7 @@ typedef struct ICH9LPCPMRegs { * PM1a_CNT_BLK =3D 2 in FADT so it is defined as uint16_t. */ ACPIREGS acpi_regs; + AcpiGhesState ghes_state; =20 MemoryRegion io; MemoryRegion io_gpe; diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 863382a814ad..8732574e9c03 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -29,6 +29,7 @@ #include "hw/i2c/pm_smbus.h" #include "hw/isa/apm.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/ghes.h" =20 #define TYPE_PIIX4_PM "PIIX4_PM" OBJECT_DECLARE_SIMPLE_TYPE(PIIX4PMState, PIIX4_PM) @@ -43,6 +44,7 @@ struct PIIX4PMState { =20 MemoryRegion io_gpe; ACPIREGS ar; + AcpiGhesState ghes_state; =20 APMState apm; =20 --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127606; cv=none; d=zohomail.com; s=zohoarc; b=k15WRlu6nXVt6++jEQ7jBtX2TNtxYB85GqaQ9rTZJI0Ut+DR8xeo7DsWKOXIqIuxlvTUV9duq1mI3YJgv0NmIR1BO3qVvanmRtFEQ9j3GW8zyOIL86ectEtb8wnMhYawY3Ci8XqrI6qOmdmQmqVDrpuQY+RVO2JpC41j4ABgEbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127606; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qW0yBfIBM5vflRr1bcwMCfehJwJOqDHYanv88ox3284=; b=OJQ5aEjsT1hjSIlopB8vNzHu66ubtkDsS9GWCLLiT6rC7ZebHkaBPl46F0HGgNr3Rw0BX19fQLc3pqy5VjF940OHKpgPur0f33e1qSXK7CoPv0NUucD283lGwFvJv0keAywrAAs7ySoy9XbCcUP0aNgLoS71VfzNbGXiLe/3lMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127606758393.007073935245; Sun, 8 Nov 2026 00:46:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWw-0007eF-He; Sun, 08 Nov 2026 03:45:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWp-0007b2-UW; Sun, 08 Nov 2026 03:45:32 -0500 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWn-0000J5-Cg; Sun, 08 Nov 2026 03:45:31 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C601F44B8A; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F5451F008A1; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMb-2iQp; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=qW0yBfIBM5vflRr1bcwMCfehJwJOqDHYanv88ox3284=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OKDXDGNrBMYTIlVJbEPR2fj34RzdDCFhuCAiqhNcLYEwVHItpQG8DaF2UeDLKhrSa 2uPVusD1G2vLa8+d2E10s5Vl/isZqKUm448/XVoLho/ARVJ7eMOCTeGMcotWoocGYC beMVQ29G7CPuLS7Hu56bw3ZUk+QnpKRM73WJdPr+8gEdSDAEPjqE/XYL7TVDxX6cqN q4MDj2GEpF/1QYZNd4Kzflu2AYHhglStG2peXUy8bAwJIvNpyxv2PLlrkTwhBOciB3 05fOca+qFvhzmut1Mln7kxcifTEjijkNyYgYXm/UJqRG/hBSKjSrj3hhUqhVq8dbSr SRJlQH5t/2bPQ== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH v2 5/8] tests/acpi: virt: add x86 DSDT and HEST tables Date: Sun, 8 Nov 2026 09:45:06 +0100 Message-ID: <60fbb807386e24ede8fb88cdb18505314c15842d.1794124132.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127607515158500 The following DSDT changes affect both: -"tests/data/acpi/x86/pc/DSDT.ras", -"tests/data/acpi/x86/q35/DSDT.ras", --- /tmp/DSDT_old.dsl +++ /tmp/DSDT.dsl @@ + Method (_OSC, 4, Serialized) // _OSC: Operating System Capabi= lities + { + If ((SizeOf (Arg3) < 0x08)) + { + Return (Buffer (0x08) { 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }) + } + + CreateDWordField (Arg3, Zero, CDW1) + CreateDWordField (Arg3, 0x04, CDW2) + If ((Arg0 !=3D ToUUID ("0811b06e-4a27-44f9-8d60-3cbbc22e7b= 48"))) + { + CDW1 |=3D 0x04 + Return (Arg3) + } + If ((Arg1 !=3D One)) + { + CDW1 |=3D 0x08 + Return (Arg3) + } + If ((Arg2 !=3D 0x02)) + { + CDW1 |=3D 0x02 + Return (Arg3) + } + + Local0 =3D (CDW2 & 0xFFFFFFFF) + If ((CDW2 !=3D Local0)) + { + CDW1 |=3D 0x10 + } + CDW2 =3D Local0 + Return (Arg3) + } + + Device (GEDD) + { + Name (_HID, "PNP0C33" /* Error Device */) + Name (_UID, Zero) + } + } + + Scope (_GPE) + { + Method (_E07, 0, NotSerialized) + { + Notify (\_SB.GEDD, 0x80) // Status Change + } + } The x86 HEST table now contains a GHESv2 source: --- /tmp/HEST_old.dsl +++ /tmp/HEST.dsl @@ +[024h 0036 4] Error Source Count : 00000001 + +[028h 0040 2] Subtable Type : 000A [Generic Hardware = Error Source V2] +[02Ah 0042 2] Source Id : 0001 +[02Ch 0044 2] Related Source Id : FFFF +[02Eh 0046 1] Reserved : 00 +[02Fh 0047 1] Enabled : 01 +[030h 0048 4] Records To Preallocate : 00000001 +[034h 0052 4] Max Sections Per Record : 00000001 +[038h 0056 4] Max Raw Data Length : 00000400 + +[03Ch 0060 12] Error Status Address : [Generic Address Struct= ure] +[03Ch 0060 1] Space ID : 00 [SystemMemory] +[03Dh 0061 1] Bit Width : 40 +[03Fh 0063 1] Encoded Access Width : 04 [QWord Access:64] + +[048h 0072 28] Notify : [Hardware Error Notific= ation Structure] Signed-off-by: Mauro Carvalho Chehab --- tests/data/acpi/x86/pc/DSDT.ras | Bin 48 -> 8818 bytes tests/data/acpi/x86/pc/HEST.ras | Bin 48 -> 132 bytes tests/data/acpi/x86/q35/DSDT.ras | Bin 48 -> 8647 bytes tests/data/acpi/x86/q35/HEST.ras | Bin 48 -> 132 bytes tests/qtest/bios-tables-test-allowed-diff.h | 4 ---- 5 files changed, 4 deletions(-) diff --git a/tests/data/acpi/x86/pc/DSDT.ras b/tests/data/acpi/x86/pc/DSDT.= ras index 73fa78ef14ea5ec208df4358dd64d3b7f4b25880..ee99b20fd6e9d95ad2690e20573= cd8bd5ca0d90f 100644 GIT binary patch literal 8818 zcmb7~-*4O2701t&D4V*ZEJ~t(JF$>9=3D=3DuYxWG7C74Ok?SmSsyaBg#n!1|V%Gn4JVG z(Z)d2Aeig`t{Y&$5--IbhCwLQ*JSS-uwi@JTmFRZVSU(Rhqc*DH5`&MeH9ZJ^`P+F zbI$ji&%G3X+*mc#)<Uf1oS*d_GSA0FUussmk2|v#pjZ77=3D0`F?R*` zSS?q|y!@V8UaOGbZrNYh_Px(+vhKjfm(sJ1b?4E6y#W}sv*A#R2h#GeWt1&*uRN?P z)dFuVRaLR{lE!&!t*U~&lF(G6p6V1 zM1bd%H+Lm86kVyV<#na1=3DFPUDEn7t3pHt4<70^)11#LNRw#$urlL(TRhK5pZtkv^+ zRsA4ul5$O10r{-1Xv;D44YYbaXA2{o`(ztX!+Z;eyCAty}m`h7x&gK6qqbmwp&(aFYQ zxD-!3yZqb%nr%Q?nyjxn5LEaw=3D@InHp7Go0fr=3DQztb!EjD6oD(eP1j{+e za85FulPu>X%Q?kxPBENQEaw!d9%#XqBLgP3X<51vz7>RRbR4F>SjeX-jDu7@;&>d)zXb26?>Yb>U!n z9QUi22da|@)r-ff7v1W`f$GJO>P2&}j_k@nbsCFMe(qTLIk)`WK>4|l@^gN9b+CLq zLizb)<>%e<^8@AQL(0#ad#fBiMGcncyz>21DCsSE(pz#W$V2X8%YwJUc$&yV?&?Z) z-g|`C_$6Iy^>vB=3D2yeER^i~~2fR{fAz?r)e+PQ05L(S_=3D)ym5YZVd-VYzK$dKeef3 zcf=3D=3D$HXPbQuh)gn$dki$_|3Wq|M*X$3tgJ#v5`!Mj_hNr@bU-X@T8YytDtis9 zqSscyE19CSLf{3wAmV*6+j`S|ad<&RbN5GRlpwF@T7xLnhC!5O{TflU!5{N5G zUFFT)EJnr^L#yQ>uc)O~-rT!#>4y74qUdX0Up_#wfR(-XqJ*4LT8lr6b?D(1>??&r zVOw4rQjAt9X})peeeO6L_KfcvgTsbabMQUtaL|EWJ2Y*ZZ@uQJt#oaf{sdwJw#q>TI7doeqr+j$-KT!9lgu zI32c9)6Pwc_qFQ34f3RBF1s(dlBH3cx0z~ z82Inc#sNG(-e7z9R^onQ;CkE}H~{dy-k*Q)Jb(G_@w-8e_rb7UulLJ-xc_P6zxTo1 zQ@Dz*d3!1;y`dLMg$3{~b2xtN`o`ldQQ_G2?dum`zaSinEOYvj-t;c0tcb2uPq
T88U zVeW(~QbJ1L6Z2|ls#dh=3D=3D#zvl33o;UZ-uas4*f3u6nJ#7E3G(krz#0DD(sgRp+ z69_pIbC=3D}J`s&(IRyxOI@icJ;B%JdSzo;rln_8Q74k{^lQ_?xX}dklE35URoCI-CH8v+hM=3DIo1{8b$IHzb%q z*0ar)ax^1?kLqeW-~i#z0Ku@dQMl}{8^LwMfwDgkcL&}vivBu_2qE*9QBIOng4*e8?9ciYh)7Djsw`?28Xa z6(0^0KOc0?`{I05aXwT$=3Dsf9*C!>ld!^AHHol{?&Mir-_;z8$vFD^tC7sA9Bg3d)> zT#PC%hKdKBr+o2LRPj`p_{E^}5np^Hs`yB#c+h#;7f(kOPlt(L3Obj3aVe^}6e=3DEc zp7F&qQN=3DT1;+KQYv%YvXs(3b3Jm@^=3DfcEGLFckBE=3DLuYL&by6M}6_psN$nx z;^m<8F<*Qvs`yx_c+mN{FFqbsd^}8C2|Azf#V4YQPlSpGolpAWlTpPd!^G8~^C@3^ zDysNYsCdx%v@bp#ReU;3Tnjp%@x^DNiqC|K2c4ht#ZN^QKNTjv7<7Kx7e5_U{B)>z z(D|${J{whh_5^WxXgDuL#K0cIgyM_e&_z>wCc{KW-E3l6bX`ZKz26|Et zwge!sk556q6+`RD$H6{6XZSv>b>YZ|#TJfySZ(3RhvhCF`LNza^ratcxo=3DUhkN2a# z9dqr#&!K%e@bj)6_$9PUfj{rsf&U8H<-p%|?ZEF6D}mo-R*w0RT0Q1RZuOWS$+csC zWY>=3DQk$&-*ANdzAS=3D-XP!E35Kt1FEbIDr4VkIRXFK0y2fmByu?;?{zE+0qI{z@3w$ zZAkCW0*(!!5N>TS5z-YA-)iMX(pohXv6FlD*&WJvaXSNF*zoiC4k+sN;^RA%Q`GBo zowNQQO8nvv8UC&1|Ej;TfAYt_o_nzL5To3fV)srb`}A;|ctboox_3Icr-!#`%o~e& zV-HZ#{UZSz-DufffP?{#jU(MV=3DH6sQQ@yQiceg;9pZDG!L7H?YAZKZXi?Hua9LCc2 F{{Ue1iFp73 literal 48 zcmdPbQV0%kiO}`QOis-!PSy2HNzE(COv_9yvQlsl@X>nzT6h&K77*S3-Fo0+~*_@R0|c@Z9VO>Lxb(G?UvgL?6ku!y$(aOOEvr+$@u+b8K`}r z$;bD7-}iYW-`D1&?&zJreuohHpn6%WJEiIywpJ>YN|X=3D+`|w+_64!~lr&rA`&BPMa z-OuoSy=3Dqn^^#^)&-K4+U_CEH!cR%##hEFy>RUU0_`1cRIO#+p6HhsomM_DU&ood(Z zSvgy?%2Ky(>2l=3D>lccT|?8T+-x}_7fG1a~7Xo&}Rh^Aj#8MKo9?R=3D3bZu6fPzFuB> z{o`xzRv!Q4A3uL^hb1)q+W7}}n55~~F8HwV?t1KuH&8z6-=3Dg7Y!3 zGrk8UpU6QGG_^9kqpl?l-DzeA7yGw~pN~`G4HiBMI`HJRzyI5L_5J3Tmk4B>}!hL0zD6N@uFnBOI=3D4J ztj65u;Ak}Rx1ol=3DOK%Zq!+jBoheUm;V(D*8ss(NNu<^pWo~kpOkEfnG(SVW-A58cF z-amMglFh-wNB8=3Dhq`xVTMxznAw?Q}VZR}DubvVF-*ZAm<3H?GW1{d++q1xYsE8=3DI# zfk(;ElWa??5moNmmPY+;I8u67DU7(HeZ}uqyWO!1Ywzq8GKtJ+L>jF%g9Q7u(ORpK zf(+#>)@ZGn(Lub?TC0;nHX)Bjlz^u8>X~daEoN3IN#+(dsGQ`O+C&Qc> z#F;^y8O)i%oHF8+5vPnfWz3mHoLR(~#hh8pIgL1{5$81KoW`6v#F;~!In0^EoC@Mp z5T}AU70j7OoO#5V$DDc0SwNfx#96?c1T=3DA6fzr?|2b&YGvVvKmfyrvjyR zcnI^Y9@bqz$_1ocz{-WdGg2-h}o@%F{@B8Y@p@`iIt)&bgamf z63|4^MhU2*{!zj}7o{R443rUCj4PvPi*aRC6#_J<%99uZRB(xNWz>T>SBe1|ROLzt z(4a>=3D?h{-Y^&r8O(cnUW3Y~`l6*!ZKGl@7MKm|?+P=3DParI8%rd0#x9H02Mf=3D5a$%) zga8#dAwUIA32{n@69QD=3Dga8#d(}**TI3Yj-0#x9H z02MeD#Hk=3Do2vC6&0#xA4BhEbHga8#dAwUJr0^%$nP6$we69QD=3DEF#V#;)DPdI3Yj< zP8D&gh!X--;Di7bIA;*&4B~_U6*wV41xAY_xV4oL->dElN9`_s733F)1ia(UADJPhAcf~8TA$Giq=3Dj` zcDr59PqWOgQY6h^F6@#AP{xvWyKVV*w^@$B-Vh4iUSq1!TB}6wX5?J(Mn>w|Z6`m=3D ziocpB>3EV5!U!Q5LdY&rb6uxXAw%eb-M&&$^IhF?$UWF+d%PqEuQ;HF*5=3D1^U8n8P z2isvEz#hs&_v)BCJ%M{waIbRr>X>`=3D8275%YXW=3Dlc1Es5>@0Qydrh#{xV<)JuN`Br zh4%UwJiHV8)?=3D>=3D_ByxM$L#fE?Df#z7`IQHz}^t-4Q_9Y*&D~$8=3D-w|+&*~%`N``R(~wb0%iw@;nG-W2RjZf}m+o5$Fjp?!Vae(D7Fb-}*Q?dxOq^<(VoZm*dz z9c%olXG&lnO&$t=3D+=3DJJZxJ*s)M_x_w=3DQ?a|{4r*E++2P_b3xg}=3D8im<1>9U=3DLUTdc z#O97XXGPpxaYA!J*~I3KJU1$CPMy$PP&To-BhSGMZf<5mb3xg}=3D8oLgv$(n03C#s% z6Pr77pU&at<|Z^3l;P%-rW7m)7*gFfI?>%v!({+>uWommL?-0PHyM&}_Z2uUUNu^J z$!_c2l6sLRj}IlD4@DdAdra{L^25GI`d(%<8j`{E!~O>O?S@SL_21->3|TI?gY#_q zgEYKgfAS4UK#nPD*R+G{n5}5GRW6q=3D62+(nU0h3Fe>on#fw$X+6ZID6h;>WPYW8}m z{?@zxn>)WKy?yhYw|3s%y7>-qsb)9U!iOfym`T5szm%!GOWZxX4R7(kl$q@Ae-{oa zq@>wKi)vQOp<26nm1@Rn88$Ua;+odfC3n97HRGCNG)knT>6K2&?Y(~KI$s^o?De2u zA;3x*oP)KMq?*?{wV%ZXtiMe@(8}fVEw!G~oK7X}K6m})gvbVchL`{2#g5VNVL7Bf zegb;!vz+I?c;rlDZRn}ZB#@lUh>ka9td=3DLXuUZS5qqU@CFeI&ITr0#zl4h(n3bBz- zwtRZy)5|mc8`LK^eCokk1G)KWEAyMaM;~obpLqV(xI1SbFVvd)VD8a)sb1-9ea7!Q zHtOGGBcI;*%%49cM>S@jrZ#ke`RY!AI~$ga5<`T0WFUqtPG2 zQ@=3D-N9*;&}d=3Ds2`{L=3D?75fZf)`~V#+uSwx?^aIDc#O-Mb(>8*&TfTx>DPJVP1PJBA z%qPM4u}m=3D8@|mxcDy66bjjSf@y4~h8=3DvX7RW=3D)tykGAz#ek{}ZU7~#NI-I@GEu<2Z z64-yGTaXeg#$x>FRX76>%8w2&gWEe-yQT#po4sN**URPd`3WvcQc1#Gt<)B;!~CeU z7We{eFXNQUU8!5q+r;gC-zi@T4rI7HRH^H%=3Dw!%u&PO{JV8`vPsZQ;%@-n1=3D)xHvA z9+MRk6qDg19F+3hP;*l4iPB~r56R}9#%!N!D5U2=3DP`tX1`Hluhw? zFmhq!&9fPkdc-4?n)C*_K`1>N<5%_h=3DH>Ngs$3DNB$hl2OVDobe8cXnL~SR6%T7^U zg=3DJ0pUi`hdB%R&kEnmp$pRKtQeStg1M52c#w8s!zDye`8fR9k8Iwm=3D>fAANX-Nke$5 zW8qC6es2(cRxo%WT=3DxIv=3DXvSH)&J?g_I~`QKcBl>N8bw!3S(ay4DZ0V2De!(s1^%8 zE4T|ED)5DCFZ>kY{E<%)&JXXny;G*42Y;LfUkF^d5DYX?PH~!I*C@Y6J_v4RsLS^L E4{5|Mc>n+a literal 48 zcmdPbQV0%kiO}`QOis-!PSy2HNzE(COv_9yvQlsl@X (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127636064303.52026806377035; Sun, 8 Nov 2026 00:47:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWn-0007Zg-P5; Sun, 08 Nov 2026 03:45:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWl-0007Y4-0X; Sun, 08 Nov 2026 03:45:27 -0500 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000HU-Cc; Sun, 08 Nov 2026 03:45:26 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CDAEB612F8; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85C651F008A4; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMf-2ovO; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=pKRyi/P8OXU4hT2prHBcACIMzgezdIbO+h5QJsXXbDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BkArkYCMZfwSckb55IDsFd454rLz/obmEjUAondI9pwNIZZXokQA8uDksjIE3nT/z AxXZ+M1hquu9yfDv0NR1WpDbOubDBkixIbvuX0yjxKdnCsoK9UNKbeSNmYQcbpZNx2 SGrrf/GeYFySreSnOu2+n/E7SP00GA1u06IUdyR75IYJu23S5pswBGVTzKi/5qFrKB sFXzeukaap7cLxA5t0DMTITjOHHm2zxP0Ey9UhH4Ulg7kjjw7YOZI87Tv/ksB7Yox+ Nv2jHSDnOB/STezmm/Hd7RphdRlDS/EATnYsnJISYZGpNJiqyB6Fra4hdSsPTZfVLh g4U7NHUyS/l0g== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Pierrick Bouvier Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH v2 6/8] docs: acpi_hest_ghes: document notification mechanisms Date: Sun, 8 Nov 2026 09:45:07 +0100 Message-ID: <5474e7a37809445a46c862c61f96005204cd0ccb.1794124132.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=mchehab+huawei@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127637983158500 Currently, the HEST spec mixes generic support with arch dependent notification mechanisms. Move the arm-specific notifications to a separate chapter and add a new one describing x86 mechanisms. Signed-off-by: Mauro Carvalho Chehab --- docs/specs/acpi_hest_ghes.rst | 44 ++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/docs/specs/acpi_hest_ghes.rst b/docs/specs/acpi_hest_ghes.rst index aaf7b1ad11a5..1a32550ef3a1 100644 --- a/docs/specs/acpi_hest_ghes.rst +++ b/docs/specs/acpi_hest_ghes.rst @@ -7,6 +7,7 @@ APEI tables generating and CPER record This work is licensed under the terms of the GNU GPL, version 2 or late= r. See the COPYING file in the top-level directory. =20 + Design Details -------------- =20 @@ -105,14 +106,39 @@ Design Details firmware will write back the start address of either "etc/hardware_err= ors" or HEST table at the corresponding fw_cfg file. =20 -(9) When QEMU gets a SIGBUS from the kernel, QEMU writes CPER into corresp= onding - "Error Status Data Block", guest memory, and then injects platform spe= cific - interrupt (in case of arm/virt machine it's Synchronous External Abort= ) as a - notification which is necessary for notifying the guest. +.. note:: =20 -(10) This notification (in virtual hardware) will be handled by the guest - kernel, on receiving notification, guest APEI driver could read the C= PER error - and take appropriate action. + GHES support requires ACPI and ``-machine ras=3Don``. =20 -(11) kvm_arch_on_sigbus_vcpu() reports RAS errors via a SEA notifications, - when a SIGBUS event is triggered. +Notifications on ARM64 +---------------------- + +The ARM64 ``virt`` machine supports two GHESv2 notification sources: + +* source 0: Synchronous External Abort (SEA); +* source 1: GPIO notification delivered through a Generic Event Device (GE= D). + +Source 0 reports hardware-memory RAS events on the ``virt`` machine: + +* When QEMU receives a ``SIGBUS`` from the kernel, it writes the CPER into= the + corresponding ``Error Status Data Block`` in guest memory and reports the + event through a Synchronous External Abort (SEA). The guest kernel handle + the SEA, + +* The guest APEI driver can read and process the CPER record. + +* ``kvm_arch_on_sigbus_vcpu()`` reports these RAS events through SEA. + +When source 1 is available, QEMU supports GHES error injection through the= QMP +interface. + + +Notifications on x86 +-------------------- + +The ``pc`` and ``q35`` machines support one GHESv2 source: + +* source 1: System Control Interrupt (SCI). + +When source 1 is available, QEMU supports GHES error injection through +the QMP interface. --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127561; cv=none; d=zohomail.com; s=zohoarc; b=fTW533Wh5EqPRYIwaTmbq4gBluJNiasrNaCb9P6xd0MxP50z/Si1odbBYZf5qHLH/LV74m/5ce8/OXlGVIc5v/ujaPFrzPXVjO+IrK4Lncx6iFGObUx81fCf0UFQ2Uto0+15CcyuJS/LmGa8kvLi7d5a6escneaZVLHlPCZIEDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cx5yHHuthwfUu3/rYB27eiSMCgsydhDX7rZRc2IOJgU=; b=O4I/QlCWF6KipnRYIh2utD4ywPl2t+KqwNViCQEUBjrJEzQp6+eyeWtLiofbZpXmDSF7yIPA2H6SGHWOdHvl4OG/NQD1pQm2YDw4DHVdxSZp6UmwYk9JzgZXizi9TcdMg6ZaNuemi3c1zGyTJFq3zs1BrQAHsLKVKEcVaRihWZE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127561591677.6020750359891; Sun, 8 Nov 2026 00:46:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWn-0007Zk-Sm; Sun, 08 Nov 2026 03:45:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWl-0007Y8-66; Sun, 08 Nov 2026 03:45:27 -0500 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000HT-DC; Sun, 08 Nov 2026 03:45:26 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CC7E460D45; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B331F008A3; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMj-2vT0; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=cx5yHHuthwfUu3/rYB27eiSMCgsydhDX7rZRc2IOJgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VxW9hKaQalc7TrdGz08TzuM1+CBS7tBX6FjuWrtoxC5HMeOAzJ5a3WJau6BJvUreU eHh6xbpG9RHZLGG/l4rLtfgukD1NMxnfVHQdhA+k2Cs39juSFHRB2GhT76tD+IKtA5 MuuBQNGwy8Sj9F9oWhrZJoHViPV1kSE6/+77KZ6cGak/tTBsDjmmZvEmh+CMW+RWw+ c1l611aUmbp+LNdEGt418iwXTPZZKGo8+2xIelnqZ09VBYm4wUoff5LK8Ak1JaMQql DYF9BqIpsX2JqnKhJ2bzL/pXe7VaWMxgud+khS2Cia65jEHcm/7AryjmcBhVlv+9wn FSRcvbS0LTEZw== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH v2 7/8] tests: add GHES tests on arm64 virt machine Date: Sun, 8 Nov 2026 09:45:08 +0100 Message-ID: <0b7e5a201100f71f0109d83ba7c33675000fd804.1794124132.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=mchehab+huawei@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127563127158500 QEMU has support for HEST table since version 9.2. Yet, it currently lacks a test to check if the HEST table is working. Add tests for arm64 error inject mechanism, implemented at QEMU version 10.2. Signed-off-by: Mauro Carvalho Chehab --- tests/qtest/bios-tables-test.c | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index f6dfa4131b89..884af30d77ff 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -68,6 +68,7 @@ =20 #define MACHINE_PC "pc" #define MACHINE_Q35 "q35" +#define VIRT_ACPI_GED_BASE 0x09080000 =20 #define ACPI_REBUILD_EXPECTED_AML "TEST_ACPI_REBUILD_AML" =20 @@ -913,6 +914,84 @@ static uint8_t base_required_struct_types[] =3D { 0, 1, 3, 4, 16, 17, 19, 32, 127 }; =20 +static void test_acpi_ghes_v2_injection(test_data *data) +{ + const uint8_t cper[20] =3D { [0] =3D 2, [16] =3D 2 }; /* corrected GES= B */ + g_autofree char *payload =3D g_base64_encode(cper, sizeof(cper)); + uint64_t status_addr, ack_addr; + uint8_t actual[sizeof(cper)]; + QTestState *qts =3D data->qts; + const uint8_t *ghes =3D NULL; + AcpiSdtTable *hest =3D NULL; + AcpiSdtTable *table; + + for (unsigned i =3D 0; i < data->tables->len; i++) { + table =3D &g_array_index(data->tables, AcpiSdtTable, i); + + if (compare_signature(table, "HEST")) { + hest =3D table; + break; + } + } + g_assert_nonnull(hest); + + for (unsigned i =3D 0; i < ldl_le_p(hest->aml + 36); i++) { + const uint8_t *entry =3D hest->aml + 40 + i * 92; + + g_assert_cmpuint(lduw_le_p(entry), =3D=3D, 10); /* GHESv2 */ + if (lduw_le_p(entry + 2) =3D=3D 1) { /* QMP source */ + ghes =3D entry; + break; + } + } + g_assert_nonnull(ghes); + g_assert_cmpuint(ghes[32], =3D=3D, 7); /* GPIO notification */ + status_addr =3D qtest_readq(qts, ldq_le_p(ghes + 24)); + ack_addr =3D ldq_le_p(ghes + 68); + g_assert_cmphex(status_addr, !=3D, 0); + g_assert_cmphex(ack_addr, !=3D, 0); + g_assert_cmpuint(qtest_readq(qts, ack_addr), =3D=3D, 1); + + for (unsigned i =3D 0; i < 3; i++) { + qtest_qmp_assert_success(qts, + "{'execute': 'inject-ghes-v2-error', 'arguments': {'cper': %s}= }", + payload); + g_assert_cmpuint(qtest_readq(qts, ack_addr), =3D=3D, 0); + qtest_memread(qts, status_addr, actual, sizeof(actual)); + g_assert_cmpmem(actual, sizeof(actual), cper, sizeof(cper)); + + /* GED converts the GPIO notification into an Error event. */ + g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, 0x20= ); + g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, 0); + + /* A second injection must wait for OSPM's acknowledgement. */ + qobject_unref(qtest_qmp_assert_failure_ref(qts, + "{'execute': 'inject-ghes-v2-error', 'arguments': {'cper': %s}= }", + payload)); + qtest_writeq(qts, ack_addr, 1); + } +} + +static void test_acpi_aarch64_virt_ras(void) +{ + test_data data =3D { + .machine =3D "virt", + .arch =3D "aarch64", + .tcg_only =3D true, + .uefi_fl1 =3D "pc-bios/edk2-aarch64-code.fd", + .uefi_fl2 =3D "pc-bios/edk2-aarch64-vars.fd", + .cd =3D "tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.= qcow2", + .ram_start =3D 0x40000000ULL, + .scan_len =3D 128ULL * MiB, + }; + + test_vm_prepare("-cpu cortex-a57 -machine ras=3Don", &data); + process_acpi_tables_noexit(&data); + test_acpi_ghes_v2_injection(&data); + qtest_quit(data.qts); + free_test_data(&data); +} + static void test_acpi_piix4_tcg(void) { test_data data =3D {}; @@ -2930,6 +3009,7 @@ int main(int argc, char *argv[]) } else if (strcmp(arch, "aarch64") =3D=3D 0) { if (has_tcg && qtest_has_device("virtio-blk-pci")) { qtest_add_func("acpi/virt", test_acpi_aarch64_virt_tcg); + qtest_add_func("acpi/virt/ras", test_acpi_aarch64_virt_ras); qtest_add_func("acpi/virt/acpihmatvirt", test_acpi_aarch64_virt_tcg_acpi_hmat); qtest_add_func("acpi/virt/topology", --=20 2.56.0 From nobody Mon Nov 23 04:34:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1794127582; cv=none; d=zohomail.com; s=zohoarc; b=G58vikTX9e3S4bsRzT8jrM4ePUWNGjCVVSPwguX6/2oWAre0ynEMSsqmoJiwoksyJ0j7bIJT/tHPBZPJrsKieprtm4589nD4nv7XxETcH5YPiYPOMAfz1iG4lUMOyvTbFi1kjIiZXA1aClWIxn86ZwO8lQl5qrl6f5II+lDcrdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794127582; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fJ2D4+UepDWKzql8BSO7qAOcZ4LOSTF9J2TAyckyQC0=; b=E1ux2jkCOtzVap3tP2IhAqt3dzAqFrEhQyJAbJOVrSzdXO53a1oFbVNRjcK8GH9OamjenuBxV2PrxS9CKT/D4kI19+ZglJvSNxfJZwi7gUr00ca9dczfcV3OOyLJLZvRYKiP+dyGBwMylpd5cVfvOwD/yAL/OwOFWG2iY4AFhU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1794127582599348.53966579759594; Sun, 8 Nov 2026 00:46:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xPyWs-0007cZ-T3; Sun, 08 Nov 2026 03:45:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWm-0007YW-Ir; Sun, 08 Nov 2026 03:45:28 -0500 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xPyWj-0000HW-Cx; Sun, 08 Nov 2026 03:45:28 -0500 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id B4938448D9; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BFA31F008A7; Sun, 8 Nov 2026 08:45:16 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.100.1) (envelope-from ) id 1xPyWY-00000005TMn-31p0; Sun, 08 Nov 2026 09:45:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794127516; bh=fJ2D4+UepDWKzql8BSO7qAOcZ4LOSTF9J2TAyckyQC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lmIgeCCot26vi5t6wISZcVbgp2cfazeMZDqXcE2vM2veB+N3K+qV+168S5lrKuxlQ 8twqpscIj+qFTPbUuWZHfRcdo6WshH295zbXB9ipCOcu4IzOsjpp6CGG8TTxCgSLNz 7cYTUFP6efQFLDBxZ7S8P0d+o6advvwcQSmSlQXzF0xtgyqOJtQQ1zY6DzHbLcUq93 qyzvbe5H4XUiF9KM6FpziPVjIi2ZtWFry8hO7kImjM4GFoSvuUo/JTmrHIGSR0xaOq gtvwOlA6et107lFBamIrbNwsE//KM7lP7u9i4LXsN91749BL05nvoiQQrezwsZD5qb xXolyE+4iwHKQ== From: Mauro Carvalho Chehab To: Michael S Tsirkin Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Igor Mammedov , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH v2 8/8] tests: add GHES tests on x86 piix4 and q35 machines Date: Sun, 8 Nov 2026 09:45:09 +0100 Message-ID: <904d946b5130aa53779454aba43334140500159d.1794124132.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=mchehab+huawei@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1794127583307158500 Add support to test GHES on x86 using the SCI mechanism. Signed-off-by: Mauro Carvalho Chehab --- tests/qtest/bios-tables-test.c | 67 ++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 884af30d77ff..4e9eac290472 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -914,7 +914,8 @@ static uint8_t base_required_struct_types[] =3D { 0, 1, 3, 4, 16, 17, 19, 32, 127 }; =20 -static void test_acpi_ghes_v2_injection(test_data *data) +static void test_acpi_ghes_v2_injection(test_data *data, bool sci, + int notif_type) { const uint8_t cper[20] =3D { [0] =3D 2, [16] =3D 2 }; /* corrected GES= B */ g_autofree char *payload =3D g_base64_encode(cper, sizeof(cper)); @@ -923,14 +924,18 @@ static void test_acpi_ghes_v2_injection(test_data *da= ta) QTestState *qts =3D data->qts; const uint8_t *ghes =3D NULL; AcpiSdtTable *hest =3D NULL; + AcpiSdtTable *fadt =3D NULL; AcpiSdtTable *table; + uint8_t gpe_len; + uint32_t gpe0; =20 for (unsigned i =3D 0; i < data->tables->len; i++) { table =3D &g_array_index(data->tables, AcpiSdtTable, i); =20 if (compare_signature(table, "HEST")) { hest =3D table; - break; + } else if (compare_signature(table, "FACP")) { + fadt =3D table; } } g_assert_nonnull(hest); @@ -945,29 +950,51 @@ static void test_acpi_ghes_v2_injection(test_data *da= ta) } } g_assert_nonnull(ghes); - g_assert_cmpuint(ghes[32], =3D=3D, 7); /* GPIO notification */ + g_assert_cmpuint(ghes[32], =3D=3D, notif_type); status_addr =3D qtest_readq(qts, ldq_le_p(ghes + 24)); ack_addr =3D ldq_le_p(ghes + 68); g_assert_cmphex(status_addr, !=3D, 0); g_assert_cmphex(ack_addr, !=3D, 0); g_assert_cmpuint(qtest_readq(qts, ack_addr), =3D=3D, 1); =20 + if (sci) { + g_assert_nonnull(fadt); + gpe0 =3D ldl_le_p(fadt->aml + 80); + gpe_len =3D fadt->aml[92]; + qtest_irq_intercept_in(qts, "ioapic"); + qtest_outb(qts, gpe0, 0xff); + qtest_outb(qts, gpe0 + gpe_len / 2, 0x80); + } + for (unsigned i =3D 0; i < 3; i++) { + if (sci) { + g_assert_false(qtest_get_irq(qts, 9)); + } qtest_qmp_assert_success(qts, "{'execute': 'inject-ghes-v2-error', 'arguments': {'cper': %s}= }", payload); g_assert_cmpuint(qtest_readq(qts, ack_addr), =3D=3D, 0); qtest_memread(qts, status_addr, actual, sizeof(actual)); g_assert_cmpmem(actual, sizeof(actual), cper, sizeof(cper)); - - /* GED converts the GPIO notification into an Error event. */ - g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, 0x20= ); - g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, 0); + if (sci) { + g_assert_cmphex(qtest_inb(qts, gpe0) & 0x80, =3D=3D, 0x80); + g_assert_true(qtest_get_irq(qts, 9)); + } else { + /* GED converts the GPIO notification into an Error event. */ + g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, = 0x20); + g_assert_cmphex(qtest_readl(qts, VIRT_ACPI_GED_BASE), =3D=3D, = 0); + } =20 /* A second injection must wait for OSPM's acknowledgement. */ qobject_unref(qtest_qmp_assert_failure_ref(qts, "{'execute': 'inject-ghes-v2-error', 'arguments': {'cper': %s}= }", payload)); + + if (sci) { + /* Emulate OSPM clearing the edge GPE. */ + qtest_outb(qts, gpe0, 0x80); + g_assert_false(qtest_get_irq(qts, 9)); + } qtest_writeq(qts, ack_addr, 1); } } @@ -987,7 +1014,28 @@ static void test_acpi_aarch64_virt_ras(void) =20 test_vm_prepare("-cpu cortex-a57 -machine ras=3Don", &data); process_acpi_tables_noexit(&data); - test_acpi_ghes_v2_injection(&data); + test_acpi_ghes_v2_injection(&data, false, 7); + qtest_quit(data.qts); + free_test_data(&data); +} + +static void test_acpi_x86_ras(const void *opaque) +{ + test_data data =3D { + .machine =3D opaque, + .arch =3D "x86", + .variant =3D ".ras", + }; + + test_vm_prepare("-machine ras=3Don", &data); + process_acpi_tables_noexit(&data); + test_acpi_ghes_v2_injection(&data, true, 3); + free_test_data(&data); + + /* Check if fw restored error buffer, then write back HEST on reset. */ + qtest_system_reset(data.qts); + process_acpi_tables_noexit(&data); + test_acpi_ghes_v2_injection(&data, true, 3); qtest_quit(data.qts); free_test_data(&data); } @@ -2883,6 +2931,8 @@ int main(int argc, char *argv[]) } if (qtest_has_machine(MACHINE_PC)) { qtest_add_func("acpi/piix4", test_acpi_piix4_tcg); + qtest_add_data_func("acpi/piix4/ras", MACHINE_PC, + test_acpi_x86_ras); qtest_add_func("acpi/piix4/oem-fields", test_acpi_piix4_oem_fi= elds); qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge= ); qtest_add_func("acpi/piix4/pci-hotplug/no_root_hotplug", @@ -2921,6 +2971,7 @@ int main(int argc, char *argv[]) } if (qtest_has_machine(MACHINE_Q35)) { qtest_add_func("acpi/q35", test_acpi_q35_tcg); + qtest_add_data_func("acpi/q35/ras", MACHINE_Q35, test_acpi_x86= _ras); qtest_add_func("acpi/q35/oem-fields", test_acpi_q35_oem_fields= ); if (tpm_model_is_available("-machine q35", "tpm-tis")) { qtest_add_func("acpi/q35/tpm2-tis", test_acpi_q35_tcg_tpm2= _tis); --=20 2.56.0