[PATCH 0/3] hw/acpi, arm: Provide and use acpi_ghes_present()

Peter Maydell posted 3 patches 2 years, 10 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210603171259.27962-1-peter.maydell@linaro.org
Maintainers: Dongjiu Geng <gengdongjiu1@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Igor Mammedov <imammedo@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
include/hw/acpi/ghes.h |  9 +++++++++
hw/acpi/ghes-stub.c    | 22 ++++++++++++++++++++++
hw/acpi/ghes.c         | 17 +++++++++++++++++
target/arm/kvm64.c     |  6 +-----
hw/acpi/meson.build    |  6 +++---
5 files changed, 52 insertions(+), 8 deletions(-)
create mode 100644 hw/acpi/ghes-stub.c
[PATCH 0/3] hw/acpi, arm: Provide and use acpi_ghes_present()
Posted by Peter Maydell 2 years, 10 months ago
Currently the Arm code in target/arm/kvm64.c which decides whether
it should report memory errors via the ACPI GHES table works
only with the 'virt' board; in fact it won't even link if the
virt board is configured out of the QEMU binary.

This patchset replaces those virt-specific checks with a single
new acpi_ghes_present() function which tells the caller whether
it's OK to report errors by calling acpi_ghes_record_errors().
The mechanism we use is a simple flag in the AcpiGhesState
which gets sent if the board calls acpi_ghes_add_fw_cfg() to
set up the GHES stuff.

We need also to provide 'stub' versions of both acpi_ghes_present()
and acpi_ghes_record_errors() so that we can link even if no
board using ACPI GHES has been configured into the binary.

(You can test that this series is necessary by commenting out the
'CONFIG_ARM_VIRT=y' line in default-configs/devices/arm-softmmu.mak
and building with KVM enabled on an AArch64 host.)

I have tested with 'make' and 'make check' but nothing beyond
that; testing by somebody who has a guest setup that uses GHES
would be helpful just to check I haven't accidentally broken it.

thanks
-- PMM

Peter Maydell (3):
  hw/acpi: Provide stub version of acpi_ghes_record_errors()
  hw/acpi: Provide function acpi_ghes_present()
  target/arm: Use acpi_ghes_present() to see if we report ACPI memory
    errors

 include/hw/acpi/ghes.h |  9 +++++++++
 hw/acpi/ghes-stub.c    | 22 ++++++++++++++++++++++
 hw/acpi/ghes.c         | 17 +++++++++++++++++
 target/arm/kvm64.c     |  6 +-----
 hw/acpi/meson.build    |  6 +++---
 5 files changed, 52 insertions(+), 8 deletions(-)
 create mode 100644 hw/acpi/ghes-stub.c

-- 
2.20.1


Re: [PATCH 0/3] hw/acpi, arm: Provide and use acpi_ghes_present()
Posted by Peter Maydell 2 years, 10 months ago
On Thu, 3 Jun 2021 at 18:13, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Currently the Arm code in target/arm/kvm64.c which decides whether
> it should report memory errors via the ACPI GHES table works
> only with the 'virt' board; in fact it won't even link if the
> virt board is configured out of the QEMU binary.
>
> This patchset replaces those virt-specific checks with a single
> new acpi_ghes_present() function which tells the caller whether
> it's OK to report errors by calling acpi_ghes_record_errors().
> The mechanism we use is a simple flag in the AcpiGhesState
> which gets sent if the board calls acpi_ghes_add_fw_cfg() to
> set up the GHES stuff.
>
> We need also to provide 'stub' versions of both acpi_ghes_present()
> and acpi_ghes_record_errors() so that we can link even if no
> board using ACPI GHES has been configured into the binary.
>
> (You can test that this series is necessary by commenting out the
> 'CONFIG_ARM_VIRT=y' line in default-configs/devices/arm-softmmu.mak
> and building with KVM enabled on an AArch64 host.)
>
> I have tested with 'make' and 'make check' but nothing beyond
> that; testing by somebody who has a guest setup that uses GHES
> would be helpful just to check I haven't accidentally broken it.

Thanks for the review; I've applied this to target-arm.next.

-- PMM