[xen stable-4.7] x86: Fix "x86: further CPUID handling adjustments"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen stable-4.7] x86: Fix "x86: further CPUID handling adjustments"

patchbot
commit 6de86cfa684895895b792a7463cf85da77a01fb8
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Tue May 29 10:23:47 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue May 29 10:23:47 2018 +0200

    x86: Fix "x86: further CPUID handling adjustments"
   
    c/s 62b187969 "x86: further CPUID handling adjustments" make some adjustments.
    However, it breaks levelling of guests, making it impossible for the toolstack
    to hide STIBP or IBPB from guests on hardware with up-to-date microcode.
   
    The dom0 issue referenced in the commit message was fixed by the hunk
    adjusting the zeroing alone.  STIBP and IBPB don't need (and indeed, must not
    be for levelling purposes) OR'd into the leaf.
   
    Signed-off-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
---
 xen/arch/x86/hvm/hvm.c | 3 ---
 xen/arch/x86/traps.c   | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ff1c6fa59a..f62b021c5e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3496,8 +3496,6 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
                      special_features[FEATURESET_7b0]);
 
             *ecx &= hvm_featureset[FEATURESET_7c0];
-
-            *edx |= cpufeat_mask(X86_FEATURE_STIBP);
             *edx &= hvm_featureset[FEATURESET_7d0];
 
             /* Don't expose HAP-only features to non-hap guests. */
@@ -3657,7 +3655,6 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
         hvm_cpuid(0x80000001, NULL, NULL, NULL, &_edx);
         *eax |= (_edx & cpufeat_mask(X86_FEATURE_LM) ? vaddr_bits : 32) << 8;
 
-        *ebx |= cpufeat_mask(X86_FEATURE_IBPB);
         *ebx &= hvm_featureset[FEATURESET_e8b];
         break;
     }
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 0f34b2115d..1e2e7d4a7e 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1088,8 +1088,6 @@ void pv_cpuid(struct cpu_user_regs *regs)
                   special_features[FEATURESET_7b0]);
 
             c &= pv_featureset[FEATURESET_7c0];
-
-            d |= cpufeat_mask(X86_FEATURE_STIBP);
             d &= pv_featureset[FEATURESET_7d0];
 
             if ( !is_pvh_domain(currd) )
@@ -1188,7 +1186,6 @@ void pv_cpuid(struct cpu_user_regs *regs)
 
     case 0x80000008:
         a = paddr_bits | (vaddr_bits << 8);
-        b |= cpufeat_mask(X86_FEATURE_IBPB);
         b &= pv_featureset[FEATURESET_e8b];
         break;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog