From nobody Sat Sep 6 17:00:14 2025 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=1757085217; cv=none; d=zohomail.com; s=zohoarc; b=AWST+D+5hGECf5pDCX7oalrdPOxsO8ORe6SZJM2TsppDf1W2lkKPT+KOCKLHUAUcbybi4CYohtFgYGSGPKuGGRslFKE5JfVzRgwZucNiASnfZU56vXLkkSbhYMI5/BbkBppBCbTCfrPd/PkkeeVopHn230jZ5C7JwQ7unRt8tlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757085217; 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=5w4IuT6O5yyuu1WYKEJhYNv9tBMehkyiit1QFIe3Y4c=; b=ZGNYUBmo1wI8qe2NdY49JqledC6OMN/wC3Kb4sJtcBc6CJ8MaJpvOcRtvWTUpgwEgiOrL8ZCeQ7RjSh46YE/js67gjHowqWW9CDOKTjDNWyG2QCi7kyEaGoEFSpnwMTSg5vXzkqcOZjhKuU7jz7Z5i1pLO7gHNWXW12gi/KOL78= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1757085217380770.7772816669641; Fri, 5 Sep 2025 08:13:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uuY5K-0007yg-CS; Fri, 05 Sep 2025 11:10:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uuY54-0007hQ-39; Fri, 05 Sep 2025 11:10:27 -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 1uuY4o-00065F-T9; Fri, 05 Sep 2025 11:10:25 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id E90A744DE3; Fri, 5 Sep 2025 15:09:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F769C113D0; Fri, 5 Sep 2025 15:09:34 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uuY49-0000000HEVB-3Xty; Fri, 05 Sep 2025 17:09:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757084974; bh=1Pr9vqZu8pn796Gdw1/oj1/eX0jNQ6r3eVUCB0ruxIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgEsR4B3WsFmas2kW/WxJgUHNKHLLw1tGqZjuSKSwsK8PErCohYZNp3HHVDPSh9tW Rav5pCDqBb5nImAFLMdMNicephVoJUHmj/JLXcdANXtPbmLkb3FYKeFKUdEiNj4w1b 5Bwb/JC3AaHnQnAxOs9FfkdFd2NJDr3emHvImHK0H5IMxVxevrTjqysNKqzjpo1PyE 1Atxb+uR3xqABwb9ndgdxHtKYS698XbU4dAqjruyDYaikelxtNlsCiaVMhDJdgaTYM +DngCt3XbbUWFGl8elPEk2ATyGe/T2y/GlyGy/NJuwmj26NupIDUUA0dX4bVx5He9a 4/7xeDRst5eWQ== From: Mauro Carvalho Chehab To: Igor Mammedov , "Michael S . Tsirkin" Cc: Jonathan Cameron , Shiju Jose , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Mauro Carvalho Chehab , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , Eduardo Habkost , Marcel Apfelbaum , Peter Maydell , Shannon Zhao , Yanan Wang , Zhao Liu Subject: [PATCH v11 09/17] acpi/generic_event_device: add logic to detect if HEST addr is available Date: Fri, 5 Sep 2025 17:09:16 +0200 Message-ID: <0d25ac192143d906ebce78d336d9393c4561514b.1757084668.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 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=lists.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: 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: 1757085219659116600 Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 10.0 and upper) or via the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- hw/acpi/generic_event_device.c | 2 ++ hw/arm/virt-acpi-build.c | 18 ++++++++++++++++-- hw/core/machine.c | 5 ++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 55998303c22f..b1ff6ab74d8f 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -349,6 +349,8 @@ static const Property acpi_ged_properties[] =3D { pcihp_state.use_acpi_hotplug_bridge, 0), DEFINE_PROP_LINK("bus", AcpiGedState, pcihp_state.root, TYPE_PCI_BUS, PCIBus *), + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, + ghes_state.use_hest_addr, false), }; =20 static const VMStateDescription vmstate_memhp_state =3D { diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 25f221aeb3ca..9a94e3993be9 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -1018,6 +1018,10 @@ static const AcpiNotificationSourceId hest_ghes_noti= fy[] =3D { { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, }; =20 +static const AcpiNotificationSourceId hest_ghes_notify_10_0[] =3D { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -1075,15 +1079,25 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBui= ldTables *tables) =20 if (vms->ras) { AcpiGedState *acpi_ged_state; + static const AcpiNotificationSourceId *notify; + unsigned int notify_sz; AcpiGhesState *ags; =20 acpi_ged_state =3D ACPI_GED(vms->acpi_dev); ags =3D &acpi_ged_state->ghes_state; if (ags) { acpi_add_table(table_offsets, tables_blob); + + if (!ags->use_hest_addr) { + notify =3D hest_ghes_notify_10_0; + notify_sz =3D ARRAY_SIZE(hest_ghes_notify_10_0); + } else { + notify =3D hest_ghes_notify; + notify_sz =3D ARRAY_SIZE(hest_ghes_notify); + } + acpi_build_hest(ags, tables_blob, tables->hardware_errors, - tables->linker, hest_ghes_notify, - ARRAY_SIZE(hest_ghes_notify), + tables->linker, notify, notify_sz, vms->oem_id, vms->oem_table_id); } } diff --git a/hw/core/machine.c b/hw/core/machine.c index 38c949c4f2ce..7b7a381b0ade 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -35,9 +35,12 @@ #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" +#include "hw/acpi/generic_event_device.h" #include "audio/audio.h" =20 -GlobalProperty hw_compat_10_1[] =3D {}; +GlobalProperty hw_compat_10_1[] =3D { + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, +}; const size_t hw_compat_10_1_len =3D G_N_ELEMENTS(hw_compat_10_1); =20 GlobalProperty hw_compat_10_0[] =3D { --=20 2.51.0