Skip to content

Commit 8c63e8c

Browse files
dmatlacksean-jc
authored andcommitted
KVM: x86/mmu: Rename kvm_flush_remote_tlbs_with_address()
Rename kvm_flush_remote_tlbs_with_address() to kvm_flush_remote_tlbs_range(). This name is shorter, which reduces the number of callsites that need to be broken up across multiple lines, and more readable since it conveys a range of memory is being flushed rather than a single address. No functional change intended. Signed-off-by: David Matlack <dmatlack@google.com> Link: https://lore.kernel.org/r/20230126184025.2294823-5-dmatlack@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 28e4b45 commit 8c63e8c

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ static inline bool kvm_available_flush_tlb_with_range(void)
261261
return kvm_x86_ops.tlb_remote_flush_with_range;
262262
}
263263

264-
void kvm_flush_remote_tlbs_with_address(struct kvm *kvm,
265-
u64 start_gfn, u64 pages)
264+
void kvm_flush_remote_tlbs_range(struct kvm *kvm, u64 start_gfn, u64 pages)
266265
{
267266
struct kvm_tlb_range range;
268267
int ret = -EOPNOTSUPP;
@@ -5922,9 +5921,8 @@ slot_handle_level_range(struct kvm *kvm, const struct kvm_memory_slot *memslot,
59225921

59235922
if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) {
59245923
if (flush && flush_on_yield) {
5925-
kvm_flush_remote_tlbs_with_address(kvm,
5926-
start_gfn,
5927-
iterator.gfn - start_gfn + 1);
5924+
kvm_flush_remote_tlbs_range(kvm, start_gfn,
5925+
iterator.gfn - start_gfn + 1);
59285926
flush = false;
59295927
}
59305928
cond_resched_rwlock_write(&kvm->mmu_lock);
@@ -6279,8 +6277,7 @@ void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end)
62796277
}
62806278

62816279
if (flush)
6282-
kvm_flush_remote_tlbs_with_address(kvm, gfn_start,
6283-
gfn_end - gfn_start);
6280+
kvm_flush_remote_tlbs_range(kvm, gfn_start, gfn_end - gfn_start);
62846281

62856282
kvm_mmu_invalidate_end(kvm, 0, -1ul);
62866283

@@ -6669,8 +6666,7 @@ void kvm_arch_flush_remote_tlbs_memslot(struct kvm *kvm,
66696666
* is observed by any other operation on the same memslot.
66706667
*/
66716668
lockdep_assert_held(&kvm->slots_lock);
6672-
kvm_flush_remote_tlbs_with_address(kvm, memslot->base_gfn,
6673-
memslot->npages);
6669+
kvm_flush_remote_tlbs_range(kvm, memslot->base_gfn, memslot->npages);
66746670
}
66756671

66766672
void kvm_mmu_slot_leaf_clear_dirty(struct kvm *kvm,

arch/x86/kvm/mmu/mmu_internal.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,13 @@ bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
170170
struct kvm_memory_slot *slot, u64 gfn,
171171
int min_level);
172172

173-
void kvm_flush_remote_tlbs_with_address(struct kvm *kvm,
174-
u64 start_gfn, u64 pages);
173+
void kvm_flush_remote_tlbs_range(struct kvm *kvm, u64 start_gfn, u64 pages);
175174

176175
/* Flush the given page (huge or not) of guest memory. */
177176
static inline void kvm_flush_remote_tlbs_gfn(struct kvm *kvm, gfn_t gfn, int level)
178177
{
179-
kvm_flush_remote_tlbs_with_address(kvm, gfn_round_for_level(gfn, level),
180-
KVM_PAGES_PER_HPAGE(level));
178+
kvm_flush_remote_tlbs_range(kvm, gfn_round_for_level(gfn, level),
179+
KVM_PAGES_PER_HPAGE(level));
181180
}
182181

183182
unsigned int pte_list_count(struct kvm_rmap_head *rmap_head);

0 commit comments

Comments
 (0)