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: <21feac2d-24e9-43f4-8a1b-728d4af6c4c7@ics.forth.gr>
Date: Mon, 7 Oct 2024 14:39:00 +0300
From: Nick Kossifidis <mick@....forth.gr>
To: Christoph Hellwig <hch@...radead.org>,
        Vladimir Kondratiev <Vladimir.Kondratiev@...ileye.com>
Cc: Alexandre Ghiti <alex@...ti.fr>, Paul Walmsley
 <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
        Andrew Morton
 <akpm@...ux-foundation.org>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH v1] riscv: make ZONE_DMA32 optional

On 10/7/24 09:22, Christoph Hellwig wrote:
> On Mon, Oct 07, 2024 at 06:17:14AM +0000, Vladimir Kondratiev wrote:
>>> Well, this doesn't get any more true by just irgnoring the previous
>>> discussion and just reposting :(
>>
>> Sorry, this wasn't the intention. Perhaps I messed with the message-id, I see my "patch v1" in one mail thread together with the previous discussion, but not in the other thread.
>>
>> Anyway, I think making ZONE_DMA32 selection depend on NONPORTABLE answers the concern
>> that was raised
> 
> It doesn't at all.
> 
> For one not having ZONE_DMA32 is going to break a lot of things.
> Drivers do expect 32-bit addressable memory.  And because SOC designers
> know this there usually is a way to provide it, e.g. by doing window
> translations between cpu physical and bus physical address.  Please go
> back to your data sheet or talk to the designers.
> 
> And if there really is not way to provide this, the right way is just
> to stop the runtime allocation that triggered you to do this if
> ZONE_DMA32 is empty, not to add a non-portable option.
> 

I agree with Christoph on this one, by the time dma_atomic_pool_init() 
gets called we already know the system's DRAM base for example and if we 
have 32bit addressable regions (or aliases / translation windows as 
Christoph mentioned) or not. We could use this info to skip ZONE_DMA32, 
or just use a command line argument like this RFC proposed:
https://lore.kernel.org/linux-arm-kernel/20230201040913.GA4959@hu-cgoldswo-sd.qualcomm.com/T/

There is no reason to configure this at compile time, and completely 
remove support for ZONE_DMA32. Also NONPORTABLE doesn't address Alex's 
point on distro kernels, since distro kernels won't set NONPORTABLE.

BTW I tried reproducing this with a recent 6.10 kernel and couldn't, our 
system also has DRAM way above 32bits and this is also on a modified 
QEMU machine, here is the full log:
https://pastebin.com/9HLcphgY

You can use this script to reproduce our QEMU setup if interested:
https://github.com/CARV-ICS-FORTH/yarvt/tree/eupilot

Regards,
Nick

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ