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

[xen stable-4.16] x86: Expose more MSR_ARCH_CAPS to hwdom



commit 2a362668cb4ad9a0784c4592968f881d7746ec0f
Author:     Jason Andryuk <jandryuk@xxxxxxxxx>
AuthorDate: Mon Aug 15 15:32:31 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 15 15:32:31 2022 +0200

    x86: Expose more MSR_ARCH_CAPS to hwdom
    
    commit e46474278a0e ("x86/intel: Expose MSR_ARCH_CAPS to dom0") started
    exposing MSR_ARCH_CAPS to dom0.  More bits in MSR_ARCH_CAPS have since
    been defined, but they haven't been exposed.  Update the list to allow
    them through.
    
    As one example, this allows a Linux Dom0 to know that it has the
    appropriate microcode via FB_CLEAR.  Notably, and with the updated
    microcode, this changes dom0's
    /sys/devices/system/cpu/vulnerabilities/mmio_stale_data changes from:
    
      "Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state 
unknown"
    
    to:
    
      "Mitigation: Clear CPU buffers; SMT Host state unknown"
    
    This exposes the MMIO Stale Data and Intel Branch History Injection
    (BHI) controls as well as the page size change MCE issue bit.
    
    Fixes: commit 2ebe8fe9b7e0 ("x86/spec-ctrl: Enumeration for MMIO Stale Data 
controls")
    Fixes: commit cea9ae062295 ("x86/spec-ctrl: Enumeration for new Intel BHI 
controls")
    Fixes: commit 59e89cdabc71 ("x86/vtx: Disable executable EPT superpages to 
work around CVE-2018-12207")
    Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: e83cd54611fec5b7a539fa1281a14319143490e6
    master date: 2022-08-09 16:35:25 +0100
---
 xen/arch/x86/msr.c              | 9 +++++++--
 xen/include/asm-x86/msr-index.h | 2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index da305c7aa4..103703dfc0 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -71,7 +71,9 @@ static void __init calculate_host_policy(void)
     mp->arch_caps.raw &=
         (ARCH_CAPS_RDCL_NO | ARCH_CAPS_IBRS_ALL | ARCH_CAPS_RSBA |
          ARCH_CAPS_SKIP_L1DFL | ARCH_CAPS_SSB_NO | ARCH_CAPS_MDS_NO |
-         ARCH_CAPS_IF_PSCHANGE_MC_NO | ARCH_CAPS_TSX_CTRL | ARCH_CAPS_TAA_NO);
+         ARCH_CAPS_IF_PSCHANGE_MC_NO | ARCH_CAPS_TSX_CTRL | ARCH_CAPS_TAA_NO |
+         ARCH_CAPS_SBDR_SSDP_NO | ARCH_CAPS_FBSDP_NO | ARCH_CAPS_PSDP_NO |
+         ARCH_CAPS_FB_CLEAR | ARCH_CAPS_RRSBA | ARCH_CAPS_BHI_NO);
 }
 
 static void __init calculate_pv_max_policy(void)
@@ -160,7 +162,10 @@ int init_domain_msr_policy(struct domain *d)
 
         mp->arch_caps.raw = val &
             (ARCH_CAPS_RDCL_NO | ARCH_CAPS_IBRS_ALL | ARCH_CAPS_RSBA |
-             ARCH_CAPS_SSB_NO | ARCH_CAPS_MDS_NO | ARCH_CAPS_TAA_NO);
+             ARCH_CAPS_SSB_NO | ARCH_CAPS_MDS_NO | ARCH_CAPS_IF_PSCHANGE_MC_NO 
|
+             ARCH_CAPS_TAA_NO | ARCH_CAPS_SBDR_SSDP_NO | ARCH_CAPS_FBSDP_NO |
+             ARCH_CAPS_PSDP_NO | ARCH_CAPS_FB_CLEAR | ARCH_CAPS_RRSBA |
+             ARCH_CAPS_BHI_NO);
     }
 
     d->arch.msr = mp;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 3cb942eeac..c601d88993 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -71,6 +71,8 @@
 #define  ARCH_CAPS_PSDP_NO                  (_AC(1, ULL) << 15)
 #define  ARCH_CAPS_FB_CLEAR                 (_AC(1, ULL) << 17)
 #define  ARCH_CAPS_FB_CLEAR_CTRL            (_AC(1, ULL) << 18)
+#define  ARCH_CAPS_RRSBA                    (_AC(1, ULL) << 19)
+#define  ARCH_CAPS_BHI_NO                   (_AC(1, ULL) << 20)
 
 #define MSR_FLUSH_CMD                       0x0000010b
 #define  FLUSH_CMD_L1D                      (_AC(1, ULL) <<  0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.16



 


Rackspace

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