Skip to content

Commit 09c8726

Browse files
sean-jcbonzini
authored andcommitted
drm/i915/gvt: Drop final dependencies on KVM internal details
Open code gpa_to_gfn() in kvmgt_page_track_write() and drop KVMGT's dependency on kvm_host.h, i.e. include only kvm_page_track.h. KVMGT assumes "gfn == gpa >> PAGE_SHIFT" all over the place, including a few lines below in the same function with the same gpa, i.e. there's no reason to use KVM's helper for this one case. No functional change intended. Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Tested-by: Yongwei Ma <yongwei.ma@intel.com> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com> Link: https://lore.kernel.org/r/20230729013535.1070024-30-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent f22b1e8 commit 09c8726

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/gpu/drm/i915/gvt/gvt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
#define _GVT_H_
3535

3636
#include <uapi/linux/pci_regs.h>
37-
#include <linux/kvm_host.h>
3837
#include <linux/vfio.h>
3938
#include <linux/mdev.h>
4039

40+
#include <asm/kvm_page_track.h>
41+
4142
#include "i915_drv.h"
4243
#include "intel_gvt.h"
4344

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ static void kvmgt_page_track_write(gpa_t gpa, const u8 *val, int len,
15851585

15861586
mutex_lock(&info->vgpu_lock);
15871587

1588-
if (kvmgt_gfn_is_write_protected(info, gpa_to_gfn(gpa)))
1588+
if (kvmgt_gfn_is_write_protected(info, gpa >> PAGE_SHIFT))
15891589
intel_vgpu_page_track_handler(info, gpa,
15901590
(void *)val, len);
15911591

0 commit comments

Comments
 (0)