summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2014-12-10 11:19:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-12-10 12:51:28 +0100
commitbc397a6c914c75d8ae21dad23eba9ae82e34dad3 (patch)
tree0b7f8fdc82a3a2c084fb618317c96ba91be0f3ce /arch/x86/kvm/emulate.c
parent53bb4f789a7be4448d624741df93b2401ecd3625 (diff)
downloadlwn-bc397a6c914c75d8ae21dad23eba9ae82e34dad3.tar.gz
lwn-bc397a6c914c75d8ae21dad23eba9ae82e34dad3.zip
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>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b4f4201c32c9..c1e71873e0c7 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1861,7 +1861,7 @@ static int em_pusha(struct x86_emulate_ctxt *ctxt)
static int em_pushf(struct x86_emulate_ctxt *ctxt)
{
- ctxt->src.val = (unsigned long)ctxt->eflags;
+ ctxt->src.val = (unsigned long)ctxt->eflags & ~EFLG_VM;
return em_push(ctxt);
}