Commit eb5cd7ff authored by Paolo Bonzini's avatar Paolo Bonzini

KVM: MMU: remove unnecessary argument to mmu_set_spte

The level of the new SPTE can be found in the kvm_mmu_page struct; there
is no need to pass it down.
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ad67e480
......@@ -2675,11 +2675,12 @@ int mmu_try_to_unsync_pages(struct kvm_vcpu *vcpu, gfn_t gfn, bool can_unsync,
}
static int mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
unsigned int pte_access, bool write_fault, int level,
unsigned int pte_access, bool write_fault,
gfn_t gfn, kvm_pfn_t pfn, bool speculative,
bool host_writable)
{
struct kvm_mmu_page *sp = sptep_to_sp(sptep);
int level = sp->role.level;
int was_rmapped = 0;
int ret = RET_PF_FIXED;
bool flush = false;
......@@ -2777,7 +2778,7 @@ static int direct_pte_prefetch_many(struct kvm_vcpu *vcpu,
return -1;
for (i = 0; i < ret; i++, gfn++, start++) {
mmu_set_spte(vcpu, start, access, false, sp->role.level, gfn,
mmu_set_spte(vcpu, start, access, false, gfn,
page_to_pfn(pages[i]), true, true);
put_page(pages[i]);
}
......@@ -2980,7 +2981,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
return -EFAULT;
ret = mmu_set_spte(vcpu, it.sptep, ACC_ALL,
fault->write, fault->goal_level, base_gfn, fault->pfn,
fault->write, base_gfn, fault->pfn,
fault->prefault, fault->map_writable);
if (ret == RET_PF_SPURIOUS)
return ret;
......
......@@ -582,7 +582,7 @@ FNAME(prefetch_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
* we call mmu_set_spte() with host_writable = true because
* pte_prefetch_gfn_to_pfn always gets a writable pfn.
*/
mmu_set_spte(vcpu, spte, pte_access, false, PG_LEVEL_4K, gfn, pfn,
mmu_set_spte(vcpu, spte, pte_access, false, gfn, pfn,
true, true);
kvm_release_pfn_clean(pfn);
......@@ -764,8 +764,8 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
return -EFAULT;
ret = mmu_set_spte(vcpu, it.sptep, gw->pte_access, fault->write,
fault->goal_level, base_gfn, fault->pfn,
fault->prefault, fault->map_writable);
base_gfn, fault->pfn, fault->prefault,
fault->map_writable);
if (ret == RET_PF_SPURIOUS)
return ret;
......
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