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

[Xen-changelog] [xen stable-4.2] x86/AMD: work around erratum 793



commit 3b5aa2861dd0b43a3f0bd4358957bc1b2067968d
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Dec 3 14:15:34 2013 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Dec 3 14:15:34 2013 +0100

    x86/AMD: work around erratum 793
    
    The recommendation is to set a bit in an MSR - do this if the firmware
    didn't, considering that otherwise we expose ourselves to a guest
    induced DoS.
    
    This is CVE-2013-6885 / XSA-82.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    master commit: 98162f256ee33994a9881a720419dda9ad4c03a8
    master date: 2013-12-03 09:49:54 +0100
---
 xen/arch/x86/cpu/amd.c          |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index a317fd1..e20771b 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -522,6 +522,20 @@ static void __devinit init_amd(struct cpuinfo_x86 *c)
                       "*** Pass \"allow_unsafe\" if you're trusting"
                       " all your (PV) guest kernels. ***\n");
 
+       if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+               rdmsrl(MSR_AMD64_LS_CFG, value);
+               if (!(value & (1 << 15))) {
+                       static bool_t warned;
+
+                       if (c == &boot_cpu_data || opt_cpu_info ||
+                           !test_and_set_bool(warned))
+                               printk(KERN_WARNING
+                                      "CPU%u: Applying workaround for erratum 
793\n",
+                                      smp_processor_id());
+                       wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
+               }
+       }
+
        /* AMD CPUs do not support SYSENTER outside of legacy mode. */
        clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 0c9654c..9c91a22 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -206,6 +206,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG               0xc001001f
+#define MSR_AMD64_LS_CFG               0xc0011020
 #define MSR_AMD64_IC_CFG               0xc0011021
 #define MSR_AMD64_DC_CFG               0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT        46
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
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®.