]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/kvm/mmu.c
KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch
[linux-2.6-omap-h63xx.git] / drivers / kvm / mmu.c
index c6f972914f082e9af20ca6af54d155104ef5d2ba..be793770f31b3045cef6beb7c70ec6d6864fa3f1 100644 (file)
@@ -143,6 +143,7 @@ static int dbg = 1;
 #define PFERR_PRESENT_MASK (1U << 0)
 #define PFERR_WRITE_MASK (1U << 1)
 #define PFERR_USER_MASK (1U << 2)
+#define PFERR_FETCH_MASK (1U << 4)
 
 #define PT64_ROOT_LEVEL 4
 #define PT32_ROOT_LEVEL 2
@@ -168,6 +169,11 @@ static int is_cpuid_PSE36(void)
        return 1;
 }
 
+static int is_nx(struct kvm_vcpu *vcpu)
+{
+       return vcpu->shadow_efer & EFER_NX;
+}
+
 static int is_present_pte(unsigned long pte)
 {
        return pte & PT_PRESENT_MASK;
@@ -327,7 +333,7 @@ static void rmap_desc_remove_entry(struct kvm_vcpu *vcpu,
        for (j = RMAP_EXT - 1; !desc->shadow_ptes[j] && j > i; --j)
                ;
        desc->shadow_ptes[i] = desc->shadow_ptes[j];
-       desc->shadow_ptes[j] = 0;
+       desc->shadow_ptes[j] = NULL;
        if (j != 0)
                return;
        if (!prev_desc && !desc->more)
@@ -992,16 +998,6 @@ static inline int fix_read_pf(u64 *shadow_ent)
        return 0;
 }
 
-static int may_access(u64 pte, int write, int user)
-{
-
-       if (user && !(pte & PT_USER_MASK))
-               return 0;
-       if (write && !(pte & PT_WRITABLE_MASK))
-               return 0;
-       return 1;
-}
-
 static void paging_free(struct kvm_vcpu *vcpu)
 {
        nonpaging_free(vcpu);