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]
Date:   Tue, 17 Aug 2021 09:12:40 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Alyssa Rosenzweig <alyssa@...enzweig.io>,
        linux-pci <linux-pci@...r.kernel.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Rob Herring <robh+dt@...nel.org>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Krzysztof Wilczyński <kw@...ux.com>,
        Stan Skowronek <stan@...ellium.com>,
        Mark Kettenis <kettenis@...nbsd.org>,
        Sven Peter <sven@...npeter.dev>,
        Hector Martin <marcan@...can.st>,
        DTML <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1

On Tue, 17 Aug 2021 08:34:35 +0100,
Arnd Bergmann <arnd@...nel.org> wrote:
> 
> On Mon, Aug 16, 2021 at 11:57 PM Marc Zyngier <maz@...nel.org> wrote:
> > On Mon, 16 Aug 2021 02:31:40 +0100, Alyssa Rosenzweig <alyssa@...enzweig.io> wrote:
> >
> > > > Please use relaxed accessors. If the barriers are actually needed,
> > > > please document what you are ordering against. This applies throughout
> > > > the patch.
> > >
> > > Relaxed accessors are used throughout in v2... it Works For Me™ but no
> > > guarantees I didn't introduce a race...
> >
> > That's not exactly what I wanted to read... You really need to make an
> > informed decision on the need of barriers. If the MMIO write needs to
> > be ordered after a main memory write (i.e. a memory write that is
> > consumed by the device you are subsequently writing to), you then need
> > a barrier. If, as I suspect, the device isn't DMA capable and doesn't
> > require ordering with the rest of the memory accesses, then no
> > barriers are required.
> 
> My normal rule is to always use the normal accessors, and only use
> any special variants if this is either required for correct operation
> (e.g. heavy barriers on arm32 may call code that must not recursively
> use heavy barriers) or that you have proven to /both/ be correct and
> relevant for performance. IOW, don't use the relaxed accessors just
> because it isn't wrong in your driver, other developers may copy the
> code into a driver that can't do it.

And that exactly the reason why I think we should *not* use heavy
accessors if they are not required. I have little sympathy for blindly
copied code, and spreading unnecessary barriers means that we cannot
further reason about the actual ordering requirements.

In other words, blanket use of heavy MMIO accessors to guarantee
memory ordering is not dissimilar to reintroducing the BKL because we
don't want people to worry about concurrency.

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ