[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 9/9] xen/x86: setup PVHv2 Dom0 ACPI tables



On Wed, Feb 08, 2017 at 08:50:54AM -0700, Jan Beulich wrote:
> >>> On 08.02.17 at 16:10, <roger.pau@xxxxxxxxxx> wrote:
> > On Thu, Jan 26, 2017 at 07:16:32AM -0700, Jan Beulich wrote:
> >> >>> On 19.01.17 at 18:29, <roger.pau@xxxxxxxxxx> wrote:
> >> > +    /*
> >> > +     * The APIC ID field of the local APIC struct is only 1byte, so we 
> >> > need
> >> > +     * to limit the number of local APIC entries to 128 because we only 
> >> > use
> >> > +     * even numbers as APIC IDs.
> >> > +     */
> >> > +    size += sizeof(*local_apic) *
> >> > +            min(max_vcpus, 1U << (sizeof(local_apic->id) * 8));
> >> 
> >> This caps at 256 now. Perhaps it would anyway be better to use
> >> HVM_MAX_VCPUS here, or maybe the minimum of both?
> > 
> > max_vcpus is already capped to HVM_MAX_VCPUS.
> 
> Is it? I see a use of that symbol only in mk_dsdt.c.

It's introduced in a patch of this series, see "x86/PVHv2: fix dom0_max_vcpus
so it's capped to 128 for PVHv2 Dom0", that's why you don't find it in your
tree :).

> > IMHO it's not right to use
> > HVM_MAX_VCPUS because we will increase it at some point, and then we would 
> > add
> > more local APIC entries that possible thus overflowing the id field.
> 
> Hence the "or maybe the minimum of both".
> 
> >> Plus, when you cap LAPIC entries, you should also provide x2APIC
> >> ones (to be able to represent all vCPU-s).
> > 
> > Would it make sense to then provide x2APIC entries regardless of whether 
> > they
> > are present on the native tables or not?
> > 
> > The emulated APIC provided by Xen supports x2APIC mode anyway.
> 
> Yes, I think so.

As a reply to both comments above, I will switch to simply using x2APIC entries
for all vCPUs, and get rid of all this, so we will only provide x2APIC for
vCPUs.  Then if HVM_MAX_VCPUS is increased we will have no issue.

Roger.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.