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: <CAK8P3a03BcXZu+On885GaR547SHJYtiu3d_QHG0zOr2UiKn6qQ@mail.gmail.com>
Date:   Fri, 26 Feb 2021 19:06:43 +0100
From:   Arnd Bergmann <arnd@...nel.org>
To:     Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc:     Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        DTML <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Christoph Hellwig <hch@...radead.org>,
        Neil Armstrong <narmstrong@...libre.com>,
        David Woodhouse <dwmw2@...radead.org>,
        Russell King - ARM Linux <linux@...linux.org.uk>,
        Catalin Marinas <catalin.marinas@....com>,
        Arnd Bergmann <arnd@...db.de>, Will Deacon <will@...nel.org>
Subject: Re: [RFC 13/13] scsi: megaraid: Make use of dev_64bit_mmio_supported()

On Fri, Feb 26, 2021 at 3:30 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> On Fri, Feb 26, 2021 at 3:03 PM Nicolas Saenz Julienne
> <nsaenzjulienne@...e.de> wrote:
>
> >         unsigned long flags;
> > -       spin_lock_irqsave(&instance->hba_lock, flags);
> > -       writel(le32_to_cpu(req_desc->u.low),
> > -               &instance->reg_set->inbound_low_queue_port);
> > -       writel(le32_to_cpu(req_desc->u.high),
> > -               &instance->reg_set->inbound_high_queue_port);
> > -       spin_unlock_irqrestore(&instance->hba_lock, flags);
>
> > +
> > +       if (dev_64bit_mmio_supported(&instance->pdev->dev)) {
> > +               writeq(req_data, &instance->reg_set->inbound_low_queue_port);
> > +       } else {
> > +               spin_lock_irqsave(&instance->hba_lock, flags);
> > +               lo_hi_writeq(req_data, &instance->reg_set->inbound_low_queue_port);
> > +               spin_unlock_irqrestore(&instance->hba_lock, flags);
> > +       }
>
> I see your patch changes the code to the lo_hi_writeq() accessor,
> and it also fixes the endianness bug (double byteswap on big-endian),
> but it does not fix the spinlock bug (writel on pci leaks out of the lock
> unless it's followed by a read).

On second look, it seems your patch breaks the byteorder logic,
rather than fixing it. It would seem better to leave it unchanged
then, or to send a separate rework of the endianness conversion if
you think it is wrong.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ