]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/kvm/x86.h
KVM: MMU: Add 5 level EPT & Shadow page table support.
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / kvm / x86.h
index 113460370a7f6692fd0a10c79f1d419e866a0f36..69de8bf48178d3aaf461dc088931c2b4ed3ee0c0 100644 (file)
@@ -62,6 +62,16 @@ static inline bool is_64_bit_mode(struct kvm_vcpu *vcpu)
        return cs_l;
 }
 
+static inline bool is_la57_mode(struct kvm_vcpu *vcpu)
+{
+#ifdef CONFIG_X86_64
+       return (vcpu->arch.efer & EFER_LMA) &&
+                kvm_read_cr4_bits(vcpu, X86_CR4_LA57);
+#else
+       return 0;
+#endif
+}
+
 static inline bool mmu_is_nested(struct kvm_vcpu *vcpu)
 {
        return vcpu->arch.walk_mmu == &vcpu->arch.nested_mmu;