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 <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 0d4d9e8f55
master date: 2018-12-18 15:19:47 +0100
This commit is contained in:
Jan Beulich committed 2019-02-01 11:47:12 +01:00
1 parent 500ceac0a2
commit 7baf4f08e1
1 file changed
+11 -1
+11 -1
View File
@@ -5647,9 +5647,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, &fic);
/* Work around erratum BT230. */
vex.l = 0;
}
opc = init_prefixes(stub);
@@ -6337,6 +6339,9 @@ x86_emulate(
get_fpu(X86EMUL_FPU_mmx, &fic);
}
/* Work around erratum BT36. */
vex.w = 0;
opc = init_prefixes(stub);
opc[0] = b;
fic.insn_bytes = PFX_BYTES + 1;
@@ -7630,6 +7635,11 @@ x86_emulate(
generate_exception_if(vex.l || vex.reg != 0xf, EXC_UD);
host_and_vcpu_must_have(avx);
get_fpu(X86EMUL_FPU_ymm, &fic);
/* Work around erratum BT41. */
if ( !mode_64bit() )
vex.w = 0;
opc = init_prefixes(stub);
goto pextr;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.