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: <20250226173610.GE28425@nvidia.com>
Date: Wed, 26 Feb 2025 13:36:10 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: kevin.tian@...el.com, tglx@...utronix.de, maz@...nel.org,
	joro@...tes.org, will@...nel.org, robin.murphy@....com,
	shuah@...nel.org, iommu@...ts.linux.dev,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-kselftest@...r.kernel.org, eric.auger@...hat.com,
	baolu.lu@...ux.intel.com, yi.l.liu@...el.com, yury.norov@...il.com,
	jacob.pan@...ux.microsoft.com, patches@...ts.linux.dev
Subject: Re: [PATCH v2 7/7] iommu: Turn iova_cookie to dma-iommu private
 pointer

On Tue, Feb 25, 2025 at 06:25:27PM -0800, Nicolin Chen wrote:
> On Fri, Feb 21, 2025 at 10:39:59AM -0400, Jason Gunthorpe wrote:
> > diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> > index 99dd72998cb7f7..082274e8ba6a3d 100644
> > --- a/include/linux/iommu.h
> > +++ b/include/linux/iommu.h
> > @@ -1534,12 +1534,16 @@ void iommu_debugfs_setup(void);
> >  static inline void iommu_debugfs_setup(void) {}
> >  #endif
> >  
> > -#ifdef CONFIG_IOMMU_DMA
> > +#if defined(CONFIG_IOMMU_DMA) && IS_ENABLED(CONFIG_IRQ_MSI_IOMMU)
> >  int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base);
> > +void iommu_put_msi_cookie(struct iommu_domain *domain);
> >  #else /* CONFIG_IOMMU_DMA */
> >  static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base)
> >  {
> > -	return -ENODEV;
> > +	return 0;
> 
> Should we keep the -ENODEV here for !CONFIG_IOMMU_DMA?

My feeling was if the system doesn't have an IRQ driver that needs
MSI_IOMMU but does have a IOMMU driver that reports SW_MSI reserved
regions then iommufd/vfio should not fail.

I don't think it is realistic that we'd ever hit this return.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ