Skip to content

Commit

Permalink
KVM: x86: popf emulation should not change RF
Browse files Browse the repository at this point in the history
RFLAGS.RF is always zero after popf. Therefore, popf should not updated RF, as
anyhow emulating popf, just as any other instruction should clear RFLAGS.RF.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
anadav authored and bonzini committed Jul 21, 2014
1 parent bb663c7 commit 163b135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ static int emulate_popf(struct x86_emulate_ctxt *ctxt,
return rc;

change_mask = EFLG_CF | EFLG_PF | EFLG_AF | EFLG_ZF | EFLG_SF | EFLG_OF
| EFLG_TF | EFLG_DF | EFLG_NT | EFLG_RF | EFLG_AC | EFLG_ID;
| EFLG_TF | EFLG_DF | EFLG_NT | EFLG_AC | EFLG_ID;

switch(ctxt->mode) {
case X86EMUL_MODE_PROT64:
Expand Down

0 comments on commit 163b135

Please sign in to comment.