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] [day] [month] [year] [list]
Date:   Tue, 30 Nov 2021 23:07:40 +0200
From:   Mike Rapoport <rppt@...nel.org>
To:     Rob Herring <robh@...nel.org>
Cc:     Calvin Zhang <calvinzhang.cool@...il.com>,
        Vineet Gupta <vgupta@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Guo Ren <guoren@...nel.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Nick Hu <nickhu@...estech.com>,
        Greentime Hu <green.hu@...il.com>,
        Vincent Chen <deanbo422@...il.com>,
        Dinh Nguyen <dinguyen@...nel.org>,
        Jonas Bonn <jonas@...thpole.se>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        Stafford Horne <shorne@...il.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Rich Felker <dalias@...c.org>, Chris Zankel <chris@...kel.net>,
        Max Filippov <jcmvbkbc@...il.com>,
        Frank Rowand <frowand.list@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Arnd Bergmann <arnd@...db.de>,
        Kefeng Wang <wangkefeng.wang@...wei.com>,
        Vladimir Isaev <isaev@...opsys.com>,
        "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
        "Kirill A. Shutemov" <kirill.shtuemov@...ux.intel.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Marc Zyngier <maz@...nel.org>,
        David Brazdil <dbrazdil@...gle.com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Andrey Konovalov <andreyknvl@...il.com>,
        Mark Rutland <mark.rutland@....com>,
        Souptick Joarder <jrdr.linux@...il.com>,
        Jinyang He <hejinyang@...ngson.cn>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Serge Semin <Sergey.Semin@...kalelectronics.ru>,
        Tiezhu Yang <yangtiezhu@...ngson.cn>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Ley Foon Tan <ley.foon.tan@...el.com>,
        Andreas Oetken <andreas.oetken@...mens.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Christophe Leroy <christophe.leroy@....fr>,
        Zhang Yunkai <zhang.yunkai@....com.cn>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Markus Elfring <elfring@...rs.sourceforge.net>,
        Ganesh Goudar <ganeshgr@...ux.ibm.com>,
        "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
        Atish Patra <atish.patra@....com>,
        Anup Patel <anup.patel@....com>,
        Nick Kossifidis <mick@....forth.gr>,
        Alexandre Ghiti <alex@...ti.fr>,
        Vitaly Wool <vitaly.wool@...sulko.com>,
        Thierry Reding <treding@...dia.com>,
        Lee Jones <lee.jones@...aro.org>,
        Guo Ren <guoren@...ux.alibaba.com>,
        Alexander Sverdlin <alexander.sverdlin@...ia.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Mauri Sandberg <sandberg@...lfence.com>,
        Palmer Dabbelt <palmerdabbelt@...gle.com>,
        linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
        uclinux-h8-devel@...ts.sourceforge.jp, linux-mips@...r.kernel.org,
        openrisc@...ts.librecores.org, linuxppc-dev@...ts.ozlabs.org,
        linux-riscv@...ts.infradead.org, linux-sh@...r.kernel.org,
        linux-xtensa@...ux-xtensa.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction

On Mon, Nov 29, 2021 at 06:08:10PM -0600, Rob Herring wrote:
> On Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote:
> > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote:
> > > The count of reserved regions in /reserved-memory was limited because
> > > the struct reserved_mem array was defined statically. This series sorts
> > > out reserved memory code and allocates that array from early allocator.
> > > 
> > > Note: reserved region with fixed location must be reserved before any
> > > memory allocation. While struct reserved_mem array should be allocated
> > > after allocator is activated. We make early_init_fdt_scan_reserved_mem()
> > > do reservation only and add another call to initialize reserved memory.
> > > So arch code have to change for it.
> > 
> > I think much simpler would be to use the same constant for sizing
> > memblock.reserved and reserved_mem arrays.
> 
> Do those arrays get shrunk? Or do we waste the memory forever?

Memblock arrays don't get shrunk, but they are __init unless an architecture
chose to keep them after boot, but most architectures that use device tree
actually keep memblock structures.
 
> Maybe we can copy and shrink the initial array? Though I suspect struct 
> reserved_mem pointers have already been given out.

I'm not sure. It seems that reserved_mem pointers are given out at initcall
time and AFAIU the reserved_mem array is created somewhere around
setup_arch(). So maybe it's possible to copy and shrink the initial array.
 
> > 
> > If there is too much reserved regions in the device tree, reserving them in
> > memblock will fail anyway because memblock also starts with static array
> > for memblock.reserved, so doing one pass with memblock_reserve() and
> > another to set up reserved_mem wouldn't help anyway.
> > 
> > > I'm only familiar with arm and arm64 architectures. Approvals from arch
> > > maintainers are required. Thank you all.

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ