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: <69047c319c6cb2afd7331daeb7fc8459fdd34f80.camel@linux.ibm.com>
Date:   Thu, 19 Jan 2023 17:33:43 +0100
From:   Niklas Schnelle <schnelle@...ux.ibm.com>
To:     Matthew Rosato <mjrosato@...ux.ibm.com>,
        Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jason Gunthorpe <jgg@...dia.com>,
        Wenjia Zhang <wenjia@...ux.ibm.com>
Cc:     Gerd Bayer <gbayer@...ux.ibm.com>,
        Pierre Morel <pmorel@...ux.ibm.com>, iommu@...ts.linux.dev,
        linux-s390@...r.kernel.org, borntraeger@...ux.ibm.com,
        hca@...ux.ibm.com, gor@...ux.ibm.com,
        gerald.schaefer@...ux.ibm.com, agordeev@...ux.ibm.com,
        svens@...ux.ibm.com, linux-kernel@...r.kernel.org,
        Julian Ruess <julianr@...ux.ibm.com>
Subject: Re: [PATCH v4 4/7] s390/pci: Use dma-iommu layer

On Tue, 2023-01-17 at 10:09 -0500, Matthew Rosato wrote:
> On 1/4/23 7:05 AM, Niklas Schnelle wrote:
> > While s390 already has a standard IOMMU driver and previous changes have
> > added I/O TLB flushing operations this driver is currently only used for
> > user-space PCI access such as vfio-pci. For the DMA API s390 instead
> > utilizes its own implementation in arch/s390/pci/pci_dma.c which drives
> > the same hardware and shares some code but requires a complex and
> > fragile hand over between DMA API and IOMMU API use of a device and
> > despite code sharing still leads to significant duplication and
> > maintenance effort. Let's utilize the common code DMAP API
> > implementation from drivers/iommu/dma-iommu.c instead allowing us to
> > get rid of arch/s390/pci/pci_dma.c.
> > 
> > Signed-off-by: Niklas Schnelle <schnelle@...ux.ibm.com>
> > diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
> > index ef38b1514c77..6b0fe8761509 100644
> > --- a/arch/s390/pci/pci.c
> > +++ b/arch/s390/pci/pci.c
> > @@ -124,7 +124,11 @@ int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,
> >  
> >  	WARN_ON_ONCE(iota & 0x3fff);
> >  	fib.pba = base;
> > -	fib.pal = limit;
> > +	/* Work around off by one in ISM virt device */
> > +	if (zdev->pft == 0x5 && limit > base)
> 
> Nit: maybe a named #define for the ISM pft rather than hard-coding 0x5 here
> 

Hmm, I agree in principle but not sure where to put this #define. Maybe
also important to mention that the off-by-one has actually been fixed
in current firmware but of course we still have to support broken
devices and the workaround still works with fixed ISM.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ