KVM: Use kvm_get_rflags() and kvm_set_rflags() instead of the raw versions
Some rflags bits are owned by the host, not guest, so we need to use kvm_get_rflags() to strip those bits away or kvm_set_rflags() to add them back. Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
@ -2113,7 +2113,7 @@ static int vmx_get_cpl(struct kvm_vcpu *vcpu)
|
||||
if (!is_protmode(vcpu))
|
||||
return 0;
|
||||
|
||||
if (vmx_get_rflags(vcpu) & X86_EFLAGS_VM) /* if virtual 8086 */
|
||||
if (kvm_get_rflags(vcpu) & X86_EFLAGS_VM) /* if virtual 8086 */
|
||||
return 3;
|
||||
|
||||
return vmcs_read16(GUEST_CS_SELECTOR) & 3;
|
||||
|
Reference in New Issue
Block a user