From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Jan Beulich <JBeulich@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 14/14] xen/x86: setup PVHv2 Dom0 ACPI tables
Date: Fri, 23 Dec 2016 10:21:39 -0500 [thread overview]
Message-ID: <20161223152139.GM20310@char.us.oracle.com> (raw)
In-Reply-To: <20161223102746.akmluikaokjoyovh@dhcp-3-221.uk.xensource.com>
On Fri, Dec 23, 2016 at 10:27:46AM +0000, Roger Pau Monne wrote:
> On Thu, Dec 22, 2016 at 01:19:36PM -0500, Boris Ostrovsky wrote:
> > On 12/22/2016 11:44 AM, Roger Pau Monne wrote:
> > > On Thu, Dec 22, 2016 at 09:24:02AM -0700, Jan Beulich wrote:
> > >>>>> On 22.12.16 at 17:17, <boris.ostrovsky@oracle.com> wrote:
> > >>> On 12/22/2016 07:17 AM, Roger Pau Monne wrote:
> > >>>> Maybe Boris has some ideas about how to do CPU hotplug for Dom0?
> > >>> Why would Xen need to be able to parse the AML that is intended to be
> > >>> executed by dom0? I'd think that all the hypervisor would need to do is
> > >>> to load it into memory, not any different from how it's done for regular
> > >>> guests.
> > >> Well, if Dom0 executed the unmodified _MAT, it would get back
> > >> data relating to the physical CPU. Roger is overriding MADT to
> > >> present virtual CPU information to Dom0, and this would likewise
> > >> need to happen for the _MAT return value.
> >
> > By "unmodified _MAT" you mean system's _MAT? Why can't we provide our
> > own that will return _MAT object properly adjusted for dom0? We are
> > going to provide our own (i.e. not system's) DSDT, aren't we?
>
> Providing Dom0 with a different DSDT is almost impossible from a Xen PoV, for
> once Xen cannot parse the original DSDT (because it's a dynamic table), and
> then if we would be to provide a modified DSDT, we would also need an asl
> assembler, so that we could parse the DSDT, modify it, and then compile it
> again in order to provide it to Dom0.
>
> Although all this code could be put under an init section that would be freed
> after Dom0 creation it seems overkill and very far from trivial, not to mention
> that I'm not even sure what side-effects there would be if Xen parsed the DSDT
> itself without having any drivers.
>
> > > This is one of the problems with this Dom/Xen0 split brain problem that we
> > > have, and cannot get away from.
> > >
> > > To clarify a little bit, I'm not overwriting the original MADT in memory, so
> > > Dom0 should still be able to access it if the implementation of _MAT returns
> > > data from that area. AFAICT when plugging in a physical CPU (pCPU) into the
> > > hardware, Dom0 should see "correct" data returned by the _MAT method. However
> > > (as represented by the " I've used), this data will not match Dom0 vCPU
> > > topology, and should not be used by Dom0 (only reported to Xen in order to
> > > bring up the new pCPU).
> >
> > So the problem seems to be that we need to run both _MATs --- system's
> > and dom0's.
>
> Exactly, we need _MAT for pCPUs and _MAT for _vCPUs.
>
> > > Then the problem arises because we have no way to perform vCPU hotplug for
> > > Dom0, not at least as it is done for DomU (using ACPI), so we would have to use
> > > an out-of-band method in order to do vCPU hotplug for Dom0, which is a PITA.
> >
> >
> > I would very much like to avoid this.
>
> Maybe we can provide an extra SSDT for Dom0 that basically overwrites the CPU
> objects (_PR.CPUX), but I'm not sure if ACPI allows this kind of objects
> overwrites?
>
> After reading the spec, I came across the following note in the SSDT section:
>
> "Additional tables can only add data; they cannot overwrite data from previous
> tables."
>
> So I guess this is a no-go.
>
> I only see the following options:
>
> - Prevent Dom0 from using the original _MAT methods (or even the full _PR.CPU
> objects) using the STAO, and then provide Dom0 with an out-of-band method
> (ie: not ACPI) in order to do CPU hotplug.
>
> - Expand the STAO so that it can be used to override ACPI namespace objects,
> possibly by adding a payload field that contains aml code. It seems that
> Linux already supports overwriting part of the ACPI namespace from
> user-space[0], so part of the needed machinery seem to be already in place
> (hopefully in acpica code?).
>
> - Disable the native CPU objects in the DSDT/SSDT using the STAO. Then pick up
> unused ACPI CPU IDs and use those for vCPUs. Provide an additional SSDT that
You need those so that the C and P state parser can actually parse the other
CPU states which it will upload to Xen.
> contains ACPI objects for those vCPUs (as is done for DomU). This means we
> would probably have to start using x2APIC entries in the MADT, since the
> CPUs IDs might easily expand past 255 (AFAICT we could still keep the APIC
> IDs low however, since those two are disjoint).
>
- Import ACPI AML parser in Xen. <mad laughter>
> I don't really fancy any of these two options, probably the last one seems like
> the best IMHO, but I would like to hear some feedback about them, and of course
> I'm open to suggestions :).
- Do the same thing we had been doing with Xen and Linux PV. Expose the full
machine MADT and then massage it. Yuck.
I am full of bad ideas today.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-23 15:21 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 16:49 [PATCH v4 00/14] Initial PVHv2 Dom0 support Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 01/14] xen/x86: remove XENFEAT_hvm_pirqs for PVHv2 guests Roger Pau Monne
2016-12-08 16:21 ` Jan Beulich
2016-12-16 11:24 ` Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 02/14] xen/x86: fix return value of *_set_allocation functions Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 03/14] xen/x86: allow calling {shadow/hap}_set_allocation with the idle domain Roger Pau Monne
2016-12-01 11:25 ` Tim Deegan
2016-11-30 16:49 ` [PATCH v4 04/14] x86/paging: introduce paging_set_allocation Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 05/14] xen/x86: split the setup of Dom0 permissions to a function Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 06/14] x86/vtd: refuse to enable IOMMU if the PCI scan fails Roger Pau Monne
2016-12-01 0:29 ` Tian, Kevin
2016-11-30 16:49 ` [PATCH v4 07/14] x86/iommu: add IOMMU entries for p2m_mmio_direct pages Roger Pau Monne
2016-12-08 16:24 ` Jan Beulich
2016-12-16 14:01 ` Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 08/14] xen/x86: allow the emulated APICs to be enabled for the hardware domain Roger Pau Monne
2016-12-08 16:29 ` Jan Beulich
2016-11-30 16:49 ` [PATCH v4 09/14] xen/x86: split Dom0 build into PV and PVHv2 Roger Pau Monne
2016-12-09 16:07 ` Jan Beulich
2016-12-16 14:28 ` Roger Pau Monne
2016-12-16 14:45 ` Roger Pau Monne
2016-12-16 16:17 ` Jan Beulich
2016-12-16 17:57 ` Roger Pau Monne
2016-12-19 7:42 ` Jan Beulich
2016-12-16 15:28 ` Roger Pau Monne
2016-12-16 16:15 ` Jan Beulich
2016-12-16 16:18 ` Jan Beulich
2016-12-16 17:42 ` Roger Pau Monne
2016-12-19 7:41 ` Jan Beulich
2016-11-30 16:49 ` [PATCH v4 10/14] xen/x86: populate PVHv2 Dom0 physical memory map Roger Pau Monne
2016-12-09 16:48 ` Jan Beulich
2016-12-16 17:38 ` Roger Pau Monne
2016-12-19 7:48 ` Jan Beulich
2016-11-30 16:49 ` [PATCH v4 11/14] xen/x86: parse Dom0 kernel for PVHv2 Roger Pau Monne
2016-12-09 17:05 ` Jan Beulich
2016-12-20 17:34 ` Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 12/14] x86/PVHv2: fix dom0_max_vcpus so it's capped to 128 for PVHv2 Dom0 Roger Pau Monne
2016-12-09 17:09 ` Jan Beulich
2016-11-30 16:49 ` [PATCH v4 13/14] xen/x86: hack to setup PVHv2 Dom0 CPUs Roger Pau Monne
2016-11-30 16:49 ` [PATCH v4 14/14] xen/x86: setup PVHv2 Dom0 ACPI tables Roger Pau Monne
2016-12-12 13:56 ` Jan Beulich
2016-12-21 16:32 ` Roger Pau Monne
2016-12-21 17:04 ` Jan Beulich
2016-12-22 10:43 ` Roger Pau Monne
2016-12-22 11:03 ` Jan Beulich
2016-12-22 12:17 ` Roger Pau Monne
2016-12-22 16:17 ` Boris Ostrovsky
2016-12-22 16:24 ` Jan Beulich
2016-12-22 16:44 ` Roger Pau Monne
2016-12-22 18:19 ` Boris Ostrovsky
2016-12-23 10:27 ` Roger Pau Monne
2016-12-23 15:13 ` Boris Ostrovsky
2016-12-23 15:31 ` Konrad Rzeszutek Wilk
2016-12-23 15:35 ` Boris Ostrovsky
2016-12-23 16:02 ` Konrad Rzeszutek Wilk
2016-12-23 17:13 ` Boris Ostrovsky
2017-01-03 15:55 ` Roger Pau Monne
2017-01-03 19:13 ` Boris Ostrovsky
2016-12-23 15:21 ` Konrad Rzeszutek Wilk [this message]
2017-01-03 7:53 ` Jan Beulich
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=20161223152139.GM20310@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).