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: <b0c85637-4646-614b-d406-49aa72ce52e1@arm.com>
Date:   Tue, 9 Jun 2020 17:25:04 +0100
From:   Vladimir Murzin <vladimir.murzin@....com>
To:     Christoph Hellwig <hch@....de>,
        dillon min <dillon.minfei@...il.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        linux@...linux.org.uk, Kate Stewart <kstewart@...uxfoundation.org>,
        allison@...utok.net, info@...ux.net, tglx@...utronix.de,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        linux-stm32@...md-mailman.stormreply.com,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] arm-nommu: Add use_reserved_mem() to check if device
 support reserved memory

On 6/9/20 4:43 PM, Vladimir Murzin wrote:
> On 6/9/20 4:36 PM, Christoph Hellwig wrote:
>> On Tue, Jun 09, 2020 at 11:22:24PM +0800, dillon min wrote:
>>> Hi Vladimir,
>>>
>>> Thanks for reviewing.
>>>
>>> Hi Christoph Hellwig,
>>>
>>> I just want to know if kernel dma mapping/direct is focused on
>>> platforms with MMU.
>>> leave arch code to handle dma coherent memory management themself for
>>> no-MMU platform.
>>
>> No, I'd really like to consolidate everything that isn't overly
>> arch specific eventually.
>>
>>>
>>> so, you just return error code in kernel/dma/mapping.c,direct.c
>>> without CONFIG_MMU defined ?
>>> which means dma-direct mapping doesn't support !CONFIG_MMU is not a
>>> bug, but design as it's.
>>> or, just return error code currently, will add dma direct mapping
>>> support for !CONFIG_MMU in the
>>> future?
>>>
>>> As Vladimir Murzin's suggestion has changes in kernel code, I need
>>> your input to get
>>> the design goal about dma-direct mapping, thanks.
>>
>> Can someone repost the whole patch?
>>
> 
> Happy to repost as separate patch once dillon confirms it actually works.
> 
> Meanwhile, I'm trying to understand at which point we lost this 
> functionality for NOMMU... maybe it will become different patch :)
> 

mmap operation for dma-noop (ancestor of dma-direct) was proposed
in [1]. It was suggested to change dma_common_map() instead which
was implemented in 

07c75d7a6b9e ("drivers: dma-mapping: allow dma_common_mmap() for NOMMU")

that removed CONFIG_MMU drom dma_common_mmap(). Later

62fcee9a3bd7 ("dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP")

reintroduced CONFIG_MMU in dma_common_mmap().

Even though commit mentions ARM, I do not see how mmap would continue
to work for NOMMU with dma-direct. ARM NOMMU needs it's own DMA operations
only in cases where caches are implemented or active, in other cases it
fully relies on dma-direct.

It looks to me that we either should provide NOMMU variant for mmap in
dma/direct or (carefully) fix dma/mapping.

Thoughts?

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/480600.html

Vladimir

> Cheers
> Vladimir
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ