qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Igor Mammedov <imammedo@redhat.com>,
	qemu-devel@nongnu.org, xen-devel@lists.xen.org,
	Dan Williams <dan.j.williams@intel.com>,
	Chao Peng <chao.p.peng@linux.intel.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Anthony Perard <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com,
	wei.liu2@citrix.com, george.dunlap@citrix.com, JBeulich@suse.com,
	andrew.cooper3@citrix.com
Subject: Re: [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest
Date: Sun, 15 Oct 2017 03:35:43 +0300	[thread overview]
Message-ID: <20171015033133-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20171013075326.77azyi4j2wo3b2fx@hz-desktop>

On Fri, Oct 13, 2017 at 03:53:26PM +0800, Haozhong Zhang wrote:
> On 10/12/17 17:45 +0200, Paolo Bonzini wrote:
> > On 12/10/2017 14:45, Haozhong Zhang wrote:
> > > Basically, QEMU builds two ROMs for guest, /rom@etc/acpi/tables and
> > > /rom@etc/table-loader. The former is unstructured to guest, and
> > > contains all data of guest ACPI. The latter is a BIOSLinkerLoader
> > > organized as a set of commands, which direct the guest (e.g., SeaBIOS
> > > on KVM/QEMU) to relocate data in the former file, recalculate checksum
> > > of specified area, and fill guest address in specified ACPI field.
> > > 
> > > One part of my patches is to implement a mechanism to tell Xen which
> > > part of ACPI data is a table (NFIT), and which part defines a
> > > namespace device and what the device name is. I can add two new loader
> > > commands for them respectively.
> > > 
> > > Because they just provide information and SeaBIOS in non-xen
> > > environment ignores unrecognized commands, they will not break SeaBIOS
> > > in non-xen environment.
> > > 
> > > On QEMU side, most Xen-specific hacks in ACPI builder could be
> > > dropped, and replaced by adding the new loader commands (though they
> > > may be used only by Xen).
> > > 
> > > On Xen side, a fw_cfg driver and a BIOSLinkerLoader command executor
> > > are needed in, perhaps, hvmloader.
> > 
> > If Xen has to parse BIOSLinkerLoader, it can use the existing commands
> > to process a reduced set of ACPI tables.  In other words,
> > etc/acpi/tables would only include the NFIT, the SSDT with namespace
> > devices, and the XSDT.  etc/acpi/rsdp would include the RSDP table as usual.
> >
> > hvmloader can then:
> > 
> > 1) allocate some memory for where the XSDT will go
> > 
> > 2) process the BIOSLinkerLoader like SeaBIOS would do
> > 
> > 3) find the RSDP in low memory, since the loader script must have placed
> > it there.  If it cannot find it, allocate some low memory, fill it with
> > the RSDP header and revision, and and jump to step 6
> > 
> > 4) If it found QEMU's RSDP, use it to find QEMU's XSDT
> > 
> > 5) Copy ACPI table pointers from QEMU to hvmloader's RSDT and/or XSDT.
> > 
> > 6) build hvmloader tables and link them into the RSDT and/or XSDT as usual.
> > 
> > 7) overwrite the RSDP in low memory with a pointer to hvmloader's own
> > RSDT and/or XSDT, and updated the checksums
> > 
> > QEMU's XSDT remains there somewhere in memory, unused but harmless.
> > 
> 
> It can work for plan tables which do not contain AML.
> 
> However, for a namespace device, Xen needs to know its name in order
> to detect the potential name conflict with those used in Xen built
> ACPI. Xen does not (and is not going to) introduce an AML parser, so
> it cannot get those device names from QEMU built ACPI by its own.
> 
> The idea of either this patch series or the new BIOSLinkerLoader
> command is to let QEMU tell Xen where the definition body of a
> namespace device (i.e. that part within the outmost "Device(NAME)") is
> and what the device name is. Xen, after the name conflict check, can
> re-package the definition body in a namespace device (w/ minimal AML
> builder code added in Xen) and then in SSDT.
> 
> 
> Haozhong

You most likely can do this without a new command.
You can use something similiar to build_append_named_dword
in combination with BIOS_LINKER_LOADER_COMMAND_ADD_POINTER
like vm gen id does.

-- 
MST

  parent reply	other threads:[~2017-10-15  0:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170911043820.14617-1-haozhong.zhang@intel.com>
2017-09-11  4:41 ` [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 01/10] nvdimm: do not intiailize nvdimm->label_data if label size is zero Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 02/10] hw/xen-hvm: create the hotplug memory region on Xen Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 03/10] hostmem-xen: add a host memory backend for Xen Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 04/10] nvdimm acpi: do not use fw_cfg on Xen Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 05/10] hw/xen-hvm: initialize DM ACPI Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 06/10] hw/xen-hvm: add function to copy ACPI into guest memory Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 07/10] nvdimm acpi: copy NFIT to Xen guest Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 08/10] nvdimm acpi: copy ACPI namespace device of vNVDIMM " Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 09/10] nvdimm acpi: do not build _FIT method on Xen Haozhong Zhang
2017-09-11  4:41   ` [Qemu-devel] [RFC QEMU PATCH v3 10/10] hw/xen-hvm: enable building DM ACPI if vNVDIMM is enabled Haozhong Zhang
2017-09-11  4:53   ` [Qemu-devel] [RFC QEMU PATCH v3 00/10] Implement vNVDIMM for Xen HVM guest no-reply
2017-09-11 14:08   ` Igor Mammedov
2017-09-11 18:52     ` Stefano Stabellini
2017-09-12  3:15       ` Haozhong Zhang
2017-10-10 16:05         ` Konrad Rzeszutek Wilk
2017-10-12 12:45           ` Haozhong Zhang
2017-10-12 15:45             ` Paolo Bonzini
2017-10-13  7:53               ` Haozhong Zhang
2017-10-13  8:44                 ` Igor Mammedov
2017-10-13 11:13                   ` Haozhong Zhang
2017-10-13 12:13                     ` Jan Beulich
2017-10-13 22:46                       ` Stefano Stabellini
2017-10-15  0:31                         ` Michael S. Tsirkin
2017-10-16 14:49                           ` [Qemu-devel] [Xen-devel] " Konrad Rzeszutek Wilk
2017-10-17 11:45                         ` [Qemu-devel] " Paolo Bonzini
2017-10-17 12:16                           ` Haozhong Zhang
2017-10-18  8:32                             ` [Qemu-devel] [Xen-devel] " Roger Pau Monné
2017-10-18  8:46                               ` Paolo Bonzini
2017-10-18  8:55                                 ` Roger Pau Monné
2017-10-15  0:35                 ` Michael S. Tsirkin [this message]
2017-10-12 17:39             ` [Qemu-devel] " Konrad Rzeszutek Wilk
2017-10-13  8:00               ` Haozhong Zhang

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=20171015033133-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ehabkost@redhat.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=imammedo@redhat.com \
    --cc=konrad.wilk@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xiaoguangrong.eric@gmail.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).