Skip to content

Commit 9d4655d

Browse files
dmatlacksean-jc
authored andcommitted
KVM: x86/mmu: Use gfn_t in kvm_flush_remote_tlbs_range()
Use gfn_t instead of u64 for kvm_flush_remote_tlbs_range()'s parameters, since gfn_t is the standard type for GFNs throughout KVM. Opportunistically rename pages to nr_pages to make its role even more obvious. No functional change intended. Signed-off-by: David Matlack <dmatlack@google.com> Link: https://lore.kernel.org/r/20230126184025.2294823-6-dmatlack@google.com [sean: convert pages to gfn_t too, and rename] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 8c63e8c commit 9d4655d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,14 @@ 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_range(struct kvm *kvm, u64 start_gfn, u64 pages)
264+
void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn,
265+
gfn_t nr_pages)
265266
{
266267
struct kvm_tlb_range range;
267268
int ret = -EOPNOTSUPP;
268269

269270
range.start_gfn = start_gfn;
270-
range.pages = pages;
271+
range.pages = nr_pages;
271272

272273
if (kvm_x86_ops.tlb_remote_flush_with_range)
273274
ret = static_call(kvm_x86_tlb_remote_flush_with_range)(kvm, &range);

arch/x86/kvm/mmu/mmu_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ 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_range(struct kvm *kvm, u64 start_gfn, u64 pages);
173+
void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn,
174+
gfn_t nr_pages);
174175

175176
/* Flush the given page (huge or not) of guest memory. */
176177
static inline void kvm_flush_remote_tlbs_gfn(struct kvm *kvm, gfn_t gfn, int level)

0 commit comments

Comments
 (0)