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: <CAK8P3a3HWn7RXjcT0KA_qOc+C1SgWd2qXSdCTTAmRKHdc4qNbQ@mail.gmail.com>
Date:   Fri, 21 Jun 2019 13:09:24 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     "Maciej W. Rozycki" <macro@...ux-mips.org>
Cc:     Paul Burton <paul.burton@...s.com>,
        Serge Semin <fancer.lancer@...il.com>,
        Ralf Baechle <ralf@...ux-mips.org>,
        James Hogan <jhogan@...nel.org>,
        Serge Semin <Sergey.Semin@...latforms.ru>,
        "Vadim V . Vlasov" <vadim.vlasov@...latforms.ru>,
        "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mips: Remove q-accessors from non-64bit platforms

On Fri, Jun 21, 2019 at 12:09 PM Maciej W. Rozycki <macro@...ux-mips.org> wrote:
>
> On Fri, 21 Jun 2019, Arnd Bergmann wrote:
>
> > >  The use of 64-bit operations to access option's packet memory, which is
> > > true SRAM, i.e. no side effects, is to improve throughput only and there's
> > > no need for atomicity here nor also any kind of barriers, except at the
> > > conclusion.  Splitting 64-bit accesses into 32-bit halves in software
> > > would not be a functional error here.
> >
> > The other property of packet memory and similar things is that you
> > basically want memcpy()-behavior with no byteswaps. This is one
> > of the few cases in which __raw_readq() is actually the right accessor
> > in (mostly) portable code.
>
>  Correct, but we're missing an `__raw_readq_relaxed', etc. interface and
> having additional barriers applied on every access would hit performance
> very badly;

How so? __raw_readq() by definition has the least barriers of
all, you can't make it more relaxed than it already is.

> in fact even the barriers `*_relaxed' accessors imply would
> best be removed in this use (which is why defza.c uses `readw_o' vs
> `readw_u', etc. internally), but after all the struggles over the years
> for weakly ordered internal APIs x86 people are so averse to I'm not sure
> if I want to start another one.  We can get away with `readq_relaxed' in
> this use though as all the systems this device can be used with are
> little-endian as is TURBOchannel, so no byte-swapping will ever actually
> occur.

I still don't see any downside of using __raw_readq() here, while the
upsides are:

- makes the driver portable to big-endian kernels (even though we don't
  care)
- avoids all barriers
- fixes the build regression.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ