qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ani Sinha <ani@anisinha.ca>
Cc: berrange@redhat.com, ehabkost@redhat.com, konrad.wilk@oracle.com,
	qemu-devel@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com,
	boris.ostrovsky@oracle.com,
	Eric DeVolder <eric.devolder@oracle.com>,
	rth@twiddle.net
Subject: Re: [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines
Date: Sat, 23 Oct 2021 16:14:26 -0400	[thread overview]
Message-ID: <20211023161237-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2110230751080.291405@anisinha-lenovo>

On Sat, Oct 23, 2021 at 07:52:21AM +0530, Ani Sinha wrote:
> 
> 
> On Fri, 22 Oct 2021, Eric DeVolder wrote:
> 
> > Ani, inline below.
> > eric
> >
> > On 10/22/21 05:18, Ani Sinha wrote:
> > >
> > >
> > > On Fri, 15 Oct 2021, Eric DeVolder wrote:
> > >
> > > > This change exposes ACPI ERST support for x86 guests.
> > > >
> > > > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
> > > > ---
> > > >   hw/i386/acpi-build.c   | 9 +++++++++
> > > >   hw/i386/acpi-microvm.c | 9 +++++++++
> > > >   include/hw/acpi/erst.h | 5 +++++
> > > >   3 files changed, 23 insertions(+)
> > > >
> > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > > > index 81418b7..9c2f9d9 100644
> > > > --- a/hw/i386/acpi-build.c
> > > > +++ b/hw/i386/acpi-build.c
> > > > @@ -43,6 +43,7 @@
> > > >   #include "sysemu/tpm.h"
> > > >   #include "hw/acpi/tpm.h"
> > > >   #include "hw/acpi/vmgenid.h"
> > > > +#include "hw/acpi/erst.h"
> > > >   #include "sysemu/tpm_backend.h"
> > > >   #include "hw/rtc/mc146818rtc_regs.h"
> > > >   #include "migration/vmstate.h"
> > > > @@ -2499,6 +2500,7 @@ void acpi_build(AcpiBuildTables *tables,
> > > > MachineState *machine)
> > > >       GArray *tables_blob = tables->table_data;
> > > >       AcpiSlicOem slic_oem = { .id = NULL, .table_id = NULL };
> > > >       Object *vmgenid_dev;
> > > > +    Object *erst_dev;
> > > >       char *oem_id;
> > > >       char *oem_table_id;
> > > >
> > > > @@ -2560,6 +2562,13 @@ void acpi_build(AcpiBuildTables *tables,
> > > > MachineState *machine)
> > > >                       ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
> > > >                       x86ms->oem_table_id);
> > > >
> > > > +    erst_dev = find_erst_dev();
> > > > +    if (erst_dev) {
> > > > +        acpi_add_table(table_offsets, tables_blob);
> > > > +        build_erst(tables_blob, tables->linker, erst_dev,
> > > > +                   x86ms->oem_id, x86ms->oem_table_id);
> > > > +    }
> > > > +
> > >
> > > This needs to be ifdef'd between CONFIG_ERST.
> > ok
> >
> > >
> > >
> > > >       vmgenid_dev = find_vmgenid_dev();
> > > >       if (vmgenid_dev) {
> > > >           acpi_add_table(table_offsets, tables_blob);
> > > > diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c
> > >
> > > I do not think we need to include this for microvm machines. They are
> > > supposed to have minimal ACPUI support. So lets not bloat it unless there
> > > is a specific requirement to support ERST on microvms as well.
> > Would it be ok if I ifdef this on CONFIG_ERST also?
> 
> I think we should not touch microvm machine unless you can justify why you
> need ERST support there.

OTOH why not? No idea... CC microvm maintainers and let them decide.

> >
> > >
> > >
> > > > index 196d318..662c8ad 100644
> > > > --- a/hw/i386/acpi-microvm.c
> > > > +++ b/hw/i386/acpi-microvm.c
> > > > @@ -30,6 +30,7 @@
> > > >   #include "hw/acpi/bios-linker-loader.h"
> > > >   #include "hw/acpi/generic_event_device.h"
> > > >   #include "hw/acpi/utils.h"
> > > > +#include "hw/acpi/erst.h"
> > > >   #include "hw/i386/fw_cfg.h"
> > > >   #include "hw/i386/microvm.h"
> > > >   #include "hw/pci/pci.h"
> > > > @@ -158,6 +159,7 @@ static void acpi_build_microvm(AcpiBuildTables
> > > > *tables,
> > > >       X86MachineState *x86ms = X86_MACHINE(mms);
> > > >       GArray *table_offsets;
> > > >       GArray *tables_blob = tables->table_data;
> > > > +    Object *erst_dev;
> > > >       unsigned dsdt, xsdt;
> > > >       AcpiFadtData pmfadt = {
> > > >           /* ACPI 5.0: 4.1 Hardware-Reduced ACPI */
> > > > @@ -207,6 +209,13 @@ static void acpi_build_microvm(AcpiBuildTables
> > > > *tables,
> > > >                       ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
> > > >                       x86ms->oem_table_id);
> > > >
> > > > +    erst_dev = find_erst_dev();
> > > > +    if (erst_dev) {
> > > > +        acpi_add_table(table_offsets, tables_blob);
> > > > +        build_erst(tables_blob, tables->linker, erst_dev,
> > > > +                   x86ms->oem_id, x86ms->oem_table_id);
> > > > +    }
> > > > +
> > >
> > >
> > >
> > > >       xsdt = tables_blob->len;
> > > >       build_xsdt(tables_blob, tables->linker, table_offsets,
> > > > x86ms->oem_id,
> > > >                  x86ms->oem_table_id);
> > > > diff --git a/include/hw/acpi/erst.h b/include/hw/acpi/erst.h
> > > > index 9d63717..b747fe7 100644
> > > > --- a/include/hw/acpi/erst.h
> > > > +++ b/include/hw/acpi/erst.h
> > > > @@ -16,4 +16,9 @@ void build_erst(GArray *table_data, BIOSLinker *linker,
> > > > Object *erst_dev,
> > > >
> > > >   #define TYPE_ACPI_ERST "acpi-erst"
> > > >
> > > > +/* returns NULL unless there is exactly one device */
> > > > +static inline Object *find_erst_dev(void)
> > > > +{
> > > > +    return object_resolve_path_type("", TYPE_ACPI_ERST, NULL);
> > > > +}
> > > >   #endif
> > > > --
> > > > 1.8.3.1
> > > >
> > > >
> >



  reply	other threads:[~2021-10-23 20:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 19:02 [PATCH v8 00/10] acpi: Error Record Serialization Table, ERST, support for QEMU Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 01/10] ACPI ERST: bios-tables-test.c steps 1 and 2 Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 02/10] ACPI ERST: specification for ERST support Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 03/10] ACPI ERST: PCI device_id for ERST Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 04/10] ACPI ERST: header file " Eric DeVolder
2021-10-22 10:25   ` Ani Sinha
2021-10-15 19:02 ` [PATCH v8 05/10] ACPI ERST: support for ACPI ERST feature Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 06/10] ACPI ERST: build the ACPI ERST table Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 07/10] ACPI ERST: create ACPI ERST table for pc/x86 machines Eric DeVolder
2021-10-22 10:18   ` Ani Sinha
2021-10-22 18:21     ` Eric DeVolder
2021-10-23  2:22       ` Ani Sinha
2021-10-23 20:14         ` Michael S. Tsirkin [this message]
2021-10-24  1:13           ` Boris Ostrovsky
2021-10-15 19:02 ` [PATCH v8 08/10] ACPI ERST: qtest for ERST Eric DeVolder
2021-10-15 19:02 ` [PATCH v8 09/10] ACPI ERST: bios-tables-test testcase Eric DeVolder
2021-10-15 19:03 ` [PATCH v8 10/10] ACPI ERST: step 6 of bios-tables-test.c Eric DeVolder
2021-10-19 14:58   ` Ani Sinha
2021-10-19 22:32     ` Eric DeVolder
2021-10-19 12:00 ` [PATCH v8 00/10] acpi: Error Record Serialization Table, ERST, support for QEMU Ani Sinha
2021-10-19 12:24   ` Ani Sinha

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=20211023161237-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ehabkost@redhat.com \
    --cc=eric.devolder@oracle.com \
    --cc=imammedo@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).