[PATCH] KVM: Simplify is_long_mode()
Instead of doing tricky stuff with the arch dependent virtualization registers, take a peek at the guest's efer. This simlifies some code, and fixes some confusion in the mmu branch. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
1e885461f0
commit
a9058ecd3c
@@ -578,7 +578,7 @@ static int init_kvm_mmu(struct kvm_vcpu *vcpu)
|
||||
|
||||
if (!is_paging(vcpu))
|
||||
return nonpaging_init_context(vcpu);
|
||||
else if (kvm_arch_ops->is_long_mode(vcpu))
|
||||
else if (is_long_mode(vcpu))
|
||||
return paging64_init_context(vcpu);
|
||||
else if (is_pae(vcpu))
|
||||
return paging32E_init_context(vcpu);
|
||||
|
Reference in New Issue
Block a user