All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: 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>,
	"Michael S. Tsirkin" <mst@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: Thu, 12 Oct 2017 17:45:39 +0200	[thread overview]
Message-ID: <f6478644-0d4a-6531-9016-aee2a0e76417@redhat.com> (raw)
In-Reply-To: <20171012124544.dq3wyr65tefi3glk@hz-desktop>

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.

Paolo

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: 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>,
	"Michael S. Tsirkin" <mst@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: Thu, 12 Oct 2017 17:45:39 +0200	[thread overview]
Message-ID: <f6478644-0d4a-6531-9016-aee2a0e76417@redhat.com> (raw)
In-Reply-To: <20171012124544.dq3wyr65tefi3glk@hz-desktop>

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.

Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-12 15:45 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11  4:37 [RFC XEN PATCH v3 00/39] Add vNVDIMM support to HVM domains Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 01/39] x86_64/mm: fix the PDX group check in mem_hotadd_check() Haozhong Zhang
2017-10-27  6:49   ` Chao Peng
2017-10-27  7:02     ` Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 02/39] x86_64/mm: drop redundant MFN to page conventions in cleanup_frame_table() Haozhong Zhang
2017-10-27  6:58   ` Chao Peng
2017-10-27  9:24     ` Andrew Cooper
2017-10-30  2:21       ` Chao Peng
2017-09-11  4:37 ` [RFC XEN PATCH v3 03/39] x86_64/mm: avoid cleaning the unmapped frame table Haozhong Zhang
2017-10-27  8:10   ` Chao Peng
2017-09-11  4:37 ` [RFC XEN PATCH v3 04/39] xen/common: add Kconfig item for pmem support Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 05/39] x86/mm: exclude PMEM regions from initial frametable Haozhong Zhang
2017-11-03  5:58   ` Chao Peng
2017-11-03  6:39     ` Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 06/39] acpi: probe valid PMEM regions via NFIT Haozhong Zhang
2017-11-03  6:15   ` Chao Peng
2017-11-03  7:14     ` Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 07/39] xen/pmem: register valid PMEM regions to Xen hypervisor Haozhong Zhang
2017-11-03  6:26   ` Chao Peng
2017-09-11  4:37 ` [RFC XEN PATCH v3 08/39] xen/pmem: hide NFIT and deny access to PMEM from Dom0 Haozhong Zhang
2017-11-03  6:51   ` Chao Peng
2017-11-03  7:24     ` Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 09/39] xen/pmem: add framework for hypercall XEN_SYSCTL_nvdimm_op Haozhong Zhang
2017-11-03  7:40   ` Chao Peng
2017-11-03  8:54     ` Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 10/39] xen/pmem: add XEN_SYSCTL_nvdimm_pmem_get_rgions_nr Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 11/39] xen/pmem: add XEN_SYSCTL_nvdimm_pmem_get_regions Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 12/39] tools/xen-ndctl: add NVDIMM management util 'xen-ndctl' Haozhong Zhang
2017-09-11  5:10   ` Dan Williams
2017-09-11  5:39     ` Haozhong Zhang
2017-09-11 16:35       ` Dan Williams
2017-09-11 21:24         ` Konrad Rzeszutek Wilk
2017-09-13 17:45           ` Dan Williams
2017-09-11  4:37 ` [RFC XEN PATCH v3 13/39] tools/xen-ndctl: add command 'list' Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 14/39] x86_64/mm: refactor memory_add() Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 15/39] x86_64/mm: allow customized location of extended frametable and M2P table Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 16/39] xen/pmem: add XEN_SYSCTL_nvdimm_pmem_setup to setup management PMEM region Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 17/39] tools/xen-ndctl: add command 'setup-mgmt' Haozhong Zhang
2017-09-11  4:37 ` [RFC XEN PATCH v3 18/39] xen/pmem: support PMEM_REGION_TYPE_MGMT for XEN_SYSCTL_nvdimm_pmem_get_regions_nr Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 19/39] xen/pmem: support PMEM_REGION_TYPE_MGMT for XEN_SYSCTL_nvdimm_pmem_get_regions Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 20/39] tools/xen-ndctl: add option '--mgmt' to command 'list' Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 21/39] xen/pmem: support setup PMEM region for guest data usage Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 22/39] tools/xen-ndctl: add command 'setup-data' Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 23/39] xen/pmem: support PMEM_REGION_TYPE_DATA for XEN_SYSCTL_nvdimm_pmem_get_regions_nr Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 24/39] xen/pmem: support PMEM_REGION_TYPE_DATA for XEN_SYSCTL_nvdimm_pmem_get_regions Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 25/39] tools/xen-ndctl: add option '--data' to command 'list' Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 26/39] xen/pmem: add function to map PMEM pages to HVM domain Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 27/39] xen/pmem: release PMEM pages on HVM domain destruction Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 28/39] xen: add hypercall XENMEM_populate_pmem_map Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 29/39] tools: reserve guest memory for ACPI from device model Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 30/39] tools/libacpi: expose the minimum alignment used by mem_ops.alloc Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 31/39] tools/libacpi: add callback to translate GPA to GVA Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 32/39] tools/libacpi: add callbacks to access XenStore Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 33/39] tools/libacpi: add a simple AML builder Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 34/39] tools/libacpi: add DM ACPI blacklists Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 35/39] tools/libacpi: load ACPI built by the device model Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 36/39] tools/xl: add xl domain configuration for virtual NVDIMM devices Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 37/39] tools/libxl: allow aborting domain creation on fatal QMP init errors Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 38/39] tools/libxl: initiate PMEM mapping via QMP callback Haozhong Zhang
2017-09-11  4:38 ` [RFC XEN PATCH v3 39/39] tools/libxl: build qemu options from xl vNVDIMM configs Haozhong Zhang
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   ` 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     ` 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     ` 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     ` 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     ` 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     ` 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     ` 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     ` 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     ` 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     ` 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:41     ` 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  4:53     ` no-reply
2017-09-11 14:08   ` Igor Mammedov
2017-09-11 14:08     ` Igor Mammedov
2017-09-11 18:52     ` [Qemu-devel] " Stefano Stabellini
2017-09-11 18:52       ` Stefano Stabellini
2017-09-12  3:15       ` [Qemu-devel] " Haozhong Zhang
2017-09-12  3:15         ` Haozhong Zhang
2017-10-10 16:05         ` [Qemu-devel] " Konrad Rzeszutek Wilk
2017-10-10 16:05           ` Konrad Rzeszutek Wilk
2017-10-12 12:45           ` [Qemu-devel] " Haozhong Zhang
2017-10-12 12:45             ` Haozhong Zhang
2017-10-12 15:45             ` Paolo Bonzini [this message]
2017-10-12 15:45               ` Paolo Bonzini
2017-10-13  7:53               ` Haozhong Zhang
2017-10-13  7:53                 ` Haozhong Zhang
2017-10-13  8:44                 ` Igor Mammedov
2017-10-13  8:44                   ` Igor Mammedov
2017-10-13 11:13                   ` Haozhong Zhang
2017-10-13 11:13                     ` Haozhong Zhang
2017-10-13 12:13                     ` Jan Beulich
2017-10-13 12:13                       ` Jan Beulich
2017-10-13 22:46                       ` Stefano Stabellini
2017-10-13 22:46                         ` Stefano Stabellini
2017-10-15  0:31                         ` Michael S. Tsirkin
2017-10-15  0:31                           ` Michael S. Tsirkin
2017-10-16 14:49                           ` [Qemu-devel] [Xen-devel] " Konrad Rzeszutek Wilk
2017-10-16 14:49                             ` [Qemu-devel] " Konrad Rzeszutek Wilk
2017-10-17 11:45                         ` Paolo Bonzini
2017-10-17 11:45                           ` Paolo Bonzini
2017-10-17 12:16                           ` Haozhong Zhang
2017-10-17 12:16                             ` Haozhong Zhang
2017-10-18  8:32                             ` [Qemu-devel] [Xen-devel] " Roger Pau Monné
2017-10-18  8:32                               ` [Qemu-devel] " Roger Pau Monné
2017-10-18  8:46                               ` [Qemu-devel] [Xen-devel] " Paolo Bonzini
2017-10-18  8:46                                 ` [Qemu-devel] " Paolo Bonzini
2017-10-18  8:55                                 ` [Qemu-devel] [Xen-devel] " Roger Pau Monné
2017-10-18  8:55                                   ` [Qemu-devel] " Roger Pau Monné
2017-10-15  0:35                 ` Michael S. Tsirkin
2017-10-15  0:35                   ` Michael S. Tsirkin
2017-10-12 17:39             ` Konrad Rzeszutek Wilk
2017-10-12 17:39               ` Konrad Rzeszutek Wilk
2017-10-13  8:00               ` Haozhong Zhang
2017-10-13  8:00                 ` Haozhong Zhang
2017-10-27  3:26 ` [RFC XEN PATCH v3 00/39] Add vNVDIMM support to HVM domains Chao Peng
2017-10-27  4:25   ` 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=f6478644-0d4a-6531-9016-aee2a0e76417@redhat.com \
    --to=pbonzini@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=mst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.