[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251022130204.GD21554@ziepe.ca>
Date: Wed, 22 Oct 2025 10:02:04 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Matthew Brost <matthew.brost@...el.com>
Cc: Michał Winiarski <michal.winiarski@...el.com>,
Alex Williamson <alex.williamson@...hat.com>,
Lucas De Marchi <lucas.demarchi@...el.com>,
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 <shameerali.kolothum.thodi@...wei.com>,
intel-xe@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Michal Wajdeczko <michal.wajdeczko@...el.com>,
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>
Subject: Re: [PATCH 26/26] vfio/xe: Add vendor-specific vfio_pci driver for
Intel graphics
On Tue, Oct 21, 2025 at 06:15:19PM -0700, Matthew Brost wrote:
> Ok, I think I see what you're getting at. The idea is to call
> dev_set_drvdata on the Xe side, then use pci_iov_get_pf_drvdata on the
> VFIO side to retrieve that data. This allows passing whatever Xe sets
> via dev_set_drvdata between the module interfaces, while only
> forward-declaring the interface struct in the shared header.
Yes. The other email looks good:
struct xe_device *xe_sriov_vfio_get_xe_device(struct pci_dev *pdev);
Should call pci_iov_get_pf_drvdata() internally.
And 'struct xe_device' can be a forward declared type that cannot be
dereferenced by VFIO to enforce some code modularity.
Using strong types is obviously better than passing around pci_dev and
hoping for the best :)
Jason
Powered by blists - more mailing lists