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:   Fri, 28 Apr 2023 15:32:07 +0200
From:   Niklas Schnelle <schnelle@...ux.ibm.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Alan Stern <stern@...land.harvard.edu>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        linux-kernel@...r.kernel.org,
        Linux-Arch <linux-arch@...r.kernel.org>,
        linux-pci@...r.kernel.org, Arnd Bergmann <arnd@...nel.org>,
        linux-ide@...r.kernel.org
Subject: Re: [PATCH v3 02/38] ata: add HAS_IOPORT dependencies

On Thu, 2023-03-16 at 16:21 +0100, Arnd Bergmann wrote:
> On Thu, Mar 16, 2023, at 00:57, Damien Le Moal wrote:
> > On 2023/03/15 20:36, Geert Uytterhoeven wrote:
> 
> > Ah. OK. I see now. So indeed, applying the dependency on the entire ATA_SFF
> > group of drivers is very coarse.
> 
> 
> > Can you change this to apply the dependency per driver ?
> 
> I think that will fail to build because of this function
> on architectures that drop their non-functional
> inb/outb helpers:
> 
> int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev)
> {
>         unsigned long bmdma = pci_resource_start(pdev, 4);
>         u8 simplex;
>  
>         if (bmdma == 0)
>                 return -ENOENT;
>  
>         simplex = inb(bmdma + 0x02); 
>         outb(simplex & 0x60, bmdma + 0x02);
>         simplex = inb(bmdma + 0x02);
>         if (simplex & 0x80)
>                 return -EOPNOTSUPP;
>         return 0;
> }
> 
> This is only called from five pata drivers (ali, amd,
> cmd64x, netcell, serverworks), so an easy workaround
> would be to make sure those depend on HAS_IOPORT
> and enclose the function definition in an #ifdef.
> 
>         Arnd

There were a few additional inb()/outb() uses so a few more drivers had
to have the dependency added but for v4 it will no longer be on the
ATA_SFF option and I used your suggestion above for this function.
There was another call to it in ata_generic_init_one() that is only
done for PCI_VENDOR_ID_AL so I added an #ifdef CONFIG_PATA_ALI around
that.

Thanks,
Niklas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ