All of lore.kernel.org
 help / color / mirror / Atom feed
From: Calvin Zhang <calvinzhang.cool@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Vineet Gupta <vgupta@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Nick Hu <nickhu@andestech.com>, Greentime Hu <green.hu@gmail.com>,
	Vincent Chen <deanbo422@gmail.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Stafford Horne <shorne@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Rich Felker <dalias@libc.org>,
	Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Vladimir Isaev <isaev@synopsys.com>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	"Kirill A. Shutemov" <kirill.shtuemov@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>, Marc Zyngier <maz@kernel.org>,
	David Brazdil <dbrazdil@google.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Jinyang He <hejinyang@loongson.cn>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Andreas Oetken <andreas.oetken@siemens.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Zhang Yunkai <zhang.yunkai@zte.com.cn>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Ganesh Goudar <ganeshgr@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Atish Patra <atish.patra@wdc.com>,
	Anup Patel <anup.patel@wdc.com>,
	Nick Kossifidis <mick@ics.forth.gr>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Thierry Reding <treding@nvidia.com>,
	Lee Jones <lee.jones@linaro.org>,
	Guo Ren <guoren@linux.alibaba.com>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mauri Sandberg <sandberg@mailfence.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	linux-mips@vger.kernel.org, openrisc@lists.librecores.org,
	linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
	linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction
Date: Sun, 21 Nov 2021 17:01:20 +0800	[thread overview]
Message-ID: <YZoK4IiBOTPduEyN@debian> (raw)
In-Reply-To: <YZnqo3oA7srQik4N@kernel.org>

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.
>
>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.

Yes. This happens only if there are two many fixed reserved regions.
memblock.reserved can be resized after paging.

I also find another problem. Initializing dynamic reservation after
paging would fail to mark it no-map because no-map flag works when doing
direct mapping. This seems to be a circular dependency.

Thank You,
Calvin

WARNING: multiple messages have this Message-ID (diff)
From: Calvin Zhang <calvinzhang.cool@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Vineet Gupta <vgupta@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Nick Hu <nickhu@andestech.com>, Greentime Hu <green.hu@gmail.com>,
	Vincent Chen <deanbo422@gmail.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Stafford Horne <shorne@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Rich Felker <dalias@libc.org>,
	Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Vladimir Isaev <isaev@synopsys.com>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	"Kirill A. Shutemov" <kirill.shtuemov@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>, Marc Zyngier <maz@kernel.org>,
	David Brazdil <dbrazdil@google.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Jinyang He <hejinyang@loongson.cn>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Andreas Oetken <andreas.oetken@siemens.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Zhang Yunkai <zhang.yunkai@zte.com.cn>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Ganesh Goudar <ganeshgr@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Atish Patra <atish.patra@wdc.com>,
	Anup Patel <anup.patel@wdc.com>,
	Nick Kossifidis <mick@ics.forth.gr>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Thierry Reding <treding@nvidia.com>,
	Lee Jones <lee.jones@linaro.org>,
	Guo Ren <guoren@linux.alibaba.com>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mauri Sandberg <sandberg@mailfence.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	linux-mips@vger.kernel.org, openrisc@lists.librecores.org,
	linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
	linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction
Date: Sun, 21 Nov 2021 17:01:20 +0800	[thread overview]
Message-ID: <YZoK4IiBOTPduEyN@debian> (raw)
In-Reply-To: <YZnqo3oA7srQik4N@kernel.org>

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.
>
>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.

Yes. This happens only if there are two many fixed reserved regions.
memblock.reserved can be resized after paging.

I also find another problem. Initializing dynamic reservation after
paging would fail to mark it no-map because no-map flag works when doing
direct mapping. This seems to be a circular dependency.

Thank You,
Calvin

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Calvin Zhang <calvinzhang.cool@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Vineet Gupta <vgupta@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Nick Hu <nickhu@andestech.com>, Greentime Hu <green.hu@gmail.com>,
	Vincent Chen <deanbo422@gmail.com>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	Stafford Horne <shorne@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Rich Felker <dalias@libc.org>,
	Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Vladimir Isaev <isaev@synopsys.com>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	"Kirill A. Shutemov" <kirill.shtuemov@linux.intel.com>,
	Guenter Roeck <linux@roeck-us.net>, Marc Zyngier <maz@kernel.org>,
	David Brazdil <dbrazdil@google.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Jinyang He <hejinyang@loongson.cn>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Andreas Oetken <andreas.oetken@siemens.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Zhang Yunkai <zhang.yunkai@zte.com.cn>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Ganesh Goudar <ganeshgr@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Atish Patra <atish.patra@wdc.com>,
	Anup Patel <anup.patel@wdc.com>,
	Nick Kossifidis <mick@ics.forth.gr>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Thierry Reding <treding@nvidia.com>,
	Lee Jones <lee.jones@linaro.org>,
	Guo Ren <guoren@linux.alibaba.com>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mauri Sandberg <sandberg@mailfence.com>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	linux-mips@vger.kernel.org, openrisc@lists.librecores.org,
	linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
	linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction
Date: Sun, 21 Nov 2021 17:01:20 +0800	[thread overview]
Message-ID: <YZoK4IiBOTPduEyN@debian> (raw)
In-Reply-To: <YZnqo3oA7srQik4N@kernel.org>

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.
>
>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.

Yes. This happens only if there are two many fixed reserved regions.
memblock.reserved can be resized after paging.

I also find another problem. Initializing dynamic reservation after
paging would fail to mark it no-map because no-map flag works when doing
direct mapping. This seems to be a circular dependency.

Thank You,
Calvin

_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

WARNING: multiple messages have this Message-ID (diff)
From: Calvin Zhang <calvinzhang.cool@gmail.com>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH 0/2] of: remove reserved regions count restriction
Date: Sun, 21 Nov 2021 17:01:20 +0800	[thread overview]
Message-ID: <YZoK4IiBOTPduEyN@debian> (raw)
In-Reply-To: <YZnqo3oA7srQik4N@kernel.org>

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.
>
>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.

Yes. This happens only if there are two many fixed reserved regions.
memblock.reserved can be resized after paging.

I also find another problem. Initializing dynamic reservation after
paging would fail to mark it no-map because no-map flag works when doing
direct mapping. This seems to be a circular dependency.

Thank You,
Calvin

WARNING: multiple messages have this Message-ID (diff)
From: Calvin Zhang <calvinzhang.cool@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: "Kirill A. Shutemov" <kirill.shtuemov@linux.intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Rich Felker <dalias@libc.org>, Jinyang He <hejinyang@loongson.cn>,
	David Hildenbrand <david@redhat.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org, Max Filippov <jcmvbkbc@gmail.com>,
	Anup Patel <anup.patel@wdc.com>,
	Guo Ren <guoren@linux.alibaba.com>, Guo Ren <guoren@kernel.org>,
	linux-csky@vger.kernel.org, Nick Kossifidis <mick@ics.forth.gr>,
	Vladimir Isaev <isaev@synopsys.com>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Vincent Chen <deanbo422@gmail.com>, Will Deacon <will@kernel.org>,
	Markus Elfring <elfring@users.sourceforge.net>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Jonas Bonn <jonas@southpole.se>,
	devicetree@vger.kernel.org, linux-snps-arc@lists.infradead.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Palmer Dabbelt <palmerdabbelt@google.com>,
	linux-sh@vger.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Russell King <linux@armlinux.org.uk>,
	Ley Foon Tan <ley.foon.tan@intel.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ganesh Goudar <ganeshgr@linux.ibm.com>,
	David Brazdil <dbrazdil@google.com>,
	linux-riscv@lists.infradead.org,
	Guenter Roeck <linux@roeck-us.net>,
	Alexander Sverdlin <alexander.sverdlin@nokia.com>,
	Thierry Reding <treding@nvidia.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Arnd Bergmann <arnd@arndb.de>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	linux-xtensa@linux-xtensa.org, Vineet Gupta <vgupta@kernel.org>,
	Andreas Oetken <andreas.oetken@siemens.com>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	"Russell King \(Oracle\)" <rmk+kernel@armlinux.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Greentime Hu <green.hu@gmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Stafford Horne <shorne@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Chris Zankel <chris@zankel.net>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org, Alexandre Ghiti <alex@ghiti.fr>,
	Nick Hu <nickhu@andestech.com>, Atish Patra <atish.patra@wdc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Serge Semin <Sergey.Semin@baikalelectronics.ru>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Zhang Yunkai <zhang.yunkai@zte.com.cn>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Marc Zyngier <maz@kernel.org>,
	Mauri Sandberg <sandberg@mailfence.com>,
	Paul Mackerras <paulus@samba.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org
Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction
Date: Sun, 21 Nov 2021 17:01:20 +0800	[thread overview]
Message-ID: <YZoK4IiBOTPduEyN@debian> (raw)
In-Reply-To: <YZnqo3oA7srQik4N@kernel.org>

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.
>
>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.

Yes. This happens only if there are two many fixed reserved regions.
memblock.reserved can be resized after paging.

I also find another problem. Initializing dynamic reservation after
paging would fail to mark it no-map because no-map flag works when doing
direct mapping. This seems to be a circular dependency.

Thank You,
Calvin

  reply	other threads:[~2021-11-21  9:01 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  7:58 [PATCH 0/2] of: remove reserved regions count restriction Calvin Zhang
2021-11-19  7:58 ` Calvin Zhang
2021-11-19  7:58 ` [OpenRISC] " Calvin Zhang
2021-11-19  7:58 ` Calvin Zhang
2021-11-19  7:58 ` Calvin Zhang
2021-11-19  7:58 ` [PATCH 1/2] of: Sort reserved_mem related code Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-19  7:58   ` [OpenRISC] " Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-30  0:01   ` Rob Herring
2021-11-30  0:01     ` Rob Herring
2021-11-30  0:01     ` [OpenRISC] " Rob Herring
2021-11-30  0:01     ` Rob Herring
2021-11-30  0:01     ` Rob Herring
2021-11-19  7:58 ` [PATCH 2/2] of: reserved_mem: Remove reserved regions count restriction Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-19  7:58   ` [OpenRISC] " Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-19  7:58   ` Calvin Zhang
2021-11-19  9:56   ` Andy Shevchenko
2021-11-19  9:56     ` Andy Shevchenko
2021-11-19  9:56     ` [OpenRISC] " Andy Shevchenko
2021-11-19  9:56     ` Andy Shevchenko
2021-11-19  9:56     ` Andy Shevchenko
2021-11-19 10:27     ` Calvin Zhang
2021-11-19 10:27       ` Calvin Zhang
2021-11-19 10:27       ` [OpenRISC] " Calvin Zhang
2021-11-19 10:27       ` Calvin Zhang
2021-11-19 10:30     ` Calvin Zhang
2021-11-19 10:30       ` Calvin Zhang
2021-11-19 10:30       ` [OpenRISC] " Calvin Zhang
2021-11-19 10:30       ` Calvin Zhang
2021-11-19 10:30       ` Calvin Zhang
2021-11-21  6:43 ` [PATCH 0/2] of: remove " Mike Rapoport
2021-11-21  6:43   ` Mike Rapoport
2021-11-21  6:43   ` [OpenRISC] " Mike Rapoport
2021-11-21  6:43   ` Mike Rapoport
2021-11-21  6:43   ` Mike Rapoport
2021-11-21  9:01   ` Calvin Zhang [this message]
2021-11-21  9:01     ` Calvin Zhang
2021-11-21  9:01     ` [OpenRISC] " Calvin Zhang
2021-11-21  9:01     ` Calvin Zhang
2021-11-21  9:01     ` Calvin Zhang
2021-11-30  0:08   ` Rob Herring
2021-11-30  0:08     ` Rob Herring
2021-11-30  0:08     ` [OpenRISC] " Rob Herring
2021-11-30  0:08     ` Rob Herring
2021-11-30  0:08     ` Rob Herring
2021-11-30 21:07     ` Mike Rapoport
2021-11-30 21:07       ` Mike Rapoport
2021-11-30 21:07       ` [OpenRISC] " Mike Rapoport
2021-11-30 21:07       ` Mike Rapoport
2021-11-30 21:07       ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZoK4IiBOTPduEyN@debian \
    --to=calvinzhang.cool@gmail.com \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=alexander.sverdlin@nokia.com \
    --cc=andreas.oetken@siemens.com \
    --cc=andreyknvl@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=anup.patel@wdc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=atish.patra@wdc.com \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=chris@zankel.net \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=christophe.leroy@c-s.fr \
    --cc=dalias@libc.org \
    --cc=david@redhat.com \
    --cc=dbrazdil@google.com \
    --cc=deanbo422@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=elfring@users.sourceforge.net \
    --cc=frowand.list@gmail.com \
    --cc=ganeshgr@linux.ibm.com \
    --cc=geert@linux-m68k.org \
    --cc=green.hu@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guoren@kernel.org \
    --cc=guoren@linux.alibaba.com \
    --cc=hejinyang@loongson.cn \
    --cc=isaev@synopsys.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jonas@southpole.se \
    --cc=jrdr.linux@gmail.com \
    --cc=kirill.shtuemov@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=ley.foon.tan@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=mick@ics.forth.gr \
    --cc=mpe@ellerman.id.au \
    --cc=nickhu@andestech.com \
    --cc=openrisc@lists.librecores.org \
    --cc=palmer@dabbelt.com \
    --cc=palmerdabbelt@google.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulus@samba.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sandberg@mailfence.com \
    --cc=shorne@gmail.com \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=treding@nvidia.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=uclinux-h8-devel@lists.sourceforge.jp \
    --cc=vgupta@kernel.org \
    --cc=vitaly.wool@konsulko.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=ysato@users.sourceforge.jp \
    --cc=zhang.yunkai@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.