diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-11-02 11:54:49 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-11-07 15:44:05 +0100 |
commit | 807c142595abcb99285746bd5512447bdf40b9b1 (patch) | |
tree | 224e59cef2e14c9bca43a49be2695076a62eebbb /arch/x86/kvm/emulate.c | |
parent | b5bbf10ee6b65b70c10c139822bc2dc077cefa76 (diff) | |
download | linux-807c142595abcb99285746bd5512447bdf40b9b1.tar.bz2 |
KVM: x86: SYSCALL cannot clear eflags[1]
SYSCALL emulation currently clears in 64-bit mode eflags according to
MSR_SYSCALL_MASK. However, on bare-metal eflags[1] which is fixed to one
cannot be cleared, even if MSR_SYSCALL_MASK masks the bit. This wrong behavior
may result in failed VM-entry, as VT disallows entry with eflags[1] cleared.
This patch sets the bit after masking eflags on syscall.
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 713295d913fd..e475cdff15e1 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2306,6 +2306,7 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt) ops->get_msr(ctxt, MSR_SYSCALL_MASK, &msr_data); ctxt->eflags &= ~msr_data; + ctxt->eflags |= EFLG_RESERVED_ONE_MASK; #endif } else { /* legacy mode */ |