[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251105171547.GP1204670@ziepe.ca>
Date: Wed, 5 Nov 2025 13:15:47 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Michał Winiarski <michal.winiarski@...el.com>
Cc: Lucas De Marchi <lucas.demarchi@...el.com>,
Alex Williamson <alex@...zbot.org>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Yishai Hadas <yishaih@...dia.com>,
Kevin Tian <kevin.tian@...el.com>,
Shameer Kolothum <skolothumtho@...dia.com>,
intel-xe@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Matthew Brost <matthew.brost@...el.com>,
Michal Wajdeczko <michal.wajdeczko@...el.com>,
dri-devel@...ts.freedesktop.org,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Tvrtko Ursulin <tursulin@...ulin.net>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Lukasz Laguna <lukasz.laguna@...el.com>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH v3 27/28] drm/intel/pciids: Add match with VFIO override
On Wed, Nov 05, 2025 at 04:20:33PM +0100, Michał Winiarski wrote:
> On Tue, Nov 04, 2025 at 03:27:14PM -0400, Jason Gunthorpe wrote:
> > On Tue, Nov 04, 2025 at 11:41:53AM -0600, Lucas De Marchi wrote:
> >
> > > > > > +#define INTEL_VGA_VFIO_DEVICE(_id, _info) { \
> > > > > > + PCI_DEVICE(PCI_VENDOR_ID_INTEL, (_id)), \
> > > > > > + .class = PCI_BASE_CLASS_DISPLAY << 16, .class_mask = 0xff << 16, \
> > > > > > + .driver_data = (kernel_ulong_t)(_info), \
> > > > > > + .override_only = PCI_ID_F_VFIO_DRIVER_OVERRIDE, \
> > > > >
> > > > > why do we need this and can't use PCI_DRIVER_OVERRIDE_DEVICE_VFIO()
> > > > > directly? Note that there are GPUs that wouldn't match the display class
> > > > > above.
> > > > >
> > > > > edb660ad79ff ("drm/intel/pciids: Add match on vendor/id only")
> > > > > 5e0de2dfbc1b ("drm/xe/cri: Add CRI platform definition")
> > > > >
> > > > > Lucas De Marchi
> > > > >
> > > >
> > > > I'll define it on xe-vfio-pci side and use
> > >
> > > but no matter where it's defined, why do you need it to match on the
> > > class? The vid/devid should be sufficient.
> >
> > +1
> >
> > Jason
>
> I don't need to match on class.
>
> With PCI_DRIVER_OVERRIDE_DEVICE_VFIO it just becomes:
> #define INTEL_PCI_VFIO_DEVICE(_id) { \
> PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_INTEL, (_id)) \
> }
>
> static const struct pci_device_id xe_vfio_pci_table[] = {
> INTEL_PTL_IDS(INTEL_PCI_VFIO_DEVICE),
> INTEL_WCL_IDS(INTEL_PCI_VFIO_DEVICE),
> INTEL_BMG_IDS(INTEL_PCI_VFIO_DEVICE),
> {}
> };
>
> So, no matching on class, but I still do need a helper macro.
Yes, that looks right to me.
Jason
Powered by blists - more mailing lists