From nobody Sat Sep 26 19:59:31 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=1788630897; cv=none; d=zohomail.com; s=zohoarc; b=KaOc+sgwEGJw8jYL/jBPUO3MlIC/UOpdzsFYAhZr1Fjr5q8ea8s4B5DvkGms0WdzBL9Pui1xvR/YW4AVgmNvtlacMR9T/BwofiYPrylvqPpo7lYaVGRcJMihf9RfxlkBlkXE+EPEaJUCO2ARGmNDBE22zXJ6eDTuDOp5R3D0ki0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630897; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nXZSXnMuGsLcEv+yuUu6nqHWYxfBU+FXG7tpegXc2q0=; b=LWuwrQvU1sjabcz6qTz5eEBAiJChSTZdCsF2AeLIZZFkbDb9r8lTBlGf/7Qk0FdeaBIw20Xg4Ke0loS7coFbO5oIVQU1V6US6qaQz5yAITQ/Y1MvO/dsxay8gAL/iCWyVWHbLJl78/GzsXczw1x1WboVpXEWJ0p6dQeybjOJgYk= 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 178863089778120.686279016903427; Sat, 5 Sep 2026 10:54:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaO-0005Jo-3a; Sat, 05 Sep 2026 13:53:52 -0400 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 1x2uaH-0005E1-4U; Sat, 05 Sep 2026 13:53:45 -0400 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 1x2uaE-0008I9-1h; Sat, 05 Sep 2026 13:53:44 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id CD6AF43E64; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D53F1F00A3D; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bkrh-2r4n; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=nXZSXnMuGsLcEv+yuUu6nqHWYxfBU+FXG7tpegXc2q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HdFSPVFFh7WCXCORzRQ3WCtc+dEnY72RJI1VWbHZf0dmNc3/iqN40ZptjFT/F1fuS BXSXI41qgKXQwDH3n4f34Jn9jW8CPGCRcB5KEZ4G91TTaw+KwNwy5tDEb+Ypgn5VIS 8M/KZaRI6MpQSsOaxpwrvQDKjcWPp9yLqkhFK/EXtHtcUMWCDVkA8WuYpGo7yhTaM6 wyBh4pIuV9wHJpYjN9zxqgce6YVjTMW/HDwNaxxuUJoC2OATqLw+vRmNd/uFbBqhv4 DSxdMh4qDXjf8x4gvh0tpE9BkRScQtcGPlRPl6B1DPqy/lTHXP+uL4SRYB16rbCZ/P 8iWredpcXujgw== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH 1/8] acpi_dev_interface: a ghes support state at AcpiDeviceIfClass Date: Sat, 5 Sep 2026 19:53:21 +0200 Message-ID: <28339fd62574150afe924b93c81f62bfaacb54b6.1788630333.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630900234154100 For x86, we'll need to have a way 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 a common arch-independent place. 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 9e9416d4067d..2c5abe2a54f5 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -322,6 +322,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); @@ -608,6 +613,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 static const TypeInfo acpi_ged_info =3D { 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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630919; cv=none; d=zohomail.com; s=zohoarc; b=dIZyiWFMS9D9X8dY1wwUfqWEr0eghL+XpBqu4FDpGKeiGQQNT1+iceIR0yVQP6JqcEWEZUcu9iHLBoYxenJOU9E4zl6k93XeqiG0Avk/rR8md9QGLVHIXxpA/fbopvIdcJy5wx9nP6xANcm9LEC8ipGZgYpgOMAJYogP/WBuTnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630919; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iZMFXJG4YPvTIBsURsNf5N+2DcwOXXHAUugNxjcUsBk=; b=RHqsvy/aG598sdMvxC39gb6hsOPAiM7jzhfQ9hEUWtmlxS2N4a3gBepi8Ont7VL75H8fUN2WgqSB4rRj7vm+MkOHdKJ+Oduo2zktxew+RC2p/LmLsrfgj4BN6edM/xJ3lWHiper41UbVn07SmGfjYBzS/TR0LvxUpyL2hPDR5B4= 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 1788630919931698.7947791643293; Sat, 5 Sep 2026 10:55:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaL-0005HG-Py; Sat, 05 Sep 2026 13:53:49 -0400 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 1x2uaF-0005Dr-Ud; Sat, 05 Sep 2026 13:53:44 -0400 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 1x2uaE-0008I6-0f; Sat, 05 Sep 2026 13:53:43 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 005CF44540; Sat, 5 Sep 2026 17:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A734F1F00ACF; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bkrl-2xnb; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=iZMFXJG4YPvTIBsURsNf5N+2DcwOXXHAUugNxjcUsBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ow7QEv4LF3zgMu0XahMoKaqbZoX98jVoKQ1P3uRtTLw9EcurzYv097ac+iFsDCOSG krCt7zt4TKdoMAryIPjXL/x0N8mEFJZD3ouPjH8Vdm47EOtrfsoP2nqq6nD1w1Chl8 +YIvV1NMEOqft6weoNljtKmFjioTxwYp1fKlLgPdxGq7THEENhIZhdn9vVj2kSkEbf M+SBZSvROysuzZFbLWD7Zy5ybYNotTmUCeYepQMid7fVbmppnFp7yZKErGilHvSYNQ tdQw++mXMmzoMZmrwO+/ERsQRg1TyW/Wkk9ol7Cq35G0twkD0MjgP5kWi34YyuwDhT guxz4WaHYEfBQ== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH 2/8] tests/acpi: virt: reserve expected tables for PC GHES SCI support Date: Sat, 5 Sep 2026 19:53:22 +0200 Message-ID: X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630921827154100 Prepare to modify x86 firmware files, disabling DSDT and HEST table check until we update it to new firmware file changes. Signed-off-by: Mauro Carvalho Chehab --- tests/data/acpi/x86/pc/DSDT.ras | 0 tests/data/acpi/x86/pc/HEST.ras | 0 tests/data/acpi/x86/q35/DSDT.ras | 0 tests/data/acpi/x86/q35/HEST.ras | 0 tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 5 files changed, 4 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..e69de29bb2d1 diff --git a/tests/data/acpi/x86/pc/HEST.ras b/tests/data/acpi/x86/pc/HEST.= ras new file mode 100644 index 000000000000..e69de29bb2d1 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..e69de29bb2d1 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..e69de29bb2d1 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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630919; cv=none; d=zohomail.com; s=zohoarc; b=W1STPM6BsStcv4bbmEWQvRHOQRiczpjcZC/EW1YNHFvgsvgXrldRwSatVX3ZuSvdGvLqhf7Cm55BCubMbv/DVF3Zclfj15PM/j7DQA+agdGB9iH4oQBA88q8taNB0F+gzZ4GYquOAx4mR8stiVd7/QH4KV8w4zMEYgb+TsR5YgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630919; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ij2k42owOV+OROf/MB1CscRZGK/WiXn0iNaX3gJtNOA=; b=ZJmaJuMfASuAz3tUmSw83cX+2DRCZLAKlIWzKDW+/zOMaU1YyfYUCiBkxG9INqIFe0v+vG9ZBxNxdzqUp86MgAlt4gEcfiVO4vA/dJZDOFPmY9lwMUKLpoeBcMb8BlYjos84TJvBJCNfT7IT4r8eyCobtsqnVTRCVJqfyN8qprY= 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 1788630919325945.1514190801645; Sat, 5 Sep 2026 10:55:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaM-0005Hd-9y; Sat, 05 Sep 2026 13:53:50 -0400 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 1x2uaJ-0005F0-7p; Sat, 05 Sep 2026 13:53:47 -0400 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 1x2uaG-0008Jw-US; Sat, 05 Sep 2026 13:53:46 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0909F4478A; Sat, 5 Sep 2026 17:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F6461F00A3E; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bkrp-34eB; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=Ij2k42owOV+OROf/MB1CscRZGK/WiXn0iNaX3gJtNOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aHbrx/Pi1mSKsyM4sJWwLAOZiZR80J5VArsW7fPn6Iayk29EJf64O4uhsRKLXVCWn 5R5Kwjn6lN5RZCMQ0DAvD/daUyCz9xGL/4s+JC+N0X8U91g+O92sH0SzecoxgrHtAB Zvj+T0JyUWfhsmrYvLUCywt6EpR40X4WZ4UR8qtOGX6cIu6n/s/bllyuYY0/G3E6ub Y6bYk2tkYnD+ESdXUfcBKAssVjgi9UwXzxFTF4RdPgjfQWSvxlepHhF757FqXse2Pz R1QKjyIbR8DGHG4/sVe5eH0SryTsS0r1SIxMVAoOGgmsoK7bgKg185Z+ymhRZ5Q8Ha oMp710YheFqHA== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov , Paolo Bonzini Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha , Richard Henderson Subject: [PATCH 3/8] hw/i186: add support for HEST table with SCI Date: Sat, 5 Sep 2026 19:53:23 +0200 Message-ID: X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630921921154100 Added needed bits at x86 architecture to allow both pb and q32 machines to support GHESv2 via HEST tables. To do that, add needed _OSC capability bits to enable APEI support. Signed-off-by: Mauro Carvalho Chehab --- hw/i386/Kconfig | 1 + hw/i386/acpi-build.c | 99 ++++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc.c | 41 ++++++++++++++++++ include/hw/i386/pc.h | 5 +++ 4 files changed, 146 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 8837b69687d1..78ff78bd8200 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,53 @@ static void build_acpi0017(Aml *table) aml_append(table, scope); } =20 +/* ACPI 5.0, 6.2.10.2: Platform-Wide OSPM Capabilities. */ +#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")); + + /* capacity buffer */ + if_ctx =3D aml_if(aml_lnot(aml_equal(aml_arg(0), + aml_touuid("0811B06E-4A27-44F9-8D60-3CBBC22E7= B48")))); + 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); + + /* 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); + + /* Count of entries in arg 3: 2 */ + 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); + + /* Update needed Platform-Wide _OSC Capabilities */ + 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(0x10), 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, @@ -1281,6 +1329,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); @@ -2011,6 +2074,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) { @@ -2167,6 +2234,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); @@ -2283,6 +2360,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; @@ -2329,6 +2421,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 f064aa2b3e32..5906152ed31e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -50,6 +50,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" @@ -1611,6 +1612,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) { @@ -1645,12 +1674,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)); } @@ -1769,6 +1804,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 d4b6d3ed57fa..52b4e18ab7db 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; @@ -52,6 +55,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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630896; cv=none; d=zohomail.com; s=zohoarc; b=N1gGArROSI9FtC713XewMfoaF1FjQXH6tD+WSsyufJTnXwbxKRtIHIxs68MT5I+Eapavcp5wZAh36DoWwRWO0Oqy9UkOXbHx5WBAn2hSVgcw5YN/aYGMROc1gxVeQqg57xFI3s7YCE6mtIlxlgOwmEd6GkOOa4vpPjmHaA932cQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630896; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ai+qCKVGooyNyHPnec0n28qWkLpI/YR341Xh8tbfMVA=; b=SJi3U6xApxd++mhKNlzNB0Y7EydhxroDMsKNjb3tYb3883Kse17EdKpMKwnyoTs9/siVpsAhTHt1kDhbRSkcb7tIm3S96/OmWjSSUJpgJYDAp++0I6rtWJSdrVXQPhfWej9Qg2YoHbwsoePU4hLY46t/adr9A4C2otPYIHsKGTw= 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 1788630896775575.0651940152375; Sat, 5 Sep 2026 10:54:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaN-0005J1-4S; Sat, 05 Sep 2026 13:53:51 -0400 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 1x2uaJ-0005Ey-2B; Sat, 05 Sep 2026 13:53:47 -0400 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 1x2uaG-0008Jx-Vj; Sat, 05 Sep 2026 13:53:46 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0AA6C44793; Sat, 5 Sep 2026 17:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB64B1F00ADE; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bkrt-3BWb; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=ai+qCKVGooyNyHPnec0n28qWkLpI/YR341Xh8tbfMVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lN5bpN34Vo4ZAjzpDJ8XyoAHg0R12di3aeGoDmYSR1uNMg+dtCNlLTgUrNtd8YIPe 2WpsMTS14ojzZLeS1CmZqnaLxFGZot8AVJ7M8rhYuq86EnLwzvqpx4Evudl4G+kFCC YGGwz651Gc/i6DaVGvEvYbAcMyeZ6gsJEGhljnR6FTNipPl33381EoVTiGzG9KOLlf fSZ6AsFs5g9Vnr6XgXEFr8aMLXLmKplW1TlnRRZsPmip+ftojTLV+RJEPE1mYhl5F4 0uPC1rm7CoSY3MwjfWbXrNhFqjnXl7SUkg8tutiLmbQ9WZLROo4E2/y/flrdZRsxjg kq3qyyzyfpZpA== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, 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 4/8] hw/i386: add GHES support at ICH9 and PIIX4 PM Date: Sat, 5 Sep 2026 19:53:24 +0200 Message-ID: X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630902881158500 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 5e8f8a7eafa3..7e2199891431 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -222,6 +222,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, @@ -244,6 +262,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 9b7f50c7afac..48fa833c66ef 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 } }; @@ -551,6 +570,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); @@ -607,6 +631,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 static const TypeInfo piix4_pm_info =3D { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index edf9783ec8d4..00d940f16314 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -847,6 +847,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); @@ -911,6 +916,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 diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 30990fcef53f..772f1a8937d7 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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630922; cv=none; d=zohomail.com; s=zohoarc; b=WsZZyMlyzQ2EGo6qSy+gf3OdagIg76mpojg0z83eIOpJSz3GUx+tM9FQja+NgnT4qX3KikHj7pQ9pE4lKAJ1qrfiZi7owcw6Diy1Ww08LSSaA5PACCMNFd8Tvm/Iso0zzUR/WiFOlwZaX6IAvB55v/PTz5NB4wLiNdgJBPSeKfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630922; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z/gyrlvZHOgQPdhVvahEbxM2gbYFirwvQo092awQNlI=; b=JrFPcS06lUVu272weoZWtXW1+G6f00Ia3K00dNEJccigl6WuLsfj5WON0u0G7AR2r4mHaWYhY6N5oqeP7JSYuH7zy74cjdd5JPBQ7WAeE91Xk1dX97aF6HIrmB8chiZdz3vGWjh7/q9DwfM0GejB+YOu+8cjUHNPT9YGZqwCgsw= 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 178863092238848.367230842680215; Sat, 5 Sep 2026 10:55:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaP-0005Kq-As; Sat, 05 Sep 2026 13:53:53 -0400 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 1x2uaM-0005HT-2k; Sat, 05 Sep 2026 13:53:50 -0400 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 1x2uaJ-0008KO-0S; Sat, 05 Sep 2026 13:53:49 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0B1C044798; Sat, 5 Sep 2026 17:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A96271F00ADB; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bkrx-3ILq; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=Z/gyrlvZHOgQPdhVvahEbxM2gbYFirwvQo092awQNlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BiNyPbKUYmvyceFDPuwcBNwaZVnC3Eyeagf4IFT2Zu4XQjlMfjGJN0Mvqe6J3uCFW Vpp7i5ME6jN844OirwzKFCmroGSKX3wqBuwId+51TFu5wk2Njw1lH2bTfJ3BJ1xxsx vYNhOex5AQuchndxJUSOAGbrRd7u6BPQHzWV7tJEniUpsJCaIiFjOEpkS8x6JMG9ta BWdKkVYEdQfdJi5qGqeedgu+Oli7m9smmmkWX3f+MNdgGzx7TaTl5UNKfIZ+EXiGMj cZ7hJDuILPX7AORpTDNqItRk/miHUp50NHy40NwR3RKeaaZJlLocOkAwdrp2XQ9EnP 0FN5L5g9hJGIg== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH 5/8] tests/acpi: virt: add x86 DSDT and HEST tables Date: Sat, 5 Sep 2026 19:53:25 +0200 Message-ID: X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630924332158500 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 0 -> 8818 bytes tests/data/acpi/x86/pc/HEST.ras | Bin 0 -> 132 bytes tests/data/acpi/x86/q35/DSDT.ras | Bin 0 -> 8647 bytes tests/data/acpi/x86/q35/HEST.ras | Bin 0 -> 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..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 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/pc/HEST.ras b/tests/data/acpi/x86/pc/HEST.= ras index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6dfeb1d3704523f5ee7c81f442c= 4f51bbd10282d 100644 GIT binary patch literal 132 zcmeZp4Gw8xU|?XhbMklg2v%^42yj+VP*7lGU|;~TK{N<+F)%Xx|Ife(<1?@@FfceU guzdLapPhk$fq_{DMB)HYwLhS0|NVymkXaxA05bg-0RR91 literal 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/DSDT.ras b/tests/data/acpi/x86/q35/DSD= T.ras index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f7626f56ceda77aeb0ca04e8913= d76bf57177a45 100644 GIT binary patch literal 8647 zcmb7~Pi))P9mn6(KT}VXMM?CZ*iNjaExN5kDkp6k>>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 0 HcmV?d00001 diff --git a/tests/data/acpi/x86/q35/HEST.ras b/tests/data/acpi/x86/q35/HES= T.ras index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6dfeb1d3704523f5ee7c81f442c= 4f51bbd10282d 100644 GIT binary patch literal 132 zcmeZp4Gw8xU|?XhbMklg2v%^42yj+VP*7lGU|;~TK{N<+F)%Xx|Ife(<1?@@FfceU guzdLapPhk$fq_{DMB)HYwLhS0|NVymkXaxA05bg-0RR91 literal 0 HcmV?d00001 diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index b3761468accc..dfb8523c8bf4 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,5 +1 @@ /* 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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630915; cv=none; d=zohomail.com; s=zohoarc; b=i4wf6lqFNv4RDRDeoPVgtJxO6nn90isK2DLkqAwyJWKra9ZDZO7gu11xXvun/CrZ5np7nqkUAV3iYavPvzUkzNngIt5nJGKVU/Czcq72FX3By8BDoNDw1BTitcigIIwR8mla/5ol8CEdczlt3jtmx3OHUDBWsDQkr8o6anqFxEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630915; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wQgyAR83act1RsCI64W0ZhW7znuJEWe5RJhFGqpIHYk=; b=FPtrDiN15bskHZ3mtGhdPFaKlatNzXR+1S/LY6iqoHjNUTmwx+gidkAm8PplSooGYVaZxwj5ksskBGMxdeETNtrFyVjNjidTQdmIUNAMNmoC24ivKYYfYWyoaAJw9wmiQnSvc+vOku1kcC0ivcrq8qm5l0DSGdGCDSjH7Bwul+E= 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 1788630915489546.1915173132934; Sat, 5 Sep 2026 10:55:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaL-0005H6-Kj; Sat, 05 Sep 2026 13:53:49 -0400 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 1x2uaF-0005Ds-Uu; Sat, 05 Sep 2026 13:53:44 -0400 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 1x2uaE-0008IF-1f; Sat, 05 Sep 2026 13:53:43 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2B94F601DB; Sat, 5 Sep 2026 17:53:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B7491F00A3A; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bks1-3P5j; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=wQgyAR83act1RsCI64W0ZhW7znuJEWe5RJhFGqpIHYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E9Smco0sr8osi8vff1k/862N5+0EHe9XmUfcOTnEqXv0FhfFyzNYVfDsdbLtsv9MM XrGWQzYsvTBIn50+2zojaJzvrJQ0K5VXBFFkoih+QW7TJQTzVSR29fVniExwpY16PC RsEPCkqGRSN8oAafRLwMxp/jVGu1NYY037Mo2QWvvf9HkhOjKuYY8Y7mi0pf69wgzg 4teTh9C8l3nsro2qDPReMBfPzgBWk3lhdAoruF+h2afCWW2UHs4HKSq/IayhcNlqix z2AAHEsUWHO3lVucuVucqVjskJmbEDtjZKNWy6in9dzbhxPI3aldUiatQ7O27BMQXT U9Ih5ino80VYQ== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov , Pierrick Bouvier Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org Subject: [PATCH 6/8] docs: acpi_hest_ghes: document notification mechanisms Date: Sat, 5 Sep 2026 19:53:26 +0200 Message-ID: X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630916398158500 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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630896; cv=none; d=zohomail.com; s=zohoarc; b=RhT3qQFoG8RU8SO9YeVcdNh0uK13cQKftmu3gIrwDTyyRveqZkw3TOmpEP3KVoJJq3N5Oivfvk5xrE8Sz9A+gFgJ0oFZVgsozpSa3+ixA0kllFMVlov/Gh7HwcY1JLztv+zMC/f/iB6lCFxj5IIDSLSHaCvUeqs9RyvWZi7Wfyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630896; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jHK8n1qrvOc4Q7942MjOL/+nZI/aby+kUuZA3CrS3NM=; b=jFrCrHwVnBdKkIjSPYND1hmbQajdH/GoahAdHeVqXgSp4f8udDsWYP4YDtrG6F7cOdkTvqJpjkpi7zyyIvVG37Os2BIwElLVuuAXMgNkqdM+VlvXN5OvszTH1GpXIuUQLCFQ6/ppOclrpIqufSwsP6o/6kNz5UjTAlUKmDqiVNc= 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 1788630896736200.30840834357082; Sat, 5 Sep 2026 10:54:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaM-0005I2-Is; Sat, 05 Sep 2026 13:53:50 -0400 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 1x2uaH-0005EE-CY; Sat, 05 Sep 2026 13:53:45 -0400 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 1x2uaD-0008I7-Un; Sat, 05 Sep 2026 13:53:45 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E360144500; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36041F00AC4; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bks5-3Vr1; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=jHK8n1qrvOc4Q7942MjOL/+nZI/aby+kUuZA3CrS3NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DtMpxe9Tf/6MaeBUcaiX7p83EidvSXpc//F9xrdJ67NUvJM2B6RHiPWGNOhRibykW C0hwHR27yRNPX327s+uy0Z9nVFM7ovJEMyaZrm5zVX6QXOqh/Ehdwqr9pH+5UQ0apb EhAqAQl7anPVubtiyY6Q1E0qcDuGYKhZ4L+1RB7ge+YG+AF88BX8ZvUdBhXqClkUqy 7vkas/LTfe2l4J3IimKDNzOAAnalXveRknnCyQBxSA+EVN33hPM/+P/WoQ39S2XlcS jExOHZHjOyB57hc/BkAl8dNKW1OJ67z2HZbkG9OQF+wwvOmCVCkjTqLqRPt19OV+Na XEifN6nb6Kb3w== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH 7/8] tests: test GHES notifications on arm64 virt machine Date: Sat, 5 Sep 2026 19:53:27 +0200 Message-ID: <16e6d6155893f3facb9f258103eea6f9ba4c4818.1788630333.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630900428154100 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 5cc526510ac1..5582b1dd72e4 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-arm-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 {}; @@ -2922,6 +3001,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.55.0 From nobody Sat Sep 26 19:59:31 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=1788630920; cv=none; d=zohomail.com; s=zohoarc; b=Y5lRG0RhDuDUS/nX2nRIYOjhKHykd4c6ICp6V2NvGUKrOmV+9AL03n2cyyI5Uw3rA13gTsf+x9LpIHo16yKuQLRzwBOKp06DVVLFQns1bqXz7DB8JZRWgKW2H+/GkNP5a25bcKtt/58/9tcj64XFRo8OLFVQgKzaED3FeIAGM4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788630920; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=thcqgOO3ngF6wL+4cjJHzcIM722Ty9k1ajLeGeC9oG4=; b=PBojevnm8202s0ssgu4uzkIT9JSacSUacKnL8hqF/xUdryn6VUQn23S1d1KbDi8imwG6tfoId3JXLJ662hjq2FbA2EsKrNYNMlhG0cfjxIA4jzRwiAkPlSPHall4x9gw535CrSsmb7I3If0GfKZlrCDk4QRJ2C+RrwBnkhJzCKU= 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 1788630920823486.78057713793646; Sat, 5 Sep 2026 10:55:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2uaO-0005KF-JQ; Sat, 05 Sep 2026 13:53:52 -0400 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 1x2uaH-0005ED-Ap; Sat, 05 Sep 2026 13:53:45 -0400 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 1x2uaE-0008I8-2G; Sat, 05 Sep 2026 13:53:45 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id DDDBC4345B; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15CA1F00A3F; Sat, 5 Sep 2026 17:53:32 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.5) (envelope-from ) id 1x2ua2-0000000Bks9-3chS; Sat, 05 Sep 2026 19:53:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788630812; bh=thcqgOO3ngF6wL+4cjJHzcIM722Ty9k1ajLeGeC9oG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Wlr1NiOB84Nri9E0jzWM+4Ac4OQ18Kg9YBxW7nX5t3YzbBqddGXr5JP5R/U+a8toy KLWuybG9AnS2a1pYVoN1pY5j+XzODHBNhEaA4k6G9/LShb1CAdshS7SZXjWhc1Ezuj Jm50y1GjT4RPaEAsM7aZb0g9HNYFJJSME2syoOG/scgl4AXCaFx0cpWBFPANWqz1gJ 3WLnPWae31+OnsVuc9Bc3H0x5TB2Jds5XMY52DA+VRsL5MYJ68VjiTP5MTbrDuVsI/ qTo5p7up8Vlw8uoAFXBZcK0GpUcVUjnNx033vFdieqtyDhlJeSGaYf/BmW1xk7vD7P PTWc4t8vO84Rw== From: Mauro Carvalho Chehab To: Michael S Tsirkin , Igor Mammedov Cc: Jonathan Cameron , Shiju Jose , qemu-devel@nongnu.org, Mauro Carvalho Chehab , linux-edac@vger.kernel.org, qemu-arm@nongnu.org, Ani Sinha Subject: [PATCH 8/8] tests: add GHES tests for x86 piix4 and q35 Date: Sat, 5 Sep 2026 19:53:28 +0200 Message-ID: <694086fd203b3149de806e66aaa70b8f181db957.1788630333.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.55.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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: 1788630922419158500 Add support to test GHES on x86 using the SCI mechanism. Signed-off-by: Mauro Carvalho Chehab --- tests/qtest/bios-tables-test.c | 66 +++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 5582b1dd72e4..77399e9100d9 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); } @@ -2875,6 +2923,7 @@ 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_x8= 6_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", @@ -2913,6 +2962,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.55.0