Skip to content

Commit bc397a6

Browse files
anadavbonzini
authored andcommitted
KVM: x86: Do not push eflags.vm on pushf
The pushf instruction does not push eflags.VM, so emulation should not do so as well. Although eflags.RF should not be pushed as well, it is already cleared by the time pushf is executed. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 53bb4f7 commit bc397a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ static int em_pusha(struct x86_emulate_ctxt *ctxt)
18611861

18621862
static int em_pushf(struct x86_emulate_ctxt *ctxt)
18631863
{
1864-
ctxt->src.val = (unsigned long)ctxt->eflags;
1864+
ctxt->src.val = (unsigned long)ctxt->eflags & ~EFLG_VM;
18651865
return em_push(ctxt);
18661866
}
18671867

0 commit comments

Comments
 (0)