public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio/xe: Add default handler for .get_region_info_caps
@ 2025-12-18 20:51 Michal Wajdeczko
  2025-12-19  9:35 ` Bernatowicz, Marcin
  2025-12-23 23:41 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Wajdeczko @ 2025-12-18 20:51 UTC (permalink / raw)
  To: intel-xe
  Cc: Michal Wajdeczko, Thomas Hellström, Rodrigo Vivi,
	Jason Gunthorpe, Kevin Tian, Alex Williamson,
	Michał Winiarski, Marcin Bernatowicz, dri-devel,
	linux-kernel, kvm

New requirement for the vfio drivers was added by the commit
f97859503859 ("vfio: Require drivers to implement get_region_info")
followed by commit 1b0ecb5baf4a ("vfio/pci: Convert all PCI drivers
to get_region_info_caps") that was missed by the new vfio/xe driver.

Add handler for .get_region_info_caps to avoid -EINVAL errors.

Fixes: 2e38c50ae492 ("vfio/xe: Add device specific vfio_pci driver variant for Intel graphics")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Alex Williamson <alex@shazbot.org>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org
---
 drivers/vfio/pci/xe/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c
index 0156b53c678b..719ab4660085 100644
--- a/drivers/vfio/pci/xe/main.c
+++ b/drivers/vfio/pci/xe/main.c
@@ -504,6 +504,7 @@ static const struct vfio_device_ops xe_vfio_pci_ops = {
 	.open_device = xe_vfio_pci_open_device,
 	.close_device = xe_vfio_pci_close_device,
 	.ioctl = vfio_pci_core_ioctl,
+	.get_region_info_caps = vfio_pci_ioctl_get_region_info,
 	.device_feature = vfio_pci_core_ioctl_feature,
 	.read = vfio_pci_core_read,
 	.write = vfio_pci_core_write,
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vfio/xe: Add default handler for .get_region_info_caps
  2025-12-18 20:51 [PATCH] vfio/xe: Add default handler for .get_region_info_caps Michal Wajdeczko
@ 2025-12-19  9:35 ` Bernatowicz, Marcin
  2025-12-23 23:41 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Bernatowicz, Marcin @ 2025-12-19  9:35 UTC (permalink / raw)
  To: Michal Wajdeczko, intel-xe
  Cc: Thomas Hellström, Rodrigo Vivi, Jason Gunthorpe, Kevin Tian,
	Alex Williamson, Michał Winiarski, dri-devel, linux-kernel,
	kvm


On 12/18/2025 9:51 PM, Michal Wajdeczko wrote:
> New requirement for the vfio drivers was added by the commit
> f97859503859 ("vfio: Require drivers to implement get_region_info")
> followed by commit 1b0ecb5baf4a ("vfio/pci: Convert all PCI drivers
> to get_region_info_caps") that was missed by the new vfio/xe driver.
>
> Add handler for .get_region_info_caps to avoid -EINVAL errors.
>
> Fixes: 2e38c50ae492 ("vfio/xe: Add device specific vfio_pci driver variant for Intel graphics")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Kevin Tian <kevin.tian@intel.com>
> Cc: Alex Williamson <alex@shazbot.org>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: kvm@vger.kernel.org
> ---
>   drivers/vfio/pci/xe/main.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c
> index 0156b53c678b..719ab4660085 100644
> --- a/drivers/vfio/pci/xe/main.c
> +++ b/drivers/vfio/pci/xe/main.c
> @@ -504,6 +504,7 @@ static const struct vfio_device_ops xe_vfio_pci_ops = {
>   	.open_device = xe_vfio_pci_open_device,
>   	.close_device = xe_vfio_pci_close_device,
>   	.ioctl = vfio_pci_core_ioctl,
> +	.get_region_info_caps = vfio_pci_ioctl_get_region_info,
>   	.device_feature = vfio_pci_core_ioctl_feature,
>   	.read = vfio_pci_core_read,
>   	.write = vfio_pci_core_write,
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Tested-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>

I tested it on v6.19-rc1 with QEMU 8.2.2
passing through an Intel Xe VF. The patch fixes the -EINVAL failure
on VFIO_DEVICE_GET_REGION_INFO.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vfio/xe: Add default handler for .get_region_info_caps
  2025-12-18 20:51 [PATCH] vfio/xe: Add default handler for .get_region_info_caps Michal Wajdeczko
  2025-12-19  9:35 ` Bernatowicz, Marcin
@ 2025-12-23 23:41 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2025-12-23 23:41 UTC (permalink / raw)
  To: Michal Wajdeczko
  Cc: intel-xe, Thomas Hellström, Rodrigo Vivi, Jason Gunthorpe,
	Kevin Tian, Michał Winiarski, Marcin Bernatowicz, dri-devel,
	linux-kernel, kvm

On Thu, 18 Dec 2025 21:51:06 +0100
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote:

> New requirement for the vfio drivers was added by the commit
> f97859503859 ("vfio: Require drivers to implement get_region_info")
> followed by commit 1b0ecb5baf4a ("vfio/pci: Convert all PCI drivers
> to get_region_info_caps") that was missed by the new vfio/xe driver.
> 
> Add handler for .get_region_info_caps to avoid -EINVAL errors.
> 
> Fixes: 2e38c50ae492 ("vfio/xe: Add device specific vfio_pci driver variant for Intel graphics")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Cc: Kevin Tian <kevin.tian@intel.com>
> Cc: Alex Williamson <alex@shazbot.org>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: kvm@vger.kernel.org
> ---
>  drivers/vfio/pci/xe/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/vfio/pci/xe/main.c b/drivers/vfio/pci/xe/main.c
> index 0156b53c678b..719ab4660085 100644
> --- a/drivers/vfio/pci/xe/main.c
> +++ b/drivers/vfio/pci/xe/main.c
> @@ -504,6 +504,7 @@ static const struct vfio_device_ops xe_vfio_pci_ops = {
>  	.open_device = xe_vfio_pci_open_device,
>  	.close_device = xe_vfio_pci_close_device,
>  	.ioctl = vfio_pci_core_ioctl,
> +	.get_region_info_caps = vfio_pci_ioctl_get_region_info,
>  	.device_feature = vfio_pci_core_ioctl_feature,
>  	.read = vfio_pci_core_read,
>  	.write = vfio_pci_core_write,

Applied to vfio for-linus branch for v6.19.  Thanks,

Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-23 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 20:51 [PATCH] vfio/xe: Add default handler for .get_region_info_caps Michal Wajdeczko
2025-12-19  9:35 ` Bernatowicz, Marcin
2025-12-23 23:41 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox