From: Jan Beulich Date: Fri, 1 Feb 2019 10:33:09 +0000 (+0100) Subject: x86emul: work around SandyBridge errata X-Git-Tag: RELEASE-4.11.2~97 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2cd833de4dae3898849a0eea5298644e2890e018;p=people%2Fdwmw2%2Fxen.git x86emul: work around SandyBridge errata There are a number of exception condition related errata on SandyBridge CPUs, some of which are unexpected #UD (others, of no interest here, are lack of mandated exceptions, or exceptions of unexpected type). Annotate the one workaround we already have, and add two more. Due to the exception recovery we have in place for stub invocations these aren't security issues. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper master commit: 0d4d9e8f55602415475e04a5dc8b4ad27845a7f9 master date: 2018-12-18 15:19:47 +0100 --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index e7640e58cb..b1f3b568ab 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -5766,9 +5766,11 @@ x86_emulate( else { generate_exception_if(vex.reg != 0xf, EXC_UD); - vex.l = 0; host_and_vcpu_must_have(avx); get_fpu(X86EMUL_FPU_ymm); + + /* Work around erratum BT230. */ + vex.l = 0; } opc = init_prefixes(stub); @@ -6452,6 +6454,9 @@ x86_emulate( get_fpu(X86EMUL_FPU_mmx); } + /* Work around erratum BT36. */ + vex.w = 0; + opc = init_prefixes(stub); opc[0] = b; insn_bytes = PFX_BYTES + 1; @@ -8060,6 +8065,11 @@ x86_emulate( generate_exception_if(vex.l || vex.reg != 0xf, EXC_UD); host_and_vcpu_must_have(avx); get_fpu(X86EMUL_FPU_ymm); + + /* Work around erratum BT41. */ + if ( !mode_64bit() ) + vex.w = 0; + opc = init_prefixes(stub); goto pextr;