KVM: VMX: Adjust rflags if in real mode emulation
We set rflags.vm86 when virtualizing real mode to do through vm8086 mode; so we need to take it out again when reading rflags. Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
6621fbc2c6
commit
345dcaa8fd
1 changed files with 6 additions and 1 deletions
|
@ -781,7 +781,12 @@ static void vmx_fpu_deactivate(struct kvm_vcpu *vcpu)
|
||||||
|
|
||||||
static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu)
|
static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu)
|
||||||
{
|
{
|
||||||
return vmcs_readl(GUEST_RFLAGS);
|
unsigned long rflags;
|
||||||
|
|
||||||
|
rflags = vmcs_readl(GUEST_RFLAGS);
|
||||||
|
if (to_vmx(vcpu)->rmode.vm86_active)
|
||||||
|
rflags &= ~(unsigned long)(X86_EFLAGS_IOPL | X86_EFLAGS_VM);
|
||||||
|
return rflags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
|
static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue