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: <CAK8P3a3xXQ7SbAsFAe637PkpL8_2NYstjOLj35D+QPyy-GzKGg@mail.gmail.com>
Date:   Thu, 25 Aug 2022 19:17:22 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Arnd Bergmann <arnd@...db.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH 5/4] ARM: footbridge: remove custom DMA address handling

On Thu, Aug 25, 2022 at 12:35 PM Russell King (Oracle)
<linux@...linux.org.uk> wrote:
>
> On Thu, Aug 25, 2022 at 11:17:52AM +0200, Arnd Bergmann wrote:
> > -/*
> > - * The footbridge is programmed to expose the system RAM at 0xe0000000.
> > - * The requirement is that the RAM isn't placed at bus address 0, which
> > - * would clash with VGA cards.
> > - */
> > -#define BUS_OFFSET           0xe0000000
> > -#define __virt_to_bus(x)     ((x) + (BUS_OFFSET - PAGE_OFFSET))
> > -#define __bus_to_virt(x)     ((x) - (BUS_OFFSET - PAGE_OFFSET))
>
> ... and this tells you why that is with ISA devices.
>
> So, one hell of a big NAK to this patch, sorry.

Thanks for taking a look. Apparently I misread the interface, and I assumed
that the __bus_to_virt() BUS_OFFSET in set_dma_addr() would
just cancel out the dma_map_single() in isa_enable_dma().

It turns out the logic is actually simpler and we just convert between
virtual address and bus address three times. for most drivers.

I found one driver (cs89x0-isa) that uses isa_virt_to_bus()/virt_to_phys()
instead of dma_map_single(), but that is probably never used here.
Once we move the DMA offset into the device, all other ISA devices will
also get the default zero-offset, but I think that will be fine as long as the
"isa_dma_dev" that is used for the final translation has the correct offset.

I'll try to come up with a new version tomorrow.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ