Displaying 2 results from an estimated 2 matches for "vcpu_has_bmi1".
2011 Nov 30
0
[PATCH 3/4] x86/emulator: properly handle lzcnt and tzcnt
...ned-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1058,6 +1058,9 @@ static bool_t vcpu_has(
return rc == X86EMUL_OKAY;
}
+#define vcpu_has_lzcnt() vcpu_has(0x80000001, ECX, 5, ctxt, ops)
+#define vcpu_has_bmi1() vcpu_has(0x00000007, EBX, 3, ctxt, ops)
+
#define vcpu_must_have(leaf, reg, bit) \
generate_exception_if(!vcpu_has(leaf, reg, bit, ctxt, ops), EXC_UD, -1)
#define vcpu_must_have_mmx() vcpu_must_have(0x00000001, EDX, 23)
@@ -4357,13 +4360,24 @@ x86_emulate(
dst.val = (uint8_t)...
2011 Nov 30
0
[PATCH 4/4] x86/emulator: cleanup
...t rc;
generate_exception_if(!mode_ring0(), EXC_GP, 0);
@@ -4366,7 +4367,7 @@ x86_emulate(
: "=r" (dst.val), "=q" (zf)
: "r" (src.val) );
_regs.eflags &= ~EFLG_ZF;
- if ( (rep_prefix == REPE_PREFIX) && vcpu_has_bmi1() )
+ if ( (vex.pfx == vex_f3) && vcpu_has_bmi1() )
{
_regs.eflags &= ~EFLG_CF;
if ( zf )
@@ -4391,7 +4392,7 @@ x86_emulate(
: "=r" (dst.val), "=q" (zf)
: "r" (src.val) );
_reg...