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 04/19] xen-dom0: only selectively disable cpu feature

To: Ingo Molnar <mingo@xxxxxxx>
Subject: [Xen-devel] [PATCH 04/19] xen-dom0: only selectively disable cpu features
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 16 Feb 2009 15:45:57 -0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Yinghai Lu <yinghai@xxxxxxxxxx>
Delivery-date: Mon, 16 Feb 2009 15:51:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <f47f399029ba9035a14ae381b6ae504a5c5bd445.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx>
In-reply-to: <cover.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx>
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>
References: <cover.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx> <cover.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx> <cover.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx> <edde7fdd064390d321bdafcfb993b28b4d2588b1.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx> <9fbd402b72d6c494f453ff86e071ac1b2658ece9.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx> <f47f399029ba9035a14ae381b6ae504a5c5bd445.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx>
References: <cover.1234826723.git.jeremy.fitzhardinge@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Dom0 kernels actually want most of the CPU features to be enabled.
Some, like MCA/MCE, are still handled by Xen itself.

We leave APIC enabled even though we don't really have a functional
local apic so that the ACPI code will parse the corresponding tables
properly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index d5fc434..468aa23 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -171,18 +171,23 @@ static void __init xen_banner(void)
 static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                      unsigned int *cx, unsigned int *dx)
 {
-       unsigned maskedx = ~0;
+       unsigned maskedx = 0;
 
        /*
         * Mask out inconvenient features, to try and disable as many
         * unsupported kernel subsystems as possible.
         */
-       if (*ax == 1)
-               maskedx = ~((1 << X86_FEATURE_APIC) |  /* disable APIC */
-                           (1 << X86_FEATURE_ACPI) |  /* disable ACPI */
-                           (1 << X86_FEATURE_MCE)  |  /* disable MCE */
-                           (1 << X86_FEATURE_MCA)  |  /* disable MCA */
-                           (1 << X86_FEATURE_ACC));   /* thermal monitoring */
+       if (*ax == 1) {
+               maskedx =
+                       (1 << X86_FEATURE_MCE)  |  /* disable MCE */
+                       (1 << X86_FEATURE_MCA)  |  /* disable MCA */
+                       (1 << X86_FEATURE_ACC);   /* thermal monitoring */
+
+               if (!xen_initial_domain())
+                       maskedx |=
+                               (1 << X86_FEATURE_APIC) |  /* disable local 
APIC */
+                               (1 << X86_FEATURE_ACPI);  /* disable ACPI */
+       }
 
        asm(XEN_EMULATE_PREFIX "cpuid"
                : "=a" (*ax),
@@ -190,7 +195,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                  "=c" (*cx),
                  "=d" (*dx)
                : "0" (*ax), "2" (*cx));
-       *dx &= maskedx;
+       *dx &= ~maskedx;
 }
 
 static void xen_set_debugreg(int reg, unsigned long val)
-- 
1.6.0.6


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

<Prev in Thread] Current Thread [Next in Thread>