Skip to content

Commit c542151

Browse files
committed
KVM: MMU: Eliminate pointless temporary 'ac'
'ac' essentially reconstructs the 'access' variable we already have, except for the PFERR_PRESENT_MASK and PFERR_RSVD_MASK. As these are not used by callees, just use 'access' directly. Reviewed-by: Xiao Guangrong <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent b514c30 commit c542151

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
@@ -160,7 +160,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
160160
u16 errcode = 0;
161161
gpa_t real_gpa;
162162
gfn_t gfn;
163-
u32 ac;
164163

165164
trace_kvm_mmu_pagetable_walk(addr, access);
166165
retry_walk:
@@ -242,9 +241,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
242241
if (PTTYPE == 32 && walker->level == PT_DIRECTORY_LEVEL && is_cpuid_PSE36())
243242
gfn += pse36_gfn_delta(pte);
244243

245-
ac = write_fault | fetch_fault | user_fault;
246-
247-
real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), ac);
244+
real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), access);
248245
if (real_gpa == UNMAPPED_GVA)
249246
return 0;
250247

0 commit comments

Comments
 (0)