WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][pvops_dom0][4/4] use physical acpi_id in acpi proces

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] [PATCH][pvops_dom0][4/4] use physical acpi_id in acpi processor parsing logic
From: "Yu, Ke" <ke.yu@xxxxxxxxx>
Date: Sun, 19 Jul 2009 14:46:47 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 18 Jul 2009 23:49:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcoIPK/0l9h0JRP3Rp6BO26aKjFcww==
Thread-topic: [PATCH][pvops_dom0][4/4] use physical acpi_id in acpi processor parsing logic
use physical acpi_id in acpi processor parsing logic

xen domain0 is seeing vCPU, while xen need the acpi info of physical CPU, so 
this patch hack the acpi processor parsing logic to use physical acpi_id 
instead vcpu id

From: Yu Ke <ke.yu@xxxxxxxxx>

Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>
---

 arch/x86/kernel/acpi/processor.c |    4 ++++
 drivers/acpi/processor_core.c    |   11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)


diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index 9f0b296..d4d57a9 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -11,6 +11,7 @@
 
 #include <acpi/processor.h>
 #include <asm/acpi.h>
+#include <asm/xen/hypervisor.h>
 
 static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
 {
@@ -82,6 +83,9 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
 {
        struct cpuinfo_x86 *c = &cpu_data(pr->id);
 
+       if (xen_pv_domain())
+               c = &cpu_data(0);
+
        pr->pdc = NULL;
        if (c->x86_vendor == X86_VENDOR_INTEL)
                init_intel_pdc(pr, c);
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 0b6facc..a124c4a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -638,6 +638,9 @@ static int acpi_processor_get_info(struct acpi_device 
*device)
 
        pr->id = cpu_index;
 
+       if (xen_pv_domain())
+               pr->id = pr->acpi_id;
+
        /*
         *  Extra Processor objects may be enumerated on MP systems with
         *  less than the max # of CPUs. They should be ignored _iff
@@ -703,14 +706,16 @@ static int __cpuinit acpi_processor_start(struct 
acpi_device *device)
                return 0;
        }
 
-       BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
+       if (!xen_pv_domain())
+               BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 
        /*
         * Buggy BIOS check
         * ACPI id of processors can be reported wrongly by the BIOS.
         * Don't trust it blindly
         */
-       if (per_cpu(processor_device_array, pr->id) != NULL &&
+       if (!xen_pv_domain() &&
+               per_cpu(processor_device_array, pr->id) != NULL &&
            per_cpu(processor_device_array, pr->id) != device) {
                printk(KERN_WARNING "BIOS reported wrong ACPI id "
                        "for the processor\n");
@@ -725,7 +730,7 @@ static int __cpuinit acpi_processor_start(struct 
acpi_device *device)
                goto end;
 
        sysdev = get_cpu_sysdev(pr->id);
-       if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
+       if (sysdev != NULL && sysfs_create_link(&device->dev.kobj, 
&sysdev->kobj, "sysdev"))
                return -EFAULT;
 
        /* _PDC call should be done before doing anything else (if reqd.). */

Attachment: xen-vcpu-pcpu-mapping.patch
Description: xen-vcpu-pcpu-mapping.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel