Skip to content

Commit

Permalink
KVM: x86: Cleanup of rflags.rf cleaning
Browse files Browse the repository at this point in the history
RFLAGS.RF was cleaned in several functions (e.g., syscall) in the x86 emulator.
Now that we clear it before the execution of an instruction in the emulator, we
can remove the specific cleanup of RFLAGS.RF.

Signed-off-by: Nadav Amit <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
anadav authored and bonzini committed Jul 21, 2014
1 parent 4467c3f commit 6c6cb69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2211,22 +2211,22 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt)
*reg_write(ctxt, VCPU_REGS_RCX) = ctxt->_eip;
if (efer & EFER_LMA) {
#ifdef CONFIG_X86_64
*reg_write(ctxt, VCPU_REGS_R11) = ctxt->eflags & ~EFLG_RF;
*reg_write(ctxt, VCPU_REGS_R11) = ctxt->eflags;

ops->get_msr(ctxt,
ctxt->mode == X86EMUL_MODE_PROT64 ?
MSR_LSTAR : MSR_CSTAR, &msr_data);
ctxt->_eip = msr_data;

ops->get_msr(ctxt, MSR_SYSCALL_MASK, &msr_data);
ctxt->eflags &= ~(msr_data | EFLG_RF);
ctxt->eflags &= ~msr_data;
#endif
} else {
/* legacy mode */
ops->get_msr(ctxt, MSR_STAR, &msr_data);
ctxt->_eip = (u32)msr_data;

ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF);
ctxt->eflags &= ~(EFLG_VM | EFLG_IF);
}

return X86EMUL_CONTINUE;
Expand Down Expand Up @@ -2275,7 +2275,7 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt)
break;
}

ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF);
ctxt->eflags &= ~(EFLG_VM | EFLG_IF);
cs_sel = (u16)msr_data;
cs_sel &= ~SELECTOR_RPL_MASK;
ss_sel = cs_sel + 8;
Expand Down

0 comments on commit 6c6cb69

Please sign in to comment.