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

[Xen-changelog] [xen master] x86/cpu: undo BIOS CPUID max_leaf limit before querying for features



commit a1ac4cf52e38386bac7ac3440c7da0099662ca5c
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Jul 29 17:02:25 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jul 29 17:02:25 2014 +0200

    x86/cpu: undo BIOS CPUID max_leaf limit before querying for features
    
    If IA32_MISC_ENABLE[22] is set by the BIOS, CPUID.0.EAX will be limited to 
3.
    Lift this limit before considering whether to query CPUID.7[ECX=0].EBX for
    features.
    
    Without this change, dom0 is able to see this feature leaf (as the limit was
    subsequently lifted), and will set features appropriately in HVM domain 
cpuid
    policies.
    
    The specific bug XenServer observed was the advertisement of the FSGSBASE
    feature, but an inability to set CR4.FSGSBASE as Xen considered the bit to 
be
    reserved as cpu_has_fsgsbase incorrectly evaluated as false.
    
    This is a regression introduced by c/s 44e24f8567 "x86: don't call
    generic_identify() redundantly" where the redundant call actually resampled
    CPUID.7[ECX=0] properly to obtain the feature flags.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/cpu/common.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 0741696..5156df3 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -250,14 +250,15 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 
*c)
                        paddr_bits = cpuid_eax(0x80000008) & 0xff;
        }
 
+       /* Might lift BIOS max_leaf=3 limit. */
+       early_intel_workaround(c);
+
        /* Intel-defined flags: level 0x00000007 */
        if ( c->cpuid_level >= 0x00000007 ) {
                u32 dummy;
                cpuid_count(0x00000007, 0, &dummy, &ebx, &dummy, &dummy);
                c->x86_capability[X86_FEATURE_FSGSBASE / 32] = ebx;
        }
-
-       early_intel_workaround(c);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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


 


Rackspace

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