Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kvm / paging_tmpl.h
index 0f67d7e2480074f9d313e0f6af43bd9b64c5a555..736e6ab8784d339d7af10bda1324f9a8fbe3c618 100644 (file)
@@ -128,14 +128,6 @@ static inline void FNAME(protect_clean_gpte)(unsigned *access, unsigned gpte)
        *access &= mask;
 }
 
-static bool FNAME(is_rsvd_bits_set)(struct kvm_mmu *mmu, u64 gpte, int level)
-{
-       int bit7 = (gpte >> 7) & 1, low6 = gpte & 0x3f;
-
-       return (gpte & mmu->rsvd_bits_mask[bit7][level-1]) |
-               ((mmu->bad_mt_xwr & (1ull << low6)) != 0);
-}
-
 static inline int FNAME(is_present_gpte)(unsigned long pte)
 {
 #if PTTYPE != PTTYPE_EPT
@@ -172,7 +164,7 @@ static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
                                  struct kvm_mmu_page *sp, u64 *spte,
                                  u64 gpte)
 {
-       if (FNAME(is_rsvd_bits_set)(&vcpu->arch.mmu, gpte, PT_PAGE_TABLE_LEVEL))
+       if (is_rsvd_bits_set(&vcpu->arch.mmu, gpte, PT_PAGE_TABLE_LEVEL))
                goto no_present;
 
        if (!FNAME(is_present_gpte)(gpte))
@@ -353,8 +345,7 @@ retry_walk:
                if (unlikely(!FNAME(is_present_gpte)(pte)))
                        goto error;
 
-               if (unlikely(FNAME(is_rsvd_bits_set)(mmu, pte,
-                                                    walker->level))) {
+               if (unlikely(is_rsvd_bits_set(mmu, pte, walker->level))) {
                        errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK;
                        goto error;
                }