qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eric DeVolder <eric.devolder@oracle.com>
Cc: "ehabkost@redhat.com" <ehabkost@redhat.com>,
	Konrad Wilk <konrad.wilk@oracle.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"jusual@redhat.com" <jusual@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [PATCH v2 3/7] ACPI ERST: support for ACPI ERST feature
Date: Mon, 3 May 2021 19:07:34 +0200	[thread overview]
Message-ID: <20210503190734.12e4c1ac@redhat.com> (raw)
In-Reply-To: <CO1PR10MB4531ACA8EFC99E57809E1499975B9@CO1PR10MB4531.namprd10.prod.outlook.com>

On Mon, 3 May 2021 15:49:28 +0000
Eric DeVolder <eric.devolder@oracle.com> wrote:

> Igor,
> I've rebased the original patches on to qemu-v6.0.0-rc4, and finally have everything working as it previously did.
> I've started now to work to incorporate the HostMemoryBackendFile; that is progressing.
> My question for you today is with regard to placing ERST device on PCI. The PCI example provided is a template device, and while I do find that helpful, I still do not understand how the ERST Actions, which contain GAS for describing the register accesses, would be patched/linked when a PCI bar is assigned. Or is there perhaps another way of obtaining the PCI BAR using ACPI semantics?

current order of initialization is,
 0. QEMU builds initial ACPI tables (unpatched, mainly used to gauge total size of ACPI tables) and starts guest
 1. guest firmware initializes PCI devices (including BARs)
 2. guest reads ACPI tables from QEMU(via fwcfg)
 2.1 reading ACPI tables traps into QEMU and QEMU rebuilds all ACPI tables (including ERST)
      at this time one can get info from PCI devices (probably pci_get_bar_addr() is what you are looking for)
      that were initialized by firmware and build tables using address.
      Maybe it will need dynamic tables patching but lets get to that only if rebuilding table won't be enough
        
        

> Thanks,
> eric
> 
> ________________________________
> From: Igor Mammedov <imammedo@redhat.com>
> Sent: Wednesday, April 14, 2021 4:17 AM
> To: Eric DeVolder <eric.devolder@oracle.com>
> Cc: ehabkost@redhat.com <ehabkost@redhat.com>; mst@redhat.com <mst@redhat.com>; Konrad Wilk <konrad.wilk@oracle.com>; qemu-devel@nongnu.org <qemu-devel@nongnu.org>; pbonzini@redhat.com <pbonzini@redhat.com>; Boris Ostrovsky <boris.ostrovsky@oracle.com>; rth@twiddle.net <rth@twiddle.net>; jusual@redhat.com <jusual@redhat.com>
> Subject: Re: [PATCH v2 3/7] ACPI ERST: support for ACPI ERST feature
> 
> On Fri, 9 Apr 2021 15:54:47 +0000
> Eric DeVolder <eric.devolder@oracle.com> wrote:
> 
> > Hi Igor,
> > Thank you for reviewing. I've responded inline below.
> > eric
> >
> > ________________________________
> > From: Igor Mammedov <imammedo@redhat.com>
> > Sent: Tuesday, April 6, 2021 2:31 PM
> > To: Eric DeVolder <eric.devolder@oracle.com>
> > Cc: mst@redhat.com <mst@redhat.com>; marcel.apfelbaum@gmail.com <marcel.apfelbaum@gmail.com>; pbonzini@redhat.com <pbonzini@redhat.com>; rth@twiddle.net <rth@twiddle.net>; ehabkost@redhat.com <ehabkost@redhat.com>; qemu-devel@nongnu.org <qemu-devel@nongnu.org>; Boris Ostrovsky <boris.ostrovsky@oracle.com>; kwilk@oracle.com <kwilk@oracle.com>
> > Subject: Re: [PATCH v2 3/7] ACPI ERST: support for ACPI ERST feature
> >
> > On Mon,  8 Feb 2021 15:57:55 -0500
> > Eric DeVolder <eric.devolder@oracle.com> wrote:
> >  
> > > This change implements the support for the ACPI ERST feature[1,2].
> > >
> > > The size of the ACPI ERST storage is declared via the QEMU
> > > global parameter acpi-erst.size. The size can range from 64KiB
> > > to to 64MiB. The default is 64KiB.
> > >
> > > The location of the ACPI ERST storage backing file is delared
> > > via the QEMU global parameter acpi-erst.filename. The default
> > > is acpi-erst.backing.
> > >
> > > [1] "Advanced Configuration and Power Interface Specification",
> > >     version 6.2, May 2017.
> > >     https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf
> > >
> > > [2] "Unified Extensible Firmware Interface Specification",
> > >     version 2.8, March 2019.
> > >     https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
> > >
> > > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>  
> >
> > items 2/4/5 from v1 review still need to be addressed.
> >  
> > >
> > > 2. patch is too big to review, please split it up in smaller chunks.
> > >
> > > EJD: Done.  
> >
> > (separating a header and a makefile rule doesn't make much sense)
> >
> > it should be split at least on part that implements device model and ACPI parts
> >
> > EJD: I'll rebase this patch set on qemu-6 and accommodate your suggestions with how to split/organize the patch set.
> >
> > [...]  
> > >
> > > 4. Maybe instead of SYSBUS device, implement it as a PCI device and
> > >    use its BAR/control registers for pstore storage and control interface.
> > >    It could save you headache of picking address where to map it +
> > >    it would take care of migration part automatically, as firmware
> > >    would do it for you and then QEMU could pickup firmware programmed
> > >    address and put it into ERST table.
> > > EJD: Thanks for the idea. For now I've left it as a SYSBUS device; we can revisit as needed.  
> >
> > I would really prefer to see a PCI version (current way is just a hack)
> >
> > EJD: I understand, I don't like the base address problem either. Is there an example PCI device that gets its base address assigned during ACPI setup that I could reference and pattern this work after? I've been using SYSBUS as that most closely mimics the real hardware implementations I've studied in order to produce this code.
> > EJD: I thought my inexperience with authoring QEMU devices was the primary problem in establishing a solution for the base address. Otherwise, this thing only needs a single 4KiB page (for the 2 registers + exchange buffer) exposed.  
> 
> I don't recall if we merged example PCI device in QEMU, but someone worked on it before.
> Google search yields following:
>  https://github.com/grandemk/qemu_devices/commit/ba8d38a858ba63ef4d419a926f58328b9675fc98
> 
> 
> > > 5. instead of dealing with file for storage directly, reuse hostmem backend
> > >    to provide it to for your device. ex: pc-dimm. i.e. split device
> > >    on frontend and backend
> > >
> > > EJD: I had looked into that prior to posting v1. The entire ERST storage is not memory mapped, just an exchange buffer. So the hostmem backend is not suitable for this purpose.  
> >
> > Is there a compelling reason why it can't be memory mapped?
> >
> > EJD: Well, this ERST device I've coded pretty much follows the ACPI ERST spec verbatim. As it stands today, the spec doesn't provide a way to report the total size of the persistent storage behind the interface; you know when storage is full only when you receive an Out Of Storage error code upon write. In a sense, that allows the size of the storage to vary greatly and be implemented in any way needed (ie actual hardware, this has tended to be in the 64KiB range when it is carved out of system parallel flash memory, but some hardware uses serial flash as well). In virtual environments, it can be of any size, and we at Oracle have intentions of heavily utilizing ACPI ERST to stuff all kinds of diagnostic information into it, thus wanting the storage to be very large. By not actually exposing/memory-mapping the storage, the issue of where to drop it in the memory map goes away (yes a PCI BAR could solve this).
> > EJD: But at the end of the day, could this storage be memory mapped? I suppose it could be, but then that rather circumvents the entire need for the ACPI ERST interface to start with. Linux and Windows both already know how to utilize ACPI ERST.  
> 
> Maybe I wasn't clear on it, I did not propose to map storage into guest.
> Only use MemoryRegion provided by backend inside of your device.
> This way you can drop all file related code from your patch,
> and just work with read/store info from/to memory directly.
> 
> [...]
> 



  reply	other threads:[~2021-05-03 17:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 20:57 [PATCH v2 0/7] acpi: Error Record Serialization Table, ERST, support for QEMU Eric DeVolder
2021-02-08 20:57 ` [PATCH v2 1/7] ACPI ERST: bios-tables-test.c steps 1 and 2 Eric DeVolder
2021-02-08 20:57 ` [PATCH v2 2/7] ACPI ERST: header file for erst Eric DeVolder
2021-02-08 20:57 ` [PATCH v2 3/7] ACPI ERST: support for ACPI ERST feature Eric DeVolder
2021-04-06 19:31   ` Igor Mammedov
2021-04-09 15:54     ` Eric DeVolder
2021-04-14  9:17       ` Igor Mammedov
2021-05-03 15:49         ` Eric DeVolder
2021-05-03 17:07           ` Igor Mammedov [this message]
2021-05-17 15:01             ` Eric DeVolder
2021-05-17 16:31               ` Igor Mammedov
2021-05-18 17:08                 ` Eric DeVolder
2021-05-20 11:00                   ` Igor Mammedov
2021-05-25 20:22                     ` Eric DeVolder
2021-05-25 21:43                       ` Igor Mammedov
2021-02-08 20:57 ` [PATCH v2 4/7] ACPI ERST: build step for ACPI ERST Eric DeVolder
2021-04-06 19:17   ` Igor Mammedov
2021-02-08 20:57 ` [PATCH v2 5/7] ACPI ERST: support ERST for x86 guest Eric DeVolder
2021-02-08 20:57 ` [PATCH v2 6/7] ACPI ERST: qtest for ERST Eric DeVolder
2021-02-08 20:57 ` [PATCH v2 7/7] ACPI ERST: bios-tables-test.c step 5 Eric DeVolder
2021-03-01 19:04 ` [PATCH v2 0/7] acpi: Error Record Serialization Table, ERST, support for QEMU Eric Devolder
2021-04-01 13:44   ` Michael S. Tsirkin
2021-05-14 13:57 ` Michael S. Tsirkin
2021-05-14 14:12   ` Eric DeVolder

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=20210503190734.12e4c1ac@redhat.com \
    --to=imammedo@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ehabkost@redhat.com \
    --cc=eric.devolder@oracle.com \
    --cc=jusual@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=mst@redhat.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).