lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <l43rg6fo4dwptioknyp75ml3dayobquk74wbxoqm6f5td2wzu4@57obqt4dmgbx>
Date: Mon, 24 Nov 2025 22:17:36 +0100
From: Michał Winiarski <michal.winiarski@...el.com>
To: Michal Wajdeczko <michal.wajdeczko@...el.com>
CC: Alex Williamson <alex@...zbot.org>, Lucas De Marchi
	<lucas.demarchi@...el.com>, Thomas Hellström
	<thomas.hellstrom@...ux.intel.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>,
	Jason Gunthorpe <jgg@...pe.ca>, 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>,
	<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 v5 25/28] drm/xe/pci: Introduce a helper to allow VF
 access to PF xe_device

On Sat, Nov 22, 2025 at 07:38:38PM +0100, Michal Wajdeczko wrote:
> 
> 
> On 11/11/2025 2:04 AM, Michał Winiarski wrote:
> > In certain scenarios (such as VF migration), VF driver needs to interact
> > with PF driver.
> > Add a helper to allow VF driver access to PF xe_device.
> > 
> > Signed-off-by: Michał Winiarski <michal.winiarski@...el.com>
> > ---
> >  drivers/gpu/drm/xe/xe_pci.c | 17 +++++++++++++++++
> >  drivers/gpu/drm/xe/xe_pci.h |  3 +++
> >  2 files changed, 20 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> > index cd03b4b3ebdbd..5107a21679503 100644
> > --- a/drivers/gpu/drm/xe/xe_pci.c
> > +++ b/drivers/gpu/drm/xe/xe_pci.c
> > @@ -1224,6 +1224,23 @@ static struct pci_driver xe_pci_driver = {
> >  #endif
> >  };
> >  
> > +/**
> > + * xe_pci_get_pf() - Get PF &xe_device.
> 
> nit: xe_pci_to_pf_device() ?
> 
> as "get" is usually used in simple 'getter' functions
> while here we perform extra checks

Ok.

> 
> > + * @pdev: the VF &pci_dev device
> > + *
> > + * Return: pointer to PF &xe_device, NULL otherwise.
> > + */
> > +struct xe_device *xe_pci_get_pf(struct pci_dev *pdev)
> > +{
> > +	struct drm_device *drm;
> > +
> > +	drm = pci_iov_get_pf_drvdata(pdev, &xe_pci_driver);
> > +	if (IS_ERR(drm))
> > +		return NULL;
> > +
> > +	return to_xe_device(drm);
> > +}
> > +
> >  int xe_register_pci_driver(void)
> >  {
> >  	return pci_register_driver(&xe_pci_driver);
> > diff --git a/drivers/gpu/drm/xe/xe_pci.h b/drivers/gpu/drm/xe/xe_pci.h
> > index 611c1209b14cc..e97800d5c9dc3 100644
> > --- a/drivers/gpu/drm/xe/xe_pci.h
> > +++ b/drivers/gpu/drm/xe/xe_pci.h
> > @@ -6,6 +6,9 @@
> >  #ifndef _XE_PCI_H_
> >  #define _XE_PCI_H_
> >  
> > +struct pci_dev;
> > +
> > +struct xe_device *xe_pci_get_pf(struct pci_dev *pdev);
> 
> nit: since this is just a helper, move its declaration below core
> functions register/unregister 

Sure.

> 
> >  int xe_register_pci_driver(void);
> >  void xe_unregister_pci_driver(void);
> >  
> 
> just nits, so
> 
> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@...el.com>
> 

Thanks,
-Michał

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ