KVM: nVMX: Reset RFLAGS on VM-exit
PATCH v2 1/1 KVM: nVMX: Reset RFLAGS on VM-exit
From: Jan Kiszka <[email protected]>
Ouch, how could this work so well that far? We need to clear RFLAGS to the reset value as specified by the SDM. Particularly, IF must be off after VM-exit!
---
Changes in v2:
- use symbolic constant for rflags reset value
arch/x86/kvm/vmx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kvm/vmx.c +1 -0
@@ -7454,6 +7454,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,kvm_register_write (vcpu,VCPU_REGS_RSP , vmcs12->host_rsp);kvm_register_write (vcpu,VCPU_REGS_RIP , vmcs12->host_rip); +vmx_set_rflags (vcpu,X86_EFLAGS_BIT1 );/* * Note that calling vmx_set_cr0 is important, even if cr0 hasn't * actually changed, because it depends on the current state of
Signature · 1 line
1.7.3.4
Quoted 7 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Ouch, how could this work so well that far? We need to clear RFLAGS to the reset value as specified by the SDM. Particularly, IF must be off after VM-exit!
Signed-off-by Jan Kiszka <[email protected]>
Quoted 22 lines
---
Changes in v2:
- use symbolic constant for rflags reset valuearch/x86/kvm/vmx.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)arch/x86/kvm/vmx.c +1
-0@@ -7454,6 +7454,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,kvm_register_write (vcpu,VCPU_REGS_RSP , vmcs12->host_rsp);kvm_register_write (vcpu,VCPU_REGS_RIP , vmcs12->host_rip); +vmx_set_rflags (vcpu,X86_EFLAGS_BIT1 );/* * Note that calling vmx_set_cr0 is important, even if cr0 hasn't * actually changed, because it depends on the current state of Signature · 1 line
1.7.3.4
--
Gleb.
Marcelo Tosatti
AppliedQuoted 9 lines · Gleb Natapov
Quoted 7 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Ouch, how could this work so well that far? We need to clear RFLAGS to the reset value as specified by the SDM. Particularly, IF must be off after VM-exit!
Signed-off-by Jan Kiszka <[email protected]>Reviewed-by Gleb Natapov <[email protected]>
Applied, thanks.