diff mbox

drm/i915/kvmgt: Fix compilation error

Message ID 20180712155330.32055-1-michal.winiarski@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michał Winiarski July 12, 2018, 3:53 p.m. UTC
gvt_pin_guest_page extracted some of the gvt_dma_map_page functionality:
commit 79e542f5af79 ("drm/i915/kvmgt: Support setting dma map for huge pages")

And yet, part of it was reintroduced in:
commit 39b4cbadb9a9 ("drm/i915/kvmgt: Check the pfn got from vfio_pin_pages")

Causing kvmgt part to no longer build. Let's remove it.

Reported-by: Tomasz Lis <tomasz.lis@intel.com>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Changbin Du <changbin.du@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Chris Wilson July 12, 2018, 4:35 p.m. UTC | #1
Quoting Michał Winiarski (2018-07-12 16:53:30)
> gvt_pin_guest_page extracted some of the gvt_dma_map_page functionality:
> commit 79e542f5af79 ("drm/i915/kvmgt: Support setting dma map for huge pages")
> 
> And yet, part of it was reintroduced in:
> commit 39b4cbadb9a9 ("drm/i915/kvmgt: Check the pfn got from vfio_pin_pages")

As you pointed out on irc, this is a silent merge conflict between
gvt-fixes and gvt-next.

I've hopefully expunged it from drm-tip (probably not in the preferred
manner) and let's hope it disappears neatly on a future backmerge.
-Chris
Zhenyu Wang July 13, 2018, 1:36 a.m. UTC | #2
On 2018.07.12 17:53:30 +0200, Micha?? Winiarski wrote:
> gvt_pin_guest_page extracted some of the gvt_dma_map_page functionality:
> commit 79e542f5af79 ("drm/i915/kvmgt: Support setting dma map for huge pages")
> 
> And yet, part of it was reintroduced in:
> commit 39b4cbadb9a9 ("drm/i915/kvmgt: Check the pfn got from vfio_pin_pages")
> 
> Causing kvmgt part to no longer build. Let's remove it.
>

yeah, this change is correct. I found it too when merging against
upstreams for gvt staging tree, not caught by conflict though. Once
we backmerge upstream gvt requires this fix.

Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>

Thanks!

> Reported-by: Tomasz Lis <tomasz.lis@intel.com>
> Signed-off-by: Micha?? Winiarski <michal.winiarski@intel.com>
> Cc: Changbin Du <changbin.du@intel.com>
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 718ab307a500..4d2f53ae9f0f 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -185,12 +185,6 @@ static int gvt_dma_map_page(struct intel_vgpu *vgpu, unsigned long gfn,
>  	if (ret)
>  		return ret;
>  
> -	if (!pfn_valid(pfn)) {
> -		gvt_vgpu_err("pfn 0x%lx is not mem backed\n", pfn);
> -		vfio_unpin_pages(mdev_dev(vgpu->vdev.mdev), &gfn, 1);
> -		return -EINVAL;
> -	}
> -
>  	/* Setup DMA mapping. */
>  	*dma_addr = dma_map_page(dev, page, 0, size, PCI_DMA_BIDIRECTIONAL);
>  	ret = dma_mapping_error(dev, *dma_addr);
> -- 
> 2.17.1
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index 718ab307a500..4d2f53ae9f0f 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -185,12 +185,6 @@  static int gvt_dma_map_page(struct intel_vgpu *vgpu, unsigned long gfn,
 	if (ret)
 		return ret;
 
-	if (!pfn_valid(pfn)) {
-		gvt_vgpu_err("pfn 0x%lx is not mem backed\n", pfn);
-		vfio_unpin_pages(mdev_dev(vgpu->vdev.mdev), &gfn, 1);
-		return -EINVAL;
-	}
-
 	/* Setup DMA mapping. */
 	*dma_addr = dma_map_page(dev, page, 0, size, PCI_DMA_BIDIRECTIONAL);
 	ret = dma_mapping_error(dev, *dma_addr);