[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v1] restore the fake x2apic value for cpuid



From: Talons Lee <xin.li@xxxxxxxxxx>

Commit e657fcc clears cpu x2apic capability bit instead of using fake
cpuid value. However, with cpuid x2apic bit on, xen_read_msr_safe() will
not clear the EXTD bit, which leads to uncessary msr write trying to
disable x2apic in __x2apic_disable(). So restore the fake x2apic value.

Signed-off-by: Talons Lee <xin.li@xxxxxxxxxx>

---
CC: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
CC: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>

---
 arch/x86/xen/enlighten_pv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 4b20082..156c408 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -165,12 +165,17 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                      unsigned int *cx, unsigned int *dx)
 {
        unsigned maskebx = ~0;
+       unsigned maskecx = ~0;
 
        /*
         * Mask out inconvenient features, to try and disable as many
         * unsupported kernel subsystems as possible.
         */
        switch (*ax) {
+       case 1:
+               maskecx &= ~(1 << (X86_FEATURE_X2APIC % 32));
+               break;
+
        case CPUID_MWAIT_LEAF:
                /* Synthesize the values.. */
                *ax = 0;
@@ -193,6 +198,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
                : "0" (*ax), "2" (*cx));
 
        *bx &= maskebx;
+       *cx &= maskecx;
 }
 STACK_FRAME_NON_STANDARD(xen_cpuid); /* XEN_EMULATE_PREFIX */
 
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.