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

[Xen-changelog] [xen staging] x86/xstate: Don't special case feature collection



commit 65c165d6595f2762da577cb428e3bc61e32e0899
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Feb 22 13:28:16 2019 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Mar 12 13:57:13 2019 +0000

    x86/xstate: Don't special case feature collection
    
    The logic in xstate_init() is a rementent of the pre-featuremask days.
    Collect the xstate features in generic_identify(), like all other feature
    leaves, after which identify_cpu() will apply the known_feature[] mask 
derived
    from the automatically generated CPUID information.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/cpu/common.c |  4 ++++
 xen/arch/x86/xstate.c     | 13 -------------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index de6c5c903f..53bb0a9e7c 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -414,6 +414,10 @@ static void generic_identify(struct cpuinfo_x86 *c)
                            
&c->x86_capability[cpufeat_word(X86_FEATURE_FSGSBASE)],
                            &c->x86_capability[cpufeat_word(X86_FEATURE_PKU)],
                            
&c->x86_capability[cpufeat_word(X86_FEATURE_AVX512_4VNNIW)]);
+       if (c->cpuid_level >= 0xd)
+               cpuid_count(0xd, 1,
+                           
&c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)],
+                           &tmp, &tmp, &tmp);
 }
 
 /*
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 15edd5df96..858d1a6573 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -628,19 +628,6 @@ void xstate_init(struct cpuinfo_x86 *c)
         BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
-    /* Check extended XSAVE features. */
-    cpuid_count(XSTATE_CPUID, 1, &eax, &ebx, &ecx, &edx);
-
-    /* Mask out features not currently understood by Xen. */
-    eax &= (cpufeat_mask(X86_FEATURE_XSAVEOPT) |
-            cpufeat_mask(X86_FEATURE_XSAVEC) |
-            cpufeat_mask(X86_FEATURE_XGETBV1) |
-            cpufeat_mask(X86_FEATURE_XSAVES));
-
-    c->x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)] = eax;
-
-    BUG_ON(eax != 
boot_cpu_data.x86_capability[cpufeat_word(X86_FEATURE_XSAVEOPT)]);
-
     if ( setup_xstate_features(bsp) && bsp )
         BUG();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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