Commit 71331a1d authored by Avi Kivity's avatar Avi Kivity

KVM: MMU: Eliminate eperm temporary

'eperm' is no longer used in the walker loop, so we can eliminate it.
Reviewed-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 6fd01b71
...@@ -153,7 +153,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -153,7 +153,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
gfn_t table_gfn; gfn_t table_gfn;
unsigned index, pt_access, pte_access; unsigned index, pt_access, pte_access;
gpa_t pte_gpa; gpa_t pte_gpa;
bool eperm;
int offset; int offset;
const int write_fault = access & PFERR_WRITE_MASK; const int write_fault = access & PFERR_WRITE_MASK;
const int user_fault = access & PFERR_USER_MASK; const int user_fault = access & PFERR_USER_MASK;
...@@ -165,7 +164,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -165,7 +164,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
trace_kvm_mmu_pagetable_walk(addr, access); trace_kvm_mmu_pagetable_walk(addr, access);
retry_walk: retry_walk:
eperm = false;
walker->level = mmu->root_level; walker->level = mmu->root_level;
pte = mmu->get_cr3(vcpu); pte = mmu->get_cr3(vcpu);
...@@ -231,8 +229,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, ...@@ -231,8 +229,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
walker->ptes[walker->level - 1] = pte; walker->ptes[walker->level - 1] = pte;
} while (!is_last_gpte(mmu, walker->level, pte)); } while (!is_last_gpte(mmu, walker->level, pte));
eperm |= permission_fault(mmu, pte_access, access); if (unlikely(permission_fault(mmu, pte_access, access))) {
if (unlikely(eperm)) {
errcode |= PFERR_PRESENT_MASK; errcode |= PFERR_PRESENT_MASK;
goto error; goto error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment