Skip to content

Commit 71331a1

Browse files
committed
KVM: MMU: Eliminate eperm temporary
'eperm' is no longer used in the walker loop, so we can eliminate it. Reviewed-by: Xiao Guangrong <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 6fd01b7 commit 71331a1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/x86/kvm/paging_tmpl.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
153153
gfn_t table_gfn;
154154
unsigned index, pt_access, pte_access;
155155
gpa_t pte_gpa;
156-
bool eperm;
157156
int offset;
158157
const int write_fault = access & PFERR_WRITE_MASK;
159158
const int user_fault = access & PFERR_USER_MASK;
@@ -165,7 +164,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
165164

166165
trace_kvm_mmu_pagetable_walk(addr, access);
167166
retry_walk:
168-
eperm = false;
169167
walker->level = mmu->root_level;
170168
pte = mmu->get_cr3(vcpu);
171169

@@ -231,8 +229,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
231229
walker->ptes[walker->level - 1] = pte;
232230
} while (!is_last_gpte(mmu, walker->level, pte));
233231

234-
eperm |= permission_fault(mmu, pte_access, access);
235-
if (unlikely(eperm)) {
232+
if (unlikely(permission_fault(mmu, pte_access, access))) {
236233
errcode |= PFERR_PRESENT_MASK;
237234
goto error;
238235
}

0 commit comments

Comments
 (0)