提交 e4b35cc9 编写于 作者: T Takuya Yoshikawa 提交者: Avi Kivity

KVM: MMU: Remove unused kvm parameter from rmap_next()

Signed-off-by: NTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 9373e2c0
...@@ -988,7 +988,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn) ...@@ -988,7 +988,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)
return pte_list_add(vcpu, spte, rmapp); return pte_list_add(vcpu, spte, rmapp);
} }
static u64 *rmap_next(struct kvm *kvm, unsigned long *rmapp, u64 *spte) static u64 *rmap_next(unsigned long *rmapp, u64 *spte)
{ {
return pte_list_next(rmapp, spte); return pte_list_next(rmapp, spte);
} }
...@@ -1019,7 +1019,7 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn, ...@@ -1019,7 +1019,7 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn,
int i, write_protected = 0; int i, write_protected = 0;
rmapp = __gfn_to_rmap(gfn, PT_PAGE_TABLE_LEVEL, slot); rmapp = __gfn_to_rmap(gfn, PT_PAGE_TABLE_LEVEL, slot);
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
BUG_ON(!(*spte & PT_PRESENT_MASK)); BUG_ON(!(*spte & PT_PRESENT_MASK));
rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
...@@ -1027,14 +1027,14 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn, ...@@ -1027,14 +1027,14 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn,
mmu_spte_update(spte, *spte & ~PT_WRITABLE_MASK); mmu_spte_update(spte, *spte & ~PT_WRITABLE_MASK);
write_protected = 1; write_protected = 1;
} }
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
/* check for huge page mappings */ /* check for huge page mappings */
for (i = PT_DIRECTORY_LEVEL; for (i = PT_DIRECTORY_LEVEL;
i < PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES; ++i) { i < PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES; ++i) {
rmapp = __gfn_to_rmap(gfn, i, slot); rmapp = __gfn_to_rmap(gfn, i, slot);
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
BUG_ON(!(*spte & PT_PRESENT_MASK)); BUG_ON(!(*spte & PT_PRESENT_MASK));
BUG_ON(!is_large_pte(*spte)); BUG_ON(!is_large_pte(*spte));
...@@ -1045,7 +1045,7 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn, ...@@ -1045,7 +1045,7 @@ int kvm_mmu_rmap_write_protect(struct kvm *kvm, u64 gfn,
spte = NULL; spte = NULL;
write_protected = 1; write_protected = 1;
} }
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
} }
...@@ -1066,7 +1066,7 @@ static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1066,7 +1066,7 @@ static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp,
u64 *spte; u64 *spte;
int need_tlb_flush = 0; int need_tlb_flush = 0;
while ((spte = rmap_next(kvm, rmapp, NULL))) { while ((spte = rmap_next(rmapp, NULL))) {
BUG_ON(!(*spte & PT_PRESENT_MASK)); BUG_ON(!(*spte & PT_PRESENT_MASK));
rmap_printk("kvm_rmap_unmap_hva: spte %p %llx\n", spte, *spte); rmap_printk("kvm_rmap_unmap_hva: spte %p %llx\n", spte, *spte);
drop_spte(kvm, spte); drop_spte(kvm, spte);
...@@ -1085,14 +1085,14 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1085,14 +1085,14 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp,
WARN_ON(pte_huge(*ptep)); WARN_ON(pte_huge(*ptep));
new_pfn = pte_pfn(*ptep); new_pfn = pte_pfn(*ptep);
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
BUG_ON(!is_shadow_present_pte(*spte)); BUG_ON(!is_shadow_present_pte(*spte));
rmap_printk("kvm_set_pte_rmapp: spte %p %llx\n", spte, *spte); rmap_printk("kvm_set_pte_rmapp: spte %p %llx\n", spte, *spte);
need_flush = 1; need_flush = 1;
if (pte_write(*ptep)) { if (pte_write(*ptep)) {
drop_spte(kvm, spte); drop_spte(kvm, spte);
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
} else { } else {
new_spte = *spte &~ (PT64_BASE_ADDR_MASK); new_spte = *spte &~ (PT64_BASE_ADDR_MASK);
new_spte |= (u64)new_pfn << PAGE_SHIFT; new_spte |= (u64)new_pfn << PAGE_SHIFT;
...@@ -1102,7 +1102,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1102,7 +1102,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp,
new_spte &= ~shadow_accessed_mask; new_spte &= ~shadow_accessed_mask;
mmu_spte_clear_track_bits(spte); mmu_spte_clear_track_bits(spte);
mmu_spte_set(spte, new_spte); mmu_spte_set(spte, new_spte);
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
} }
if (need_flush) if (need_flush)
...@@ -1176,7 +1176,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1176,7 +1176,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
if (!shadow_accessed_mask) if (!shadow_accessed_mask)
return kvm_unmap_rmapp(kvm, rmapp, data); return kvm_unmap_rmapp(kvm, rmapp, data);
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
int _young; int _young;
u64 _spte = *spte; u64 _spte = *spte;
...@@ -1186,7 +1186,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1186,7 +1186,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
young = 1; young = 1;
clear_bit(PT_ACCESSED_SHIFT, (unsigned long *)spte); clear_bit(PT_ACCESSED_SHIFT, (unsigned long *)spte);
} }
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
return young; return young;
} }
...@@ -1205,7 +1205,7 @@ static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1205,7 +1205,7 @@ static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
if (!shadow_accessed_mask) if (!shadow_accessed_mask)
goto out; goto out;
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
u64 _spte = *spte; u64 _spte = *spte;
BUG_ON(!(_spte & PT_PRESENT_MASK)); BUG_ON(!(_spte & PT_PRESENT_MASK));
...@@ -1214,7 +1214,7 @@ static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp, ...@@ -1214,7 +1214,7 @@ static int kvm_test_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
young = 1; young = 1;
break; break;
} }
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
out: out:
return young; return young;
......
...@@ -200,13 +200,13 @@ static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp) ...@@ -200,13 +200,13 @@ static void audit_write_protection(struct kvm *kvm, struct kvm_mmu_page *sp)
slot = gfn_to_memslot(kvm, sp->gfn); slot = gfn_to_memslot(kvm, sp->gfn);
rmapp = &slot->rmap[sp->gfn - slot->base_gfn]; rmapp = &slot->rmap[sp->gfn - slot->base_gfn];
spte = rmap_next(kvm, rmapp, NULL); spte = rmap_next(rmapp, NULL);
while (spte) { while (spte) {
if (is_writable_pte(*spte)) if (is_writable_pte(*spte))
audit_printk(kvm, "shadow page has writable " audit_printk(kvm, "shadow page has writable "
"mappings: gfn %llx role %x\n", "mappings: gfn %llx role %x\n",
sp->gfn, sp->role.word); sp->gfn, sp->role.word);
spte = rmap_next(kvm, rmapp, spte); spte = rmap_next(rmapp, spte);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册