From nobody Fri Dec 19 20:31:45 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F6921019A for ; Fri, 21 Feb 2025 14:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740148536; cv=none; b=BeMswJjYZ0AJ7p/QTbl5XTbIZjqBqDiPZwVFTc8VzHk4J/fRvIf8vsOxH2b32gNVt/GLoTB6WQIfP7BbskTRqr4L0Y0GYOOiynsQ1IRbyuG8q0zRagIMuv+WeV7/C9DPZ3ekecb9I68Jjb1QrtUWYLIwywbwrPR9KtgUQQDQAvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740148536; c=relaxed/simple; bh=WR2eFSLdIkjOOB+IcImoFhsaXnuc9o37F6d83ATQ7Qc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SIeZylHzkLIs1oG1H5a4uqHe+uLrOltgJuAsmtzN+KX9RkTpbVhD9DVCAFX9lp9/aJWNaV6LOoFrxl4435KhK1VaBvMKl3VlbfL56hx8EqVezBqiWADn+tJNvOqYTsD4MUC0FQVSnxLktVxoet9LgixOy2vpQAkYVLcn0lDM5Xk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lv9BnXDJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lv9BnXDJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2909C4CEF0; Fri, 21 Feb 2025 14:35:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740148535; bh=WR2eFSLdIkjOOB+IcImoFhsaXnuc9o37F6d83ATQ7Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lv9BnXDJ6lFeXO042nLvOPT912WDebHJzYAtRO8Rb06seUhZ9PsQqpOWh6ZMm2pec ens5XzRXnKcjovX9r7d7f9/YJmECoWQAyLngElMh7CfYmcL3z32AQuKzDMZ6H857Rd Kl9wWKRMOk7YVW+fz9NCqdIfIQmZG3f22H4nhIYiIIU8g+XjDmy0sl/z94fCfMwDjn 6Fss2kprrfDHG5/k9wysXjHmCFyKRDcCoUy80SYiKwHs/lRFafzyWLGZ6jEI3wg8hb RGgPZ7XxXeW84HKAtMxmjvaKjpOybOPEiKRabC6+RJmn63gW0MA+1M6hY019Q2/W9c MYlGR0RxpBeJA== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tlU7m-00000002jE3-3GL5; Fri, 21 Feb 2025 15:35:30 +0100 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 , linux-kernel@vger.kernel.org Subject: [PATCH v4 08/14] acpi/generic_event_device: add logic to detect if HEST addr is available Date: Fri, 21 Feb 2025 15:35:17 +0100 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" Create a new property (x-has-hest-addr) and use it to detect if the GHES table offsets can be calculated from the HEST address (qemu 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 --- hw/acpi/generic_event_device.c | 1 + hw/arm/virt-acpi-build.c | 18 ++++++++++++++++-- hw/core/machine.c | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 5346cae573b7..14d8513a5440 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -318,6 +318,7 @@ static void acpi_ged_send_event(AcpiDeviceIf *adev, Acp= iEventStatusBits ev) =20 static const Property acpi_ged_properties[] =3D { DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0), + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, ghes_state.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 4439252e1a75..9de51105a513 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -897,6 +897,10 @@ static const AcpiNotificationSourceId hest_ghes_notify= [] =3D { { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, }; =20 +static const AcpiNotificationSourceId hest_ghes_notify_9_2[] =3D { + { ACPI_HEST_SRC_ID_SYNC, ACPI_GHES_NOTIFY_SEA }, +}; + static void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) { @@ -950,7 +954,9 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTa= bles *tables) build_dbg2(tables_blob, tables->linker, vms); =20 if (vms->ras) { + static const AcpiNotificationSourceId *notify; AcpiGedState *acpi_ged_state; + unsigned int notify_sz; AcpiGhesState *ags; =20 acpi_ged_state =3D ACPI_GED(object_resolve_path_type("", TYPE_ACPI= _GED, @@ -959,9 +965,17 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildT= ables *tables) ags =3D &acpi_ged_state->ghes_state; =20 acpi_add_table(table_offsets, tables_blob); + + if (!ags->use_hest_addr) { + notify =3D hest_ghes_notify_9_2; + notify_sz =3D ARRAY_SIZE(hest_ghes_notify_9_2); + } 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 02cff735b3fb..7a11e0f87b11 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -34,6 +34,7 @@ #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-net.h" #include "hw/virtio/virtio-iommu.h" +#include "hw/acpi/generic_event_device.h" #include "audio/audio.h" =20 GlobalProperty hw_compat_9_2[] =3D { @@ -43,6 +44,7 @@ GlobalProperty hw_compat_9_2[] =3D { { "virtio-balloon-pci-non-transitional", "vectors", "0" }, { "virtio-mem-pci", "vectors", "0" }, { "migration", "multifd-clean-tls-termination", "false" }, + { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, }; const size_t hw_compat_9_2_len =3D G_N_ELEMENTS(hw_compat_9_2); =20 --=20 2.48.1