Commit 9d4655da authored by David Matlack's avatar David Matlack Committed by Sean Christopherson

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: default avatarDavid 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: default avatarSean Christopherson <seanjc@google.com>
parent 8c63e8c2
...@@ -261,13 +261,14 @@ static inline bool kvm_available_flush_tlb_with_range(void) ...@@ -261,13 +261,14 @@ static inline bool kvm_available_flush_tlb_with_range(void)
return kvm_x86_ops.tlb_remote_flush_with_range; return kvm_x86_ops.tlb_remote_flush_with_range;
} }
void kvm_flush_remote_tlbs_range(struct kvm *kvm, u64 start_gfn, u64 pages) void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn,
gfn_t nr_pages)
{ {
struct kvm_tlb_range range; struct kvm_tlb_range range;
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
range.start_gfn = start_gfn; range.start_gfn = start_gfn;
range.pages = pages; range.pages = nr_pages;
if (kvm_x86_ops.tlb_remote_flush_with_range) if (kvm_x86_ops.tlb_remote_flush_with_range)
ret = static_call(kvm_x86_tlb_remote_flush_with_range)(kvm, &range); ret = static_call(kvm_x86_tlb_remote_flush_with_range)(kvm, &range);
......
...@@ -170,7 +170,8 @@ bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm, ...@@ -170,7 +170,8 @@ bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
struct kvm_memory_slot *slot, u64 gfn, struct kvm_memory_slot *slot, u64 gfn,
int min_level); int min_level);
void kvm_flush_remote_tlbs_range(struct kvm *kvm, u64 start_gfn, u64 pages); void kvm_flush_remote_tlbs_range(struct kvm *kvm, gfn_t start_gfn,
gfn_t nr_pages);
/* Flush the given page (huge or not) of guest memory. */ /* Flush the given page (huge or not) of guest memory. */
static inline void kvm_flush_remote_tlbs_gfn(struct kvm *kvm, gfn_t gfn, int level) static inline void kvm_flush_remote_tlbs_gfn(struct kvm *kvm, gfn_t gfn, int level)
......
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