Skip to contentSkip to conversation

vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV

PATCH In review Arnd Bergmann 6 participants 8 messages Apr 22, 2021 – Apr 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
---
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/Kconfig +1 -1
index 7a5b7a93d33e..791cc9556863 100644
@@ -111,7 +111,7 @@ config DRM_I915_GVT
 	bool "Enable Intel GVT-g graphics virtualization host support"
 	depends on DRM_I915
 	depends on 64BIT
-	depends on VFIO_MDEV
+	depends on VFIO_MDEV=y || VFIO_MDEV=DRM_I915
 	default n
 	help
 	  Choose this option if you want to enable Intel GVT-g graphics
Signature · 6 lines
2.29.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 6 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
---
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

Jason
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#2 lore raw
Cc gvt list & maintainers
Quoted 34 lines · Jason Gunthorpe
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 6 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
---
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

Jason

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#3 lore raw
In reply to Jason Gunthorpe
Quoted 26 lines · Jason Gunthorpe
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 6 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
---
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

I don't really want this mess to propagate further. We should move mdev related stuff to kvmgt module instead, so not pretend any more to possibly use that for other hypervisor..

Sorry that I didn't realize this issue when Jason proposed this. Let me do the left cleanup.

Thanks

#4 lore raw
Quoted 34 lines · Zhenyu Wang
Quoted 25 lines · Jason Gunthorpe
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 5 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

Quoted 6 lines

I don't really want this mess to propagate further. We should move mdev related stuff to kvmgt module instead, so not pretend any more to possibly use that for other hypervisor..

Sorry that I didn't realize this issue when Jason proposed this. Let me do the left cleanup.

It would be good, but Alex should still take this patch for the upcoming merge window, you can revert it when you do all the cleanups

Jason
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 39 lines · On Fri, 23 Apr 2021 09:07:09 -0300 Jason Gunthorpe <[email protected]> wrote:
Quoted 38 lines · Zhenyu Wang
Quoted 25 lines · Jason Gunthorpe
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 5 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)  
Quoted 7 lines

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

I don't really want this mess to propagate further. We should move mdev related stuff to kvmgt module instead, so not pretend any more to possibly use that for other hypervisor..

Quoted 5 lines
Quoted 2 lines

Sorry that I didn't realize this issue when Jason proposed this. Let me do the left cleanup.

It would be good, but Alex should still take this patch for the upcoming merge window, you can revert it when you do all the cleanups

I can include it, but I'll wait for confirmation from Zhenyu. Thanks,

Alex

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by
#6 lore raw
Quoted 42 lines · Alex Williamson
Quoted 39 lines · On Fri, 23 Apr 2021 09:07:09 -0300 Jason Gunthorpe <[email protected]> wrote:
Quoted 38 lines · Zhenyu Wang
Quoted 25 lines · Jason Gunthorpe
Quoted 18 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The Kconfig dependency is incomplete since DRM_I915_GVT is a 'bool' symbol that depends on the 'tristate' VFIO_MDEV. This allows a configuration with VFIO_MDEV=m, DRM_I915_GVT=y and DRM_I915=y that causes a link failure:

x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `available_instances_show':
gvt.c:(.text+0x67a): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x6a5): undefined reference to `mtype_get_type_group_id'
x86_64-linux-ld: drivers/gpu/drm/i915/gvt/gvt.o: in function `description_show':
gvt.c:(.text+0x76e): undefined reference to `mtype_get_parent_dev'
x86_64-linux-ld: gvt.c:(.text+0x799): undefined reference to `mtype_get_type_group_id'

Clarify the dependency by specifically disallowing the broken configuration. If VFIO_MDEV is built-in, it will work, but if VFIO_MDEV=m, the i915 driver cannot be built-in here.

Quoted 5 lines
Fixes 07e543f4f9d1 ("vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV")
Fixes 9169cff168ff ("vfio/mdev: Correct the function signatures for the mdev_type_attributes")
 drivers/gpu/drm/i915/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)  
Quoted 7 lines

Oh kconfig stuff like this makes my head hurt, thanks for finding it

I also can't see an alternative to this ugly thing, besides having the i915 guys properly modularize this code someday

I don't really want this mess to propagate further. We should move mdev related stuff to kvmgt module instead, so not pretend any more to possibly use that for other hypervisor..

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Sorry that I didn't realize this issue when Jason proposed this. Let me do the left cleanup.

It would be good, but Alex should still take this patch for the upcoming merge window, you can revert it when you do all the cleanups

I can include it, but I'll wait for confirmation from Zhenyu. Thanks,

I'm ok with this, future cleanup fixes would still go through i915 pull, it only lefts for some tests, will send that for next kernel.

thanks

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV

In reply to Arnd Bergmann
== Series Details ==

== Series Details ==

Series: vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV
URL : https://patchwork.freedesktop.org/series/89408/
State : failure

== Summary ==

Applying: vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/Kconfig).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx