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] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52763561BFD87DE35FF4A0048C072@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Tue, 9 Apr 2024 07:07:22 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
CC: "sivanich@....com" <sivanich@....com>, Thomas Gleixner
	<tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>,
	"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>, Lu Baolu
	<baolu.lu@...ux.intel.com>, Joerg Roedel <joro@...tes.org>, "Liu, Yi L"
	<yi.l.liu@...el.com>, "steve.wahl@....com" <steve.wahl@....com>, "Anderson,
 Russ" <russ.anderson@....com>, Peter Zijlstra <peterz@...radead.org>, "Will
 Deacon" <will@...nel.org>, Robin Murphy <robin.murphy@....com>
Subject: RE: [PATCH 2/2] iommu/vt-d: Share DMAR fault IRQ to prevent vector
 exhaustion

> From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
> Sent: Tuesday, April 9, 2024 1:39 AM
> 
> Hi Jacob,
> 
> On Mon, 8 Apr 2024 09:05:56 -0700, Jacob Pan
> <jacob.jun.pan@...ux.intel.com> wrote:
> 
> > Hi Kevin,
> >
> > On Mon, 8 Apr 2024 08:48:54 +0000, "Tian, Kevin" <kevin.tian@...el.com>
> > wrote:
> >
> > > > From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
> > > > Sent: Thursday, April 4, 2024 7:46 AM
> > > >
> > > > @@ -1182,7 +1182,6 @@ static void free_iommu(struct intel_iommu
> > > > *iommu)
> > > >  			iommu->pr_irq = 0;
> > > >  		}
> > > >  		free_irq(iommu->fault_irq, iommu);
> > > > -		dmar_free_hwirq(iommu->fault_irq);
> > >
> > > You still want to free the vector for the iommu which first gets the
> > > vector allocated.
> > >
> > I think we always want to keep this vector since the system always needs
> > one vector to share. We will never offline all the IOMMUs, right?

Not about offline. Just about the common rule of cleaning up a resource
when all of its users are destroyed.

> > > > +
> > > > +	/*
> > > > +	 * Only the owner IOMMU of the shared IRQ has its fault event
> > > > +	 * interrupt unmasked after request_irq(), the rest are
> > > > explicitly
> > > > +	 * unmasked.
> > > > +	 */
> > > > +	if (!(iommu->flags & VTD_FLAG_FAULT_IRQ_OWNER))
> > > > +		dmar_fault_irq_unmask(iommu);
> > > > +
> > >
> > > em there is a problem in dmar_msi_mask() and dmar_msi_mask()
> > > which only touches the owner IOMMU. With this shared vector
> > > approach we should mask/unmask all IOMMU's together.
> > I thought about this as well, in addition to fault_irq,
> > dmar_msi_mask/unmask() are used for other DMAR irqs, page request and
> > perfmon. So we need a special case for fault_irq there, it is not pretty.

yes, that is the part which I don't really like.

> >
> > I added a special case here in this patch, thinking we never mask the
> > fault_irq since we need to cover the lifetime of the system. I have looked
> > at:
> > 1.IOMMU suspend/resume, no mask/unmask
> Actually, we do call mask/unmask in suspend/unmask noirq phase.
> And DMAR-MSI chip has IRQCHIP_SKIP_SET_WAKE flag.
> 
> So you are right, I am missing this case where non-owner IOMMU's fault_irqs
> are not masked/unmasked.
> 

and it's not good to code a mask/unmask callback upon fixed assumptions
on when irq core may call mask/unmask as the latter part can change 
w/o noting the broken assumption in such callback.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ