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:
Avi Kivity
2010-08-02 15:30:20 +03:00
parent 0ee8dcb87e
commit f6e7847589
3 changed files with 12 additions and 12 deletions

View File

@ -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;