From: Jan Beulich Date: Tue, 20 Dec 2016 08:51:08 +0000 (+0100) Subject: x86emul: check for CMPXCHG8B availability X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3106 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bfe67e80b2dabb29e0b40d89d91023f0d75934be;p=xen.git x86emul: check for CMPXCHG8B availability We can't exclude someone wanting to hide the instruction from guests. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 165eebb0d9..be6904ff2a 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1290,6 +1290,7 @@ static bool vcpu_has( #define vcpu_has_fpu() vcpu_has( 1, EDX, 0, ctxt, ops) #define vcpu_has_sep() vcpu_has( 1, EDX, 11, ctxt, ops) +#define vcpu_has_cx8() vcpu_has( 1, EDX, 8, ctxt, ops) #define vcpu_has_cmov() vcpu_has( 1, EDX, 15, ctxt, ops) #define vcpu_has_clflush() vcpu_has( 1, EDX, 19, ctxt, ops) #define vcpu_has_mmx() vcpu_has( 1, EDX, 23, ctxt, ops) @@ -5427,7 +5428,10 @@ x86_emulate( op_bytes = 16; } else + { + vcpu_must_have(cx8); op_bytes = 8; + } old = container_of(&mmvalp->ymm[0], typeof(*old), u64[0]); aux = container_of(&mmvalp->ymm[2], typeof(*aux), u64[0]);