]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/emul: Add feature check for clzero
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Mar 2017 09:45:58 +0000 (10:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 29 Mar 2017 15:49:48 +0000 (16:49 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index 497cc77c654dc01010a4e5d648b951537eaea5c4..7af8a4266de6c558e6df2c92c750265596b993aa 100644 (file)
@@ -1604,6 +1604,7 @@ static bool vcpu_has(
 #define vcpu_has_clwb()        vcpu_has(         7, EBX, 24, ctxt, ops)
 #define vcpu_has_sha()         vcpu_has(         7, EBX, 29, ctxt, ops)
 #define vcpu_has_rdpid()       vcpu_has(         7, ECX, 22, ctxt, ops)
+#define vcpu_has_clzero()      vcpu_has(0x80000008, EBX,  0, ctxt, ops)
 
 #define vcpu_must_have(feat) \
     generate_exception_if(!vcpu_has_##feat(), EXC_UD)
@@ -5183,6 +5184,8 @@ x86_emulate(
         {
             unsigned long zero = 0;
 
+            vcpu_must_have(clzero);
+
             base = ad_bytes == 8 ? _regs.r(ax) :
                    ad_bytes == 4 ? _regs.eax : _regs.ax;
             limit = 0;