Skip to content

Commit

Permalink
KVM: MMU: Eliminate pointless temporary 'ac'
Browse files Browse the repository at this point in the history
'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 <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
avikivity committed Sep 20, 2012
1 parent b514c30 commit c542151
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/x86/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
u16 errcode = 0;
gpa_t real_gpa;
gfn_t gfn;
u32 ac;

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

ac = write_fault | fetch_fault | user_fault;

real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), ac);
real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), access);
if (real_gpa == UNMAPPED_GVA)
return 0;

Expand Down

0 comments on commit c542151

Please sign in to comment.