Skip to content

Commit b271e17

Browse files
sean-jcbonzini
authored andcommitted
KVM: drm/i915/gvt: Drop @vcpu from KVM's ->track_write() hook
Drop @vcpu from KVM's ->track_write() hook provided for external users of the page-track APIs now that KVM itself doesn't use the page-track mechanism. Reviewed-by: Yan Zhao <[email protected]> Tested-by: Yongwei Ma <[email protected]> Reviewed-by: Zhi Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 9328444 commit b271e17

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

arch/x86/include/asm/kvm_page_track.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ struct kvm_page_track_notifier_node {
2626
* It is called when guest is writing the write-tracked page
2727
* and write emulation is finished at that time.
2828
*
29-
* @vcpu: the vcpu where the write access happened.
3029
* @gpa: the physical address written by guest.
3130
* @new: the data was written to the address.
3231
* @bytes: the written length.
3332
* @node: this node
3433
*/
35-
void (*track_write)(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
36-
int bytes, struct kvm_page_track_notifier_node *node);
34+
void (*track_write)(gpa_t gpa, const u8 *new, int bytes,
35+
struct kvm_page_track_notifier_node *node);
3736
/*
3837
* It is called when memory slot is being moved or removed
3938
* users can drop write-protection for the pages in that memory slot

arch/x86/kvm/mmu/page_track.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new,
272272
hlist_for_each_entry_srcu(n, &head->track_notifier_list, node,
273273
srcu_read_lock_held(&head->track_srcu))
274274
if (n->track_write)
275-
n->track_write(vcpu, gpa, new, bytes, n);
275+
n->track_write(gpa, new, bytes, n);
276276
srcu_read_unlock(&head->track_srcu, idx);
277277

278278
kvm_mmu_track_write(vcpu, gpa, new, bytes);

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ struct gvt_dma {
106106
#define vfio_dev_to_vgpu(vfio_dev) \
107107
container_of((vfio_dev), struct intel_vgpu, vfio_device)
108108

109-
static void kvmgt_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa,
110-
const u8 *val, int len,
111-
struct kvm_page_track_notifier_node *node);
109+
static void kvmgt_page_track_write(gpa_t gpa, const u8 *val, int len,
110+
struct kvm_page_track_notifier_node *node);
112111
static void kvmgt_page_track_flush_slot(struct kvm *kvm,
113112
struct kvm_memory_slot *slot,
114113
struct kvm_page_track_notifier_node *node);
@@ -1603,9 +1602,8 @@ int intel_gvt_page_track_remove(struct intel_vgpu *info, u64 gfn)
16031602
return 0;
16041603
}
16051604

1606-
static void kvmgt_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa,
1607-
const u8 *val, int len,
1608-
struct kvm_page_track_notifier_node *node)
1605+
static void kvmgt_page_track_write(gpa_t gpa, const u8 *val, int len,
1606+
struct kvm_page_track_notifier_node *node)
16091607
{
16101608
struct intel_vgpu *info =
16111609
container_of(node, struct intel_vgpu, track_node);

0 commit comments

Comments
 (0)