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:   Thu, 5 May 2022 20:46:15 +0530
From:   Faiyaz Mohammed <quic_faiyazm@...cinc.com>
To:     Mike Rapoport <rppt@...nel.org>
CC:     <quic_vjitta@...cinc.com>, <karahmed@...zon.de>,
        <qperret@...gle.com>, <robh@...nel.org>,
        <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>, <robh+dt@...nel.org>,
        <frowand.list@...il.com>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH] mm: memblock: avoid to create memmap for memblock nomap
 regions


On 4/12/2022 10:56 PM, Mike Rapoport wrote:
> On Tue, Apr 12, 2022 at 12:39:32AM +0530, Faiyaz Mohammed wrote:
>> This 'commit 86588296acbf ("fdt: Properly handle "no-map" field in the
>> memory region")' is keeping the no-map regions in memblock.memory with
>> MEMBLOCK_NOMAP flag set to use no-map memory for EFI using memblock api's,
>> but during the initialization sparse_init mark all memblock.memory as
>> present using for_each_mem_pfn_range, which is creating the memmap for
>> no-map memblock regions. To avoid it skiping the memblock.memory regions
>> set with MEMBLOCK_NOMAP set and with this change we will be able to save
>> ~11MB memory for ~612MB carve out.
> The MEMBLOCK_NOMAP is very fragile and caused a lot of issues already. I
> really don't like the idea if adding more implicit assumptions about how
> NOMAP memory may or may not be used in a generic iterator function.

Sorry for delayed response.
Yes, it is possible that implicit assumption can create
misunderstanding. How about adding command line option and control the
no-map region in fdt.c driver, to decide whether to keep "no-map" region
with NOMAP flag or remove?. Something like below

--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1180,8 +1180,10 @@ int __init __weak
early_init_dt_reserve_memory_arch(phys_addr_t base,
                 */
                if (memblock_is_region_reserved(base, size))
                        return -EBUSY;
-
-               return memblock_mark_nomap(base, size);
+               if (remove_nomap_region)
+                       return memblock_remove(base, size);
+               else
+                       return memblock_mark_nomap(base, size);
Thanks and regards,
Mohammed Faiyaz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ