diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 134ea7b1c585..95a64d1dccc7 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -153,7 +153,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, | |||
153 | gfn_t table_gfn; | 153 | gfn_t table_gfn; |
154 | unsigned index, pt_access, pte_access; | 154 | unsigned index, pt_access, pte_access; |
155 | gpa_t pte_gpa; | 155 | gpa_t pte_gpa; |
156 | bool eperm; | ||
157 | int offset; | 156 | int offset; |
158 | const int write_fault = access & PFERR_WRITE_MASK; | 157 | const int write_fault = access & PFERR_WRITE_MASK; |
159 | const int user_fault = access & PFERR_USER_MASK; | 158 | const int user_fault = access & PFERR_USER_MASK; |
@@ -165,7 +164,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, | |||
165 | 164 | ||
166 | trace_kvm_mmu_pagetable_walk(addr, access); | 165 | trace_kvm_mmu_pagetable_walk(addr, access); |
167 | retry_walk: | 166 | retry_walk: |
168 | eperm = false; | ||
169 | walker->level = mmu->root_level; | 167 | walker->level = mmu->root_level; |
170 | pte = mmu->get_cr3(vcpu); | 168 | pte = mmu->get_cr3(vcpu); |
171 | 169 | ||
@@ -231,8 +229,7 @@ retry_walk: | |||
231 | walker->ptes[walker->level - 1] = pte; | 229 | walker->ptes[walker->level - 1] = pte; |
232 | } while (!is_last_gpte(mmu, walker->level, pte)); | 230 | } while (!is_last_gpte(mmu, walker->level, pte)); |
233 | 231 | ||
234 | eperm |= permission_fault(mmu, pte_access, access); | 232 | if (unlikely(permission_fault(mmu, pte_access, access))) { |
235 | if (unlikely(eperm)) { | ||
236 | errcode |= PFERR_PRESENT_MASK; | 233 | errcode |= PFERR_PRESENT_MASK; |
237 | goto error; | 234 | goto error; |
238 | } | 235 | } |