diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-07-21 14:37:26 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-21 13:41:32 +0200 |
commit | bb663c7ada380f3c89c2f83fdbe2b3626621385d (patch) | |
tree | e57e04c0f2820e57b8f27f80216fc6880af55c3b /arch/x86/kvm | |
parent | ec10b72701fa2a5a6b05194cb2dbe48cb36c7115 (diff) | |
download | op-kernel-dev-bb663c7ada380f3c89c2f83fdbe2b3626621385d.zip op-kernel-dev-bb663c7ada380f3c89c2f83fdbe2b3626621385d.tar.gz |
KVM: x86: Clearing rflags.rf upon skipped emulated instruction
When skipping an emulated instruction, rflags.rf should be cleared as it would
be on real x86 CPU.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index f750b69..1fd806c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -5229,6 +5229,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, if (emulation_type & EMULTYPE_SKIP) { kvm_rip_write(vcpu, ctxt->_eip); + if (ctxt->eflags & X86_EFLAGS_RF) + kvm_set_rflags(vcpu, ctxt->eflags & ~X86_EFLAGS_RF); return EMULATE_DONE; } |