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-changelog

[Xen-changelog] [xen-unstable] x86:x2apic: Disable x2apic on x86-32 perm

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86:x2apic: Disable x2apic on x86-32 permanently
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Mon, 24 Jan 2011 16:00:30 -0800
Delivery-date: Mon, 24 Jan 2011 16:00:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1295625507 0
# Node ID 9bd5f65050f8014de7d0fcf9d89ed8c441f261fa
# Parent  5852612cd4c461e5219db73cc52de0c643c414e8
x86:x2apic: Disable x2apic on x86-32 permanently

x2apic initialization on x86_32 uses vcpu pointer before it is
initialized. As x2apic is unlikely to be used on x86_32, this patch
disables x2apic permanently on x86_32. It also asserts the sanity of
vcpu pointer before dereference to prevent further misuse.

Signed-off-by: Fengzhe Zhang <fengzhe.zhang@xxxxxxxxx>
---
 xen/arch/x86/apic.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

diff -r 5852612cd4c4 -r 9bd5f65050f8 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c       Fri Jan 21 15:57:18 2011 +0000
+++ b/xen/arch/x86/apic.c       Fri Jan 21 15:58:27 2011 +0000
@@ -961,6 +961,22 @@ void __init x2apic_bsp_setup(void)
     if ( !cpu_has_x2apic )
         return;
 
+#ifdef __i386__
+    clear_bit(X86_FEATURE_X2APIC, boot_cpu_data.x86_capability);
+    if ( x2apic_enabled )
+    {
+        uint64_t msr_content;
+        rdmsrl(MSR_IA32_APICBASE, msr_content);
+        msr_content &= ~(MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_EXTD);
+        wrmsrl(MSR_IA32_APICBASE, msr_content);
+        msr_content |= MSR_IA32_APICBASE_ENABLE;
+        wrmsrl(MSR_IA32_APICBASE, msr_content);
+        x2apic_enabled = 0;
+    }
+    printk("x2APIC disabled permanently on x86_32.\n");
+    return;
+#endif
+
     if ( !opt_x2apic )
     {
         if ( !x2apic_enabled )

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86:x2apic: Disable x2apic on x86-32 permanently, Xen patchbot-unstable <=