Message ID | 1503629540-26053-4-git-send-email-tianyu.lan@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: > This patch is to change DSDT table for processor object to support >255 vcpus. > Can you provide a link to the spec so people can check if you modification is correct?
On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote:
> This patch is to change DSDT table for processor object to support >255 vcpus.
The note in ACPI 6.1A spec section 5.2.12.12 contains the following:
[Compatibility note] On some legacy OSes, Logical processors with APIC
ID values less than 255 (whether in XAPIC or X2APIC mode) must use the
Processor Local APIC structure to convey their APIC information to
OSPM, and those processors must be declared in the DSDT using the
Processor() keyword. Logical processors with APIC ID values 255 and
greater must use the Processor Local x2APIC structure and be declared
using the Device() keyword. See Section 19.6.102 "Processor (Declare
Processor)" for more information.
So you cannot unconditionally switch to using the Device for all
processors.
vCPUs <= 128 need to use the Processor keyword, while vCPUs > 128 need
to use the Device keyword.
FWIW the code below to create the Devices looks fine to me.
Roger.
>>> On 25.08.17 at 12:36, <roger.pau@citrix.com> wrote: > On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >> This patch is to change DSDT table for processor object to support >255 > vcpus. > > The note in ACPI 6.1A spec section 5.2.12.12 contains the following: > > [Compatibility note] On some legacy OSes, Logical processors with APIC > ID values less than 255 (whether in XAPIC or X2APIC mode) must use the > Processor Local APIC structure to convey their APIC information to > OSPM, and those processors must be declared in the DSDT using the > Processor() keyword. Logical processors with APIC ID values 255 and > greater must use the Processor Local x2APIC structure and be declared > using the Device() keyword. See Section 19.6.102 "Processor (Declare > Processor)" for more information. > > So you cannot unconditionally switch to using the Device for all > processors. > > vCPUs <= 128 need to use the Processor keyword, while vCPUs > 128 need > to use the Device keyword. While changing this code, may I suggest to stop referring to the 128 vCPU boundary? The decision should be solely based on LAPIC ID, such that the only place to change later on will end up being the one where it gets set to double the vCPU number. Jan
On 8/25/2017 5:25 PM, Wei Liu wrote: > On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >> This patch is to change DSDT table for processor object to support >255 vcpus. >> > > Can you provide a link to the spec so people can check if you > modification is correct? > OK. Will add in the next version.
On 2017年08月25日 20:01, Jan Beulich wrote: >>>> On 25.08.17 at 12:36, <roger.pau@citrix.com> wrote: >> On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >>> This patch is to change DSDT table for processor object to support >255 >> vcpus. >> >> The note in ACPI 6.1A spec section 5.2.12.12 contains the following: >> >> [Compatibility note] On some legacy OSes, Logical processors with APIC >> ID values less than 255 (whether in XAPIC or X2APIC mode) must use the >> Processor Local APIC structure to convey their APIC information to >> OSPM, and those processors must be declared in the DSDT using the >> Processor() keyword. Logical processors with APIC ID values 255 and >> greater must use the Processor Local x2APIC structure and be declared >> using the Device() keyword. See Section 19.6.102 "Processor (Declare >> Processor)" for more information. >> >> So you cannot unconditionally switch to using the Device for all >> processors. >> >> vCPUs <= 128 need to use the Processor keyword, while vCPUs > 128 need >> to use the Device keyword. > > While changing this code, may I suggest to stop referring to the > 128 vCPU boundary? The decision should be solely based on > LAPIC ID, such that the only place to change later on will end up > being the one where it gets set to double the vCPU number. > OK. Got it.
On 2017年08月25日 18:36, Roger Pau Monné wrote: > On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >> This patch is to change DSDT table for processor object to support >255 vcpus. > > The note in ACPI 6.1A spec section 5.2.12.12 contains the following: > > [Compatibility note] On some legacy OSes, Logical processors with APIC > ID values less than 255 (whether in XAPIC or X2APIC mode) must use the > Processor Local APIC structure to convey their APIC information to > OSPM, and those processors must be declared in the DSDT using the > Processor() keyword. Logical processors with APIC ID values 255 and > greater must use the Processor Local x2APIC structure and be declared > using the Device() keyword. See Section 19.6.102 "Processor (Declare > Processor)" for more information. > > So you cannot unconditionally switch to using the Device for all > processors. > > vCPUs <= 128 need to use the Processor keyword, while vCPUs > 128 need > to use the Device keyword. Yes, that's right and will fix.
diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c index 2daf32c..d37aed6 100644 --- a/tools/libacpi/mk_dsdt.c +++ b/tools/libacpi/mk_dsdt.c @@ -196,8 +196,7 @@ int main(int argc, char **argv) /* Define processor objects and control methods. */ for ( cpu = 0; cpu < max_cpus; cpu++) { - push_block("Processor", "PR%02X, %d, 0x0000b010, 0x06", cpu, cpu); - + push_block("Device", "P%03X", cpu); stmt("Name", "_HID, \"ACPI0007\""); stmt("Name", "_UID, %d", cpu); @@ -268,15 +267,15 @@ int main(int argc, char **argv) /* Extract current CPU's status: 0=offline; 1=online. */ stmt("And", "Local1, 1, Local2"); /* Check if status is up-to-date in the relevant MADT LAPIC entry... */ - push_block("If", "LNotEqual(Local2, \\_SB.PR%02X.FLG)", cpu); + push_block("If", "LNotEqual(Local2, \\_SB.P%03X.FLG)", cpu); /* ...If not, update it and the MADT checksum, and notify OSPM. */ - stmt("Store", "Local2, \\_SB.PR%02X.FLG", cpu); + stmt("Store", "Local2, \\_SB.P%03X.FLG", cpu); push_block("If", "LEqual(Local2, 1)"); - stmt("Notify", "PR%02X, 1", cpu); /* Notify: Device Check */ + stmt("Notify", "P%03X, 1", cpu); /* Notify: Device Check */ stmt("Subtract", "\\_SB.MSU, 1, \\_SB.MSU"); /* Adjust MADT csum */ pop_block(); push_block("Else", NULL); - stmt("Notify", "PR%02X, 3", cpu); /* Notify: Eject Request */ + stmt("Notify", "P%03X, 3", cpu); /* Notify: Eject Request */ stmt("Add", "\\_SB.MSU, 1, \\_SB.MSU"); /* Adjust MADT csum */ pop_block(); pop_block();
This patch is to change DSDT table for processor object to support >255 vcpus. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> --- tools/libacpi/mk_dsdt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)