Commit c1b91493 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: x86/mmu: Add typedefs for rmap/iter handlers

Add typedefs for the MMU handlers that are invoked when walking the MMU
SPTEs (rmaps in legacy MMU) to act on a host virtual address range.

No functional change intended.

Cc: Ben Gardon <bgardon@google.com>
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20210226010329.1766033-5-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent e12b785e
...@@ -1424,17 +1424,15 @@ static void slot_rmap_walk_next(struct slot_rmap_walk_iterator *iterator) ...@@ -1424,17 +1424,15 @@ static void slot_rmap_walk_next(struct slot_rmap_walk_iterator *iterator)
slot_rmap_walk_okay(_iter_); \ slot_rmap_walk_okay(_iter_); \
slot_rmap_walk_next(_iter_)) slot_rmap_walk_next(_iter_))
static __always_inline int typedef int (*rmap_handler_t)(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
kvm_handle_hva_range(struct kvm *kvm, struct kvm_memory_slot *slot, gfn_t gfn,
unsigned long start, int level, unsigned long data);
unsigned long end,
unsigned long data, static __always_inline int kvm_handle_hva_range(struct kvm *kvm,
int (*handler)(struct kvm *kvm, unsigned long start,
struct kvm_rmap_head *rmap_head, unsigned long end,
struct kvm_memory_slot *slot, unsigned long data,
gfn_t gfn, rmap_handler_t handler)
int level,
unsigned long data))
{ {
struct kvm_memslots *slots; struct kvm_memslots *slots;
struct kvm_memory_slot *memslot; struct kvm_memory_slot *memslot;
...@@ -1473,12 +1471,7 @@ kvm_handle_hva_range(struct kvm *kvm, ...@@ -1473,12 +1471,7 @@ kvm_handle_hva_range(struct kvm *kvm,
} }
static int kvm_handle_hva(struct kvm *kvm, unsigned long hva, static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
unsigned long data, unsigned long data, rmap_handler_t handler)
int (*handler)(struct kvm *kvm,
struct kvm_rmap_head *rmap_head,
struct kvm_memory_slot *slot,
gfn_t gfn, int level,
unsigned long data))
{ {
return kvm_handle_hva_range(kvm, hva, hva + 1, data, handler); return kvm_handle_hva_range(kvm, hva, hva + 1, data, handler);
} }
......
...@@ -877,17 +877,15 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, ...@@ -877,17 +877,15 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code,
return ret; return ret;
} }
static __always_inline int typedef int (*tdp_handler_t)(struct kvm *kvm, struct kvm_memory_slot *slot,
kvm_tdp_mmu_handle_hva_range(struct kvm *kvm, struct kvm_mmu_page *root, gfn_t start, gfn_t end,
unsigned long start, unsigned long data);
unsigned long end,
unsigned long data, static __always_inline int kvm_tdp_mmu_handle_hva_range(struct kvm *kvm,
int (*handler)(struct kvm *kvm, unsigned long start,
struct kvm_memory_slot *slot, unsigned long end,
struct kvm_mmu_page *root, unsigned long data,
gfn_t start, tdp_handler_t handler)
gfn_t end,
unsigned long data))
{ {
struct kvm_memslots *slots; struct kvm_memslots *slots;
struct kvm_memory_slot *memslot; struct kvm_memory_slot *memslot;
......
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