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: <CAE=W-e1Tvvwpb67rLzETtkzh3nLN_3dquvj8Wn9aKfXXzndFmg@mail.gmail.com>
Date:	Mon, 6 Jul 2015 21:49:57 +0200
From:	Lorenzo Nava <lorenx4@...il.com>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	Catalin Marinas <catalin.marinas@....com>,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v5] arm DMA: Fix allocation from CMA for coherent DMA

On Fri, Jul 3, 2015 at 11:03 AM, Russell King - ARM Linux
<linux@....linux.org.uk> wrote:
> On Wed, Jul 01, 2015 at 12:12:51PM +0100, Catalin Marinas wrote:
>> On Tue, Jun 30, 2015 at 11:29:06PM +0200, Lorenzo Nava wrote:
>> > This patch allows the use of CMA for DMA coherent memory allocation.
>> > At the moment if the input parameter "is_coherent" is set to true
>> > the allocation is not made using the CMA, which I think is not the
>> > desired behaviour.
>> >
>> > Signed-off-by: Lorenzo Nava <lorenx4@...il.com>
>> > Reviewed-by: Catalin Marinas <catalin.marinas@....com>
>>
>> If Russell doesn't have any objections, you can send the patch to
>> his patch system. See here for more information:
>
> I'm left wondering whether this patch is really want Lorenzo wants.
> From my reading of it, while this has the effect of allocating from
> CMA for coherent devices, it's no different from the non-coherent
> case, because by calling __alloc_from_contiguous(), we end up
> remapping the allocated memory, removing the cacheability status
> from the allocated pages.
>
> This brings up an interesting point: presumably, it's been tested, and
> people are happy with the performance it's giving, inspite of it not
> returning cacheable memory... or maybe it hasn't been tested that much?

In the weekend I've run the test once again and what I got is that:

allocation non-coherent memory (CMA) -> prot = 0x647 (bufferable, non cacheable)
allocation coherent memory (with patch, CMA) -> prot = 0x65F (writealloc)

mmap of coherent memory (without mmap patched) -> prot = 0x707
(bufferable, non cacheable) -> ERROR
mmap of coherent memory (with mmap patch) -> prot = 0x71F (writealloc) -> OK

So, it looks like the page attributes are ok from the test I ran. I
didn't repeat the performance tests on the mapped memory, but they
were ok for me as well.

I've submitted the patch to your system.
If you have any other objections or any feedback, please let me know.

Lorenzo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ