From: Igor Mammedov <imammedo@redhat.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: "Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Shiju Jose" <shiju.jose@huawei.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Ani Sinha" <anisinha@redhat.com>,
"Dongjiu Geng" <gengdongjiu1@gmail.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
linux-kernel@vger.kernel.org, qemu-arm@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH RFC 4/5] acpi/generic_event_device: add logic to detect if HEST addr is available
Date: Thu, 3 Oct 2024 16:27:28 +0200 [thread overview]
Message-ID: <20241003162728.1de6fc62@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <176693e011a411db92be9e912bfc4a9da0e664b7.1727782588.git.mchehab+huawei@kernel.org>
On Tue, 1 Oct 2024 13:42:49 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
> Create a new property (x-has-hest-addr) and use it to detect if
> the GHES table offsets can be calculated from the HEST address
> (qemu 9.2 and upper) or via the legacy way via an offset obtained
> from the hardware_errors firmware file.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> hw/acpi/generic_event_device.c | 1 +
> hw/acpi/ghes.c | 2 +-
> hw/core/machine.c | 4 +++-
> include/hw/acpi/ghes.h | 1 +
> 4 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c
> index 49ca1fb8e84a..c4677c9ae6b4 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, AcpiEventStatusBits ev)
>
> static Property acpi_ged_properties[] = {
> DEFINE_PROP_UINT32("ged-event", AcpiGedState, ged_event_bitmap, 0),
> + DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, ghes_state.hest_lookup, true),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
> index 313a6e453af6..86bad865168c 100644
> --- a/hw/acpi/ghes.c
> +++ b/hw/acpi/ghes.c
> @@ -513,7 +513,7 @@ void ghes_record_cper_errors(const void *cper, size_t len,
> }
> ags = &acpi_ged_state->ghes_state;
>
> - if (!ags->hest_addr_le) {
> + if (!ags->hest_lookup) {
> get_ghes_offsets(le64_to_cpu(ags->hw_error_le),
> &cper_addr, &read_ack_register_addr);
just fencing off lookup is not enough,
to be compatible with qemu-9.1 (virt-9.1) we also should not publish hest_addr fwcfg.
Also have assert (to be removed later) to make sure that we put only
1 (existing) error source in HEST.
When you switch to multiple sources, this will become a condition
to switch HEST generation between 9.1 and 9.2+ variants.
> } else {
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index adaba17ebac1..b58afe48aa71 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -34,7 +34,9 @@
> #include "hw/virtio/virtio-iommu.h"
> #include "audio/audio.h"
>
> -GlobalProperty hw_compat_9_1[] = {};
> +GlobalProperty hw_compat_9_1[] = {
> + {"x-has-hest-addr", "false"},
> +};
> const size_t hw_compat_9_1_len = G_N_ELEMENTS(hw_compat_9_1);
>
> GlobalProperty hw_compat_9_0[] = {
> diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h
> index a07c30ef13b7..040d6ee366b2 100644
> --- a/include/hw/acpi/ghes.h
> +++ b/include/hw/acpi/ghes.h
> @@ -61,6 +61,7 @@ typedef struct AcpiGhesState {
> uint64_t hest_addr_le;
> uint64_t hw_error_le;
> bool present; /* True if GHES is present at all on this board */
> + bool hest_lookup; /* True if HEST address is present */
> } AcpiGhesState;
>
> /*
next prev parent reply other threads:[~2024-10-03 14:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 11:42 [PATCH RFC 0/5] Change ghes driver to use HEST-based offsets Mauro Carvalho Chehab
2024-10-01 11:42 ` [PATCH RFC 1/5] acpi/ghes: add a firmware file with HEST address Mauro Carvalho Chehab
2024-10-01 11:42 ` [PATCH RFC 2/5] acpi/ghes: Use HEST table offsets when preparing GHES records Mauro Carvalho Chehab
2024-10-02 14:25 ` Igor Mammedov
2024-10-01 11:42 ` [PATCH RFC 3/5] acpi/generic_event_device: Update GHES migration to cover hest addr Mauro Carvalho Chehab
2024-10-02 15:15 ` Igor Mammedov
2024-10-02 15:46 ` Peter Xu
2024-10-01 11:42 ` [PATCH RFC 4/5] acpi/generic_event_device: add logic to detect if HEST addr is available Mauro Carvalho Chehab
2024-10-03 14:27 ` Igor Mammedov [this message]
2024-11-12 14:55 ` Mauro Carvalho Chehab
2024-11-12 15:22 ` Mauro Carvalho Chehab
2024-10-01 11:42 ` [PATCH RFC 5/5] arm/virt-acpi-build: Properly handle virt-9.1 Mauro Carvalho Chehab
2024-10-03 14:46 ` Igor Mammedov
2024-10-02 13:45 ` [PATCH RFC 0/5] Change ghes driver to use HEST-based offsets Igor Mammedov
2024-11-13 6:54 ` Mauro Carvalho Chehab
2024-11-13 6:57 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241003162728.1de6fc62@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=anisinha@redhat.com \
--cc=eduardo@habkost.net \
--cc=gengdongjiu1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=mchehab+huawei@kernel.org \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shiju.jose@huawei.com \
--cc=wangyanan55@huawei.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).