Commit f583c29b authored by Gleb Natapov's avatar Gleb Natapov

x86 emulator: fix parity calculation for AAD instruction

Reported-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 7a905b14
...@@ -2995,14 +2995,11 @@ static int em_aad(struct x86_emulate_ctxt *ctxt) ...@@ -2995,14 +2995,11 @@ static int em_aad(struct x86_emulate_ctxt *ctxt)
ctxt->dst.val = (ctxt->dst.val & 0xffff0000) | al; ctxt->dst.val = (ctxt->dst.val & 0xffff0000) | al;
ctxt->eflags &= ~(X86_EFLAGS_PF | X86_EFLAGS_SF | X86_EFLAGS_ZF); /* Set PF, ZF, SF */
ctxt->src.type = OP_IMM;
if (!al) ctxt->src.val = 0;
ctxt->eflags |= X86_EFLAGS_ZF; ctxt->src.bytes = 1;
if (!(al & 1)) fastop(ctxt, em_or);
ctxt->eflags |= X86_EFLAGS_PF;
if (al & 0x80)
ctxt->eflags |= X86_EFLAGS_SF;
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment