xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: xen-devel@lists.xen.org
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	kevin.tian@intel.com, wei.liu2@citrix.com,
	ian.jackson@eu.citrix.com, jbeulich@suse.com,
	roger.pau@citrix.com, chao.gao@intel.com
Subject: [RFC PATCH V3 2/3] Tool/ACPI: DSDT extension to support more vcpus
Date: Wed, 13 Sep 2017 00:52:48 -0400	[thread overview]
Message-ID: <1505278369-21605-3-git-send-email-tianyu.lan@intel.com> (raw)
In-Reply-To: <1505278369-21605-1-git-send-email-tianyu.lan@intel.com>

This patch is to change DSDT table for processor object to support >128 vcpus
accroding to ACPI spec 8.4 Declaring Processors

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 tools/libacpi/mk_dsdt.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 2daf32c..09c1529 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -24,6 +24,8 @@
 #include <xen/arch-arm.h>
 #endif
 
+#define CPU_NAME_FMT      "P%.03X"
+
 static unsigned int indent_level;
 static bool debug = false;
 
@@ -196,10 +198,27 @@ 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);
 
-        stmt("Name", "_HID, \"ACPI0007\"");
+#ifdef CONFIG_X86
+        unsigned int apic_id = cpu * 2;
+
+        if ( apic_id > 254 )
+        {
+            push_block("Device", CPU_NAME_FMT, cpu);
+        }
+        else
+#endif
+        {
+            if (cpu > 255)
+            {
+                fprintf(stderr, "Exceed the range of processor ID \n");
+                return -1;
+            }
+            push_block("Processor", CPU_NAME_FMT ", %d,0x0000b010, 0x06",
+                       cpu, cpu);
+        }
 
+        stmt("Name", "_HID, \"ACPI0007\"");
         stmt("Name", "_UID, %d", cpu);
 #ifdef CONFIG_ARM_64
         pop_block();
@@ -268,15 +287,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." CPU_NAME_FMT ".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." CPU_NAME_FMT ".FLG", cpu);
         push_block("If", "LEqual(Local2, 1)");
-        stmt("Notify", "PR%02X, 1", cpu); /* Notify: Device Check */
+        stmt("Notify", CPU_NAME_FMT ", 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", CPU_NAME_FMT ", 3", cpu); /* Notify: Eject Request */
         stmt("Add", "\\_SB.MSU, 1, \\_SB.MSU"); /* Adjust MADT csum */
         pop_block();
         pop_block();
-- 
1.8.3.1


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

  parent reply	other threads:[~2017-09-13  4:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13  4:52 [RFC PATCH V3 0/3] Extend resources to support more vcpus in single VM Lan Tianyu
2017-09-13  4:52 ` [RFC PATCH V3 1/3] Xen: Increase hap/shadow page pool size to support more vcpus support Lan Tianyu
2017-09-18 13:06   ` Wei Liu
2017-09-19  3:06     ` Lan Tianyu
2017-09-20 15:13       ` Wei Liu
2017-09-21  8:50         ` Lan Tianyu
2017-09-21 11:27           ` Jan Beulich
2017-11-28  8:13         ` Chao Gao
2017-09-13  4:52 ` Lan Tianyu [this message]
2017-09-19 13:29   ` [RFC PATCH V3 2/3] Tool/ACPI: DSDT extension to support more vcpus Roger Pau Monné
2017-09-19 13:44     ` Jan Beulich
2017-09-19 13:48       ` Roger Pau Monné
2017-09-19 13:55         ` Jan Beulich
2017-09-19 14:13           ` Roger Pau Monné
2017-09-19 15:02             ` Jan Beulich
2017-09-19 15:35               ` Roger Pau Monné
2017-09-13  4:52 ` [RFC PATCH V3 3/3] hvmload: Add x2apic entry support in the MADT build Lan Tianyu
2017-09-19 13:41   ` Roger Pau Monné
2017-09-19 13:50     ` Roger Pau Monné

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=1505278369-21605-3-git-send-email-tianyu.lan@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=chao.gao@intel.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).