Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory

2022-06-17 Thread Mike Rapoport
On Fri, Jun 17, 2022 at 09:21:31AM +0100, Marc Zyngier wrote: > On Thu, 16 Jun 2022 16:11:34 +, Quentin Perret wrote: > > Commit a7259df76702 ("memblock: make memblock_find_in_range method > > private") changed the API using which memory is reserved for the pKVM > > hypervisor. However, it seem

Re: [PATCH] KVM: arm64: Prevent kmemleak from accessing pKVM memory

2022-06-17 Thread Mike Rapoport
gt; [ 35.001329] FAR:00043920 HPFAR:04792000 > PAR:0000 > [ 35.001329] VCPU: ]--- > > Fix this by explicitly excluding the hypervisor's memory pool from > kmemleak like we already do for the hyp BSS. > > Cc: Mik

[PATCH v5] memblock: make memblock_find_in_range method private

2021-08-16 Thread Mike Rapoport
From: Mike Rapoport There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates

[PATCH v4 2/2] memblock: make memblock_find_in_range method private

2021-08-11 Thread Mike Rapoport
From: Mike Rapoport There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates

[PATCH v4 1/2] x86/mm: memory_map_top_down: remove spurious reservation of upper 2M

2021-08-11 Thread Mike Rapoport
From: Mike Rapoport memory_map_top_down() function skips the upper 2M in the beginning and maps them in the end because "xen has big range in reserved near end of ram, skip it at first" It appears, though, that the root cause was that there was not enough memory in

[PATCH v4 0/2] memblock: make memblock_find_in_range method private

2021-08-11 Thread Mike Rapoport
From: Mike Rapoport Hi, This is v4 of "memblock: make memblock_find_in_range method private" patch that essentially replaces memblock_find_in_range() + memblock_reserve() calls with equivalent calls to memblock_phys_alloc() and prevents usage of memblock_find_in_range() outside membl

Re: [PATCH v3] memblock: make memblock_find_in_range method private

2021-08-11 Thread Mike Rapoport
On Tue, Aug 10, 2021 at 12:21:46PM -0700, Guenter Roeck wrote: > On 8/10/21 11:55 AM, Mike Rapoport wrote: > > On Mon, Aug 09, 2021 at 12:06:41PM -0700, Guenter Roeck wrote: > > > On Tue, Aug 03, 2021 at 09:42:18AM +0300, Mike Rapoport wrote: > > > > From: Mike Rapopo

Re: [PATCH v3] memblock: make memblock_find_in_range method private

2021-08-10 Thread Mike Rapoport
On Mon, Aug 09, 2021 at 12:06:41PM -0700, Guenter Roeck wrote: > On Tue, Aug 03, 2021 at 09:42:18AM +0300, Mike Rapoport wrote: > > From: Mike Rapoport > > > > There are a lot of uses of memblock_find_in_range() along with > > memblock_reserve() from the times membl

Re: [RFC PATCH 14/15] mm: introduce MIN_MAX_ORDER to replace MAX_ORDER as compile time constant.

2021-08-08 Thread Mike Rapoport
On Thu, Aug 05, 2021 at 03:02:52PM -0400, Zi Yan wrote: > From: Zi Yan > > For other MAX_ORDER uses (described below), there is no need or too much > hassle to convert certain static array to dynamic ones. Add > MIN_MAX_ORDER to serve as compile time constant in place of MAX_ORDER. > > ARM64 hyp

Re: [PATCH v3] memblock: make memblock_find_in_range method private

2021-08-03 Thread Mike Rapoport
On Tue, Aug 03, 2021 at 07:05:26PM +0100, Catalin Marinas wrote: > On Tue, Aug 03, 2021 at 09:42:18AM +0300, Mike Rapoport wrote: > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > > index 8490ed2917ff..0bffd2d1854f 100644 > > --- a/arch/arm64/mm/init.c > >

[PATCH v3] memblock: make memblock_find_in_range method private

2021-08-02 Thread Mike Rapoport
From: Mike Rapoport There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates

Re: [PATCH v2] memblock: make memblock_find_in_range method private

2021-08-02 Thread Mike Rapoport
Hi Rob, On Mon, Aug 02, 2021 at 08:55:57AM -0600, Rob Herring wrote: > On Mon, Aug 2, 2021 at 12:37 AM Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > There are a lot of uses of memblock_find_in_range() along with > > memblock_reserve() from the times

[PATCH v2] memblock: make memblock_find_in_range method private

2021-08-01 Thread Mike Rapoport
From: Mike Rapoport There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates

[PATCH] memblock: make memblock_find_in_range method private

2021-07-30 Thread Mike Rapoport
From: Mike Rapoport There are a lot of uses of memblock_find_in_range() along with memblock_reserve() from the times memblock allocation APIs did not exist. memblock_find_in_range() is the very core of memblock allocations, so any future changes to its internal behaviour would mandate updates

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-13 Thread Mike Rapoport
On Thu, May 13, 2021 at 11:44:00AM +0800, Kefeng Wang wrote: > On 2021/5/12 16:26, Mike Rapoport wrote: > > On Wed, May 12, 2021 at 11:08:14AM +0800, Kefeng Wang wrote: > > > > > > On 2021/5/11 16:48, Mike Rapoport wrote: > > > > On Mon, May 10, 2021

Re: [PATCH v4 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-12 Thread Mike Rapoport
On Wed, May 12, 2021 at 09:59:33AM +0200, Ard Biesheuvel wrote: > On Wed, 12 May 2021 at 09:34, Mike Rapoport wrote: > > > > On Wed, May 12, 2021 at 09:00:02AM +0200, Ard Biesheuvel wrote: > > > On Tue, 11 May 2021 at 12:05, Mike Rapoport wrote: > > &

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-12 Thread Mike Rapoport
On Wed, May 12, 2021 at 11:08:14AM +0800, Kefeng Wang wrote: > > On 2021/5/11 16:48, Mike Rapoport wrote: > > On Mon, May 10, 2021 at 11:10:20AM +0800, Kefeng Wang wrote: > > > > > > > > The memory is not continuous, see MEMBLOCK: > > > > >

Re: [PATCH v4 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-12 Thread Mike Rapoport
On Wed, May 12, 2021 at 09:00:02AM +0200, Ard Biesheuvel wrote: > On Tue, 11 May 2021 at 12:05, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > Hi, > > > > These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire > > pfn_val

Re: [PATCH v4 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-11 Thread Mike Rapoport
On Tue, May 11, 2021 at 04:40:01PM -0700, Andrew Morton wrote: > On Tue, 11 May 2021 13:05:50 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The arm64's version of pfn_valid() differs from the generic because of two > > reasons: > > >

[PATCH v4 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-11 Thread Mike Rapoport
From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying mem

[PATCH v4 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-05-11 Thread Mike Rapoport
From: Mike Rapoport The intended semantics of pfn_valid() is to verify whether there is a struct page for the pfn in question and nothing else. Yet, on arm64 it is used to distinguish memory areas that are mapped in the linear map vs those that require ioremap() to access them. Introduce a

[PATCH v4 2/4] memblock: update initialization of reserved pages

2021-05-11 Thread Mike Rapoport
From: Mike Rapoport The struct pages representing a reserved memory region are initialized using reserve_bootmem_range() function. This function is called for each reserved region just before the memory is freed from memblock to the buddy page allocator. The struct pages for MEMBLOCK_NOMAP

[PATCH v4 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-05-11 Thread Mike Rapoport
From: Mike Rapoport Add comment describing the semantics of pfn_valid() that clarifies that pfn_valid() only checks for availability of a memory map entry (i.e. struct page) for a PFN rather than availability of usable memory backing that PFN. The most "generic" version of pfn_valid

[PATCH v4 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-05-11 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire pfn_valid_within() to 1. The idea is to mark NOMAP pages as reserved in the memory map and restore the intended semantics of pfn_valid() to designate availability of struct page for a pfn. With

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-11 Thread Mike Rapoport
On Mon, May 10, 2021 at 11:10:20AM +0800, Kefeng Wang wrote: > > > > The memory is not continuous, see MEMBLOCK: > > > memory size = 0x4c0f reserved size = 0x027ef058 > > > memory.cnt = 0xa > > > memory[0x0][0x80a0-0x855f], 0x04c0 bytes flags: 0x0 > > > memory[0x1][

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-08 Thread Mike Rapoport
On Fri, May 07, 2021 at 08:34:52PM +0800, Kefeng Wang wrote: > > > On 2021/5/7 18:30, Mike Rapoport wrote: > > On Fri, May 07, 2021 at 03:17:08PM +0800, Kefeng Wang wrote: > > > > > > On 2021/5/6 20:47, Kefeng Wang wrote: > > > > > > > >

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-07 Thread Mike Rapoport
On Fri, May 07, 2021 at 03:17:08PM +0800, Kefeng Wang wrote: > > On 2021/5/6 20:47, Kefeng Wang wrote: > > > > > > > > > > no, the CONFIG_ARM_LPAE is not set, and yes with same panic at > > > > > > move_freepages at > > > > > > > > > > > > start_pfn/end_pfn [de600, de7ff], [de60, de7ff000]

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-03 Thread Mike Rapoport
On Mon, May 03, 2021 at 10:07:01AM +0200, David Hildenbrand wrote: > On 03.05.21 08:26, Mike Rapoport wrote: > > On Fri, Apr 30, 2021 at 07:24:37PM +0800, Kefeng Wang wrote: > > > > > > > > > On 2021/4/30 17:51, Mike Rapoport wrote: > > > > On Th

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-05-02 Thread Mike Rapoport
On Fri, Apr 30, 2021 at 07:24:37PM +0800, Kefeng Wang wrote: > > > On 2021/4/30 17:51, Mike Rapoport wrote: > > On Thu, Apr 29, 2021 at 06:22:55PM +0800, Kefeng Wang wrote: > > > > > > On 2021/4/29 14:57, Mike Rapoport wrote: > > > > > > >

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-30 Thread Mike Rapoport
On Thu, Apr 29, 2021 at 06:22:55PM +0800, Kefeng Wang wrote: > > On 2021/4/29 14:57, Mike Rapoport wrote: > > > > > Do you use SPARSMEM? If yes, what is your section size? > > > > What is the value if CONFIG_FORCE_MAX_ZONEORDER in your configuration? > >

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-28 Thread Mike Rapoport
On Thu, Apr 29, 2021 at 08:48:26AM +0800, Kefeng Wang wrote: > > On 2021/4/28 13:59, Mike Rapoport wrote: > > On Tue, Apr 27, 2021 at 07:08:59PM +0800, Kefeng Wang wrote: > > > On 2021/4/27 14:23, Mike Rapoport wrote: > > > > On Mon, Apr 26, 2021 at 11

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-27 Thread Mike Rapoport
On Tue, Apr 27, 2021 at 07:08:59PM +0800, Kefeng Wang wrote: > > On 2021/4/27 14:23, Mike Rapoport wrote: > > On Mon, Apr 26, 2021 at 11:26:38PM +0800, Kefeng Wang wrote: > > > On 2021/4/26 13:20, Mike Rapoport wrote: > > > > On Sun, Apr 25, 2021 at 03

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-26 Thread Mike Rapoport
On Mon, Apr 26, 2021 at 11:26:38PM +0800, Kefeng Wang wrote: > > On 2021/4/26 13:20, Mike Rapoport wrote: > > On Sun, Apr 25, 2021 at 03:51:56PM +0800, Kefeng Wang wrote: > > > On 2021/4/25 15:19, Mike Rapoport wrote: > > > > > > On Fri, Apr 23, 2021

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-25 Thread Mike Rapoport
On Sun, Apr 25, 2021 at 03:51:56PM +0800, Kefeng Wang wrote: > > On 2021/4/25 15:19, Mike Rapoport wrote: > > On Fri, Apr 23, 2021 at 04:11:16PM +0800, Kefeng Wang wrote: > > I tested this patchset(plus arm32 change, like arm64 does) based on > l

Re: arm32: panic in move_freepages (Was [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid())

2021-04-25 Thread Mike Rapoport
On Fri, Apr 23, 2021 at 04:11:16PM +0800, Kefeng Wang wrote: > > I tested this patchset(plus arm32 change, like arm64 does) based on lts > 5.10,add > > some debug log, the useful info shows below, if we enable HOLES_IN_ZONE, no > panic, > > any idea, thanks. Are there any changes on top of 5.1

Re: [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-24 Thread Mike Rapoport
On Thu, Apr 22, 2021 at 11:28:24PM +0800, Kefeng Wang wrote: > > On 2021/4/22 15:29, Mike Rapoport wrote: > > On Thu, Apr 22, 2021 at 03:00:20PM +0800, Kefeng Wang wrote: > > > On 2021/4/21 14:51, Mike Rapoport wrote: > > > > From: Mike Rapoport > >

Re: [PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-22 Thread Mike Rapoport
On Thu, Apr 22, 2021 at 03:00:20PM +0800, Kefeng Wang wrote: > > On 2021/4/21 14:51, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Hi, > > > > These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire > > pfn_valid_within() to 1

[PATCH v3 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-04-21 Thread Mike Rapoport
From: Mike Rapoport The intended semantics of pfn_valid() is to verify whether there is a struct page for the pfn in question and nothing else. Yet, on arm64 it is used to distinguish memory areas that are mapped in the linear map vs those that require ioremap() to access them. Introduce a

[PATCH v3 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-21 Thread Mike Rapoport
From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying mem

[PATCH v3 2/4] memblock: update initialization of reserved pages

2021-04-21 Thread Mike Rapoport
From: Mike Rapoport The struct pages representing a reserved memory region are initialized using reserve_bootmem_range() function. This function is called for each reserved region just before the memory is freed from memblock to the buddy page allocator. The struct pages for MEMBLOCK_NOMAP

[PATCH v3 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-04-21 Thread Mike Rapoport
From: Mike Rapoport Add comment describing the semantics of pfn_valid() that clarifies that pfn_valid() only checks for availability of a memory map entry (i.e. struct page) for a PFN rather than availability of usable memory backing that PFN. The most "generic" version of pfn_valid

[PATCH v3 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-21 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire pfn_valid_within() to 1. The idea is to mark NOMAP pages as reserved in the memory map and restore the intended semantics of pfn_valid() to designate availability of struct page for a pfn. With

Re: [PATCH v2 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-21 Thread Mike Rapoport
On Wed, Apr 21, 2021 at 04:36:46PM +0530, Anshuman Khandual wrote: > > On 4/21/21 12:21 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The arm64's version of pfn_valid() differs from the generic because of two > > reasons: > > > > * Part

Re: [PATCH v2 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-04-21 Thread Mike Rapoport
On Wed, Apr 21, 2021 at 04:29:48PM +0530, Anshuman Khandual wrote: > > On 4/21/21 12:21 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The intended semantics of pfn_valid() is to verify whether there is a > > struct page for the pfn in question and nothin

[PATCH v2 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying mem

[PATCH v2 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The intended semantics of pfn_valid() is to verify whether there is a struct page for the pfn in question and nothing else. Yet, on arm64 it is used to distinguish memory areas that are mapped in the linear map vs those that require ioremap() to access them. Introduce a

[PATCH v2 2/4] memblock: update initialization of reserved pages

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The struct pages representing a reserved memory region are initialized using reserve_bootmem_range() function. This function is called for each reserved region just before the memory is freed from memblock to the buddy page allocator. The struct pages for MEMBLOCK_NOMAP

[PATCH v2 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport Add comment describing the semantics of pfn_valid() that clarifies that pfn_valid() only checks for availability of a memory map entry (i.e. struct page) for a PFN rather than availability of usable memory backing that PFN. The most "generic" version of pfn_valid

[PATCH v2 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire pfn_valid_within() to 1. The idea is to mark NOMAP pages as reserved in the memory map and restore the intended semantics of pfn_valid() to designate availability of struct page for a pfn. With

Re: [PATCH v1 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-20 Thread Mike Rapoport
On Tue, Apr 20, 2021 at 06:00:55PM +0200, David Hildenbrand wrote: > On 20.04.21 11:09, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The arm64's version of pfn_valid() differs from the generic because of two > > reasons: > > > > * Parts o

Re: [PATCH v1 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-04-20 Thread Mike Rapoport
On Tue, Apr 20, 2021 at 05:57:57PM +0200, David Hildenbrand wrote: > On 20.04.21 11:09, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The intended semantics of pfn_valid() is to verify whether there is a > > struct page for the pfn in question and nothing else

Re: [PATCH v1 2/4] memblock: update initialization of reserved pages

2021-04-20 Thread Mike Rapoport
On Tue, Apr 20, 2021 at 05:18:55PM +0200, David Hildenbrand wrote: > On 20.04.21 17:03, Mike Rapoport wrote: > > On Tue, Apr 20, 2021 at 03:56:28PM +0200, David Hildenbrand wrote: > > > On 20.04.21 11:09, Mike Rapoport wrote: > > > > From: Mike Rapoport >

Re: [PATCH v1 2/4] memblock: update initialization of reserved pages

2021-04-20 Thread Mike Rapoport
On Tue, Apr 20, 2021 at 03:56:28PM +0200, David Hildenbrand wrote: > On 20.04.21 11:09, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The struct pages representing a reserved memory region are initialized > > using reserve_bootmem_range() function. This

Re: [PATCH v1 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-04-20 Thread Mike Rapoport
On Tue, Apr 20, 2021 at 11:22:53AM +0200, David Hildenbrand wrote: > On 20.04.21 11:09, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Add comment describing the semantics of pfn_valid() that clarifies that > > pfn_valid() only checks for availability of a me

[PATCH v1 4/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying mem

[PATCH v1 3/4] arm64: decouple check whether pfn is in linear map from pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The intended semantics of pfn_valid() is to verify whether there is a struct page for the pfn in question and nothing else. Yet, on arm64 it is used to distinguish memory areas that are mapped in the linear map vs those that require ioremap() to access them. Introduce a

[PATCH v1 2/4] memblock: update initialization of reserved pages

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport The struct pages representing a reserved memory region are initialized using reserve_bootmem_range() function. This function is called for each reserved region just before the memory is freed from memblock to the buddy page allocator. The struct pages for MEMBLOCK_NOMAP

[PATCH v1 1/4] include/linux/mmzone.h: add documentation for pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport Add comment describing the semantics of pfn_valid() that clarifies that pfn_valid() only checks for availability of a memory map entry (i.e. struct page) for a PFN rather than availability of usable memory backing that PFN. The most "generic" version of pfn_valid

[PATCH v1 0/4] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-20 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire pfn_valid_within() to 1. The idea is to mark NOMAP pages as reserved in the memory map and restore the intended semantics of pfn_valid() to designate availability of struct page for a pfn. With

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-16 Thread Mike Rapoport
On Thu, Apr 15, 2021 at 11:30:12AM +0200, David Hildenbrand wrote: > > Not sure we really need a new pagetype here, PG_Reserved seems to be quite > > enough to say "don't touch this". I generally agree that we could make > > PG_Reserved a PageType and then have several sub-types for reserved memor

Re: [RFC/RFT PATCH 2/3] arm64: decouple check whether pfn is normal memory from pfn_valid()

2021-04-16 Thread Mike Rapoport
On Thu, Apr 15, 2021 at 11:31:26AM +0200, David Hildenbrand wrote: > On 14.04.21 22:29, Mike Rapoport wrote: > > On Wed, Apr 14, 2021 at 05:58:26PM +0200, David Hildenbrand wrote: > > > On 08.04.21 07:14, Anshuman Khandual wrote: > > > > > > > &g

Re: [RFC/RFT PATCH 2/3] arm64: decouple check whether pfn is normal memory from pfn_valid()

2021-04-14 Thread Mike Rapoport
On Wed, Apr 14, 2021 at 05:58:26PM +0200, David Hildenbrand wrote: > On 08.04.21 07:14, Anshuman Khandual wrote: > > > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > > From: Mike Rapoport > > > > > > The intended semantics of pfn_valid() is to verify wh

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-14 Thread Mike Rapoport
On Wed, Apr 14, 2021 at 05:52:57PM +0200, David Hildenbrand wrote: > On 14.04.21 17:27, Ard Biesheuvel wrote: > > On Wed, 14 Apr 2021 at 17:14, David Hildenbrand wrote: > > > > > > On 07.04.21 19:26, Mike Rapoport wrote: > > > > From: Mike Rapoport > &g

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-14 Thread Mike Rapoport
On Wed, Apr 14, 2021 at 05:27:53PM +0200, Ard Biesheuvel wrote: > On Wed, 14 Apr 2021 at 17:14, David Hildenbrand wrote: > > > > On 07.04.21 19:26, Mike Rapoport wrote: > > > From: Mike Rapoport > > > > > > The struct pages representing a reserved

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-14 Thread Mike Rapoport
On Wed, Apr 14, 2021 at 05:12:11PM +0200, David Hildenbrand wrote: > On 07.04.21 19:26, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The struct pages representing a reserved memory region are initialized > > using reserve_bootmem_range() function. This

Re: [RFC/RFT PATCH 0/3] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-07 Thread Mike Rapoport
On Thu, Apr 08, 2021 at 10:49:02AM +0530, Anshuman Khandual wrote: > Adding James here. > > + James Morse > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Hi, > > > > These patches aim to remove CONFIG_HOLES_IN_ZONE

Re: [RFC/RFT PATCH 3/3] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-07 Thread Mike Rapoport
On Thu, Apr 08, 2021 at 10:42:43AM +0530, Anshuman Khandual wrote: > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The arm64's version of pfn_valid() differs from the generic because of two > > reasons: > > > > * Part

Re: [RFC/RFT PATCH 2/3] arm64: decouple check whether pfn is normal memory from pfn_valid()

2021-04-07 Thread Mike Rapoport
On Thu, Apr 08, 2021 at 10:44:58AM +0530, Anshuman Khandual wrote: > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The intended semantics of pfn_valid() is to verify whether there is a > > struct page for the pfn in question and nothin

Re: [RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-07 Thread Mike Rapoport
On Thu, Apr 08, 2021 at 10:46:18AM +0530, Anshuman Khandual wrote: > > > On 4/7/21 10:56 PM, Mike Rapoport wrote: > > From: Mike Rapoport > > > > The struct pages representing a reserved memory region are initialized > > using reserve_bootmem_range() function.

[RFC/RFT PATCH 3/3] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-07 Thread Mike Rapoport
From: Mike Rapoport The arm64's version of pfn_valid() differs from the generic because of two reasons: * Parts of the memory map are freed during boot. This makes it necessary to verify that there is actual physical memory that corresponds to a pfn which is done by querying mem

[RFC/RFT PATCH 2/3] arm64: decouple check whether pfn is normal memory from pfn_valid()

2021-04-07 Thread Mike Rapoport
From: Mike Rapoport The intended semantics of pfn_valid() is to verify whether there is a struct page for the pfn in question and nothing else. Yet, on arm64 it is used to distinguish memory areas that are mapped in the linear map vs those that require ioremap() to access them. Introduce a

[RFC/RFT PATCH 1/3] memblock: update initialization of reserved pages

2021-04-07 Thread Mike Rapoport
From: Mike Rapoport The struct pages representing a reserved memory region are initialized using reserve_bootmem_range() function. This function is called for each reserved region just before the memory is freed from memblock to the buddy page allocator. The struct pages for MEMBLOCK_NOMAP

[RFC/RFT PATCH 0/3] arm64: drop pfn_valid_within() and simplify pfn_valid()

2021-04-07 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches aim to remove CONFIG_HOLES_IN_ZONE and essentially hardwire pfn_valid_within() to 1. The idea is to mark NOMAP pages as reserved in the memory map and restore the intended semantics of pfn_valid() to designate availability of struct page for a pfn. With

Re: [PATCH v4 03/14] arm64: add support for folded p4d page tables

2020-05-16 Thread Mike Rapoport
On Fri, May 15, 2020 at 11:40:12AM -0700, Andrew Morton wrote: > On Tue, 14 Apr 2020 18:34:44 +0300 Mike Rapoport wrote: > > > Implement primitives necessary for the 4th level folding, add walks of p4d > > level where appropriate, replace 5level-fixup.h with pgtable-nop4

Re: [PATCH v4 02/14] arm: add support for folded p4d page tables

2020-05-11 Thread Mike Rapoport
Hi Marek, On Mon, May 11, 2020 at 08:36:41AM +0200, Marek Szyprowski wrote: > Hi Mike, > > On 08.05.2020 19:42, Mike Rapoport wrote: > > On Fri, May 08, 2020 at 08:53:27AM +0200, Marek Szyprowski wrote: > >> On 07.05.2020 18:11, Mike Rapoport wrote: > >>> On T

Re: [PATCH v4 02/14] arm: add support for folded p4d page tables

2020-05-08 Thread Mike Rapoport
On Fri, May 08, 2020 at 08:53:27AM +0200, Marek Szyprowski wrote: > Hi Mike, > > On 07.05.2020 18:11, Mike Rapoport wrote: > > On Thu, May 07, 2020 at 02:16:56PM +0200, Marek Szyprowski wrote: > >> On 14.04.2020 17:34, Mike Rapoport wrote: > >>> From:

Re: [PATCH v4 02/14] arm: add support for folded p4d page tables

2020-05-07 Thread Mike Rapoport
Hi, On Thu, May 07, 2020 at 02:16:56PM +0200, Marek Szyprowski wrote: > Hi > > On 14.04.2020 17:34, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Implement primitives necessary for the 4th level folding, add walks of p4d > > level where appropriate,

[PATCH v4 14/14] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport There are no architectures that use include/asm-generic/5level-fixup.h therefore it can be removed along with __ARCH_HAS_5LEVEL_HACK define and the code it surrounds Signed-off-by: Mike Rapoport --- include/asm-generic/5level-fixup.h | 58

[PATCH v4 12/14] unicore32: remove __ARCH_USE_5LEVEL_HACK

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport The unicore32 architecture has 2 level page tables and asm-generic/pgtable-nopmd.h and explicit casts from pud_t to pgd_t for page table folding. Add p4d walk in the only place that actually unfolds the pud level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike

[PATCH v4 11/14] sh: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/sh/include/asm/pgtable-2level.h | 1 - arch/sh/include/asm/pgtable-3level.h | 1 - arch/sh

[PATCH v4 13/14] asm-generic: remove pgtable-nop4d-hack.h

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport No architecture defines __ARCH_USE_5LEVEL_HACK and therefore pgtable-nop4d-hack.h will be never actually included. Remove it. Signed-off-by: Mike Rapoport --- include/asm-generic/pgtable-nop4d-hack.h | 64 include/asm-generic/pgtable-nopud.h

[PATCH v4 10/14] sh: drop __pXd_offset() macros that duplicate pXd_index() ones

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport The __pXd_offset() macros are identical to the pXd_index() macros and there is no point to keep both of them. All architectures define and use pXd_index() so let's keep only those to make mips consistent with the rest of the kernel. Signed-off-by: Mike Rapoport --- ar

[PATCH v4 06/14] nios2: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/nios2/include/asm/pgtable.h | 3 +-- arch/nios2/mm/fault.c| 9 +++-- arch

[PATCH v4 08/14] powerpc: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. Signed-off-by: Mike Rapoport Tested-by: Christophe Leroy # 8xx and 83xx --- arch/powerpc/include/asm/book3s/32/pgtable.h

[PATCH v4 09/14] sh: fault: Modernize printing of kernel messages

2020-04-14 Thread Mike Rapoport
From: Geert Uytterhoeven - Convert from printk() to pr_*(), - Add missing continuations, - Use "%llx" to format u64, - Join multiple prints in show_fault_oops() into a single print. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mike Rapoport --- arch/sh/mm/fa

[PATCH v4 07/14] openrisc: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/openrisc/include/asm/pgtable.h | 1 - arch/openrisc/mm/fault.c| 10

[PATCH v4 02/14] arm: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/arm/include/asm/pgtable.h | 1 - arch/arm/lib/uaccess_with_memcpy.c | 7 +- arch/arm/mach

[PATCH v4 03/14] arm64: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, replace 5level-fixup.h with pgtable-nop4d.h and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/arm64/include/asm/kvm_mmu.h| 10 +- arch/arm64

[PATCH v4 05/14] ia64: add support for folded p4d page tables

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate, remove usage of __ARCH_USE_5LEVEL_HACK and replace 5level-fixup.h with pgtable-nop4d.h Signed-off-by: Mike Rapoport --- arch/ia64/include/asm/pgalloc.h | 4 ++-- arch/ia64

[PATCH v4 01/14] h8300: remove usage of __ARCH_USE_5LEVEL_HACK

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport h8300 is a nommu architecture and does not require fixup for upper layers of the page tables because it is already handled by the generic nommu implementation. Remove definition of __ARCH_USE_5LEVEL_HACK in arch/h8300/include/asm/pgtable.h Signed-off-by: Mike Rapoport

[PATCH v4 04/14] hexagon: remove __ARCH_USE_5LEVEL_HACK

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport The hexagon architecture has 2 level page tables and as such most of the page table folding is already implemented in asm-generic/pgtable-nopmd.h. Fixup the only place in arch/hexagon to unfold the p4d level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport

[PATCH v4 00/14] mm: remove __ARCH_HAS_5LEVEL_HACK

2020-04-14 Thread Mike Rapoport
From: Mike Rapoport Hi, These patches convert several architectures to use page table folding and remove __ARCH_HAS_5LEVEL_HACK along with include/asm-generic/5level-fixup.h and include/asm-generic/pgtable-nop4d-hack.h. With that we'll have a single and consistent way of dealing with page

Re: [PATCH v3 07/14] powerpc/32: drop get_pteptr()

2020-03-08 Thread Mike Rapoport
On Fri, Mar 06, 2020 at 08:00:16PM -0800, Andrew Morton wrote: > On Thu, 27 Feb 2020 10:46:01 +0200 Mike Rapoport wrote: > > > Commit 8d30c14cab30 ("powerpc/mm: Rework I$/D$ coherency (v3)") and > > commit 90ac19a8b21b ("[POWERPC] Abolish iopa(), mm_ptov(),

[PATCH v3 14/14] mm: remove __ARCH_HAS_5LEVEL_HACK and include/asm-generic/5level-fixup.h

2020-02-27 Thread Mike Rapoport
From: Mike Rapoport There are no architectures that use include/asm-generic/5level-fixup.h therefore it can be removed along with __ARCH_HAS_5LEVEL_HACK define and the code it surrounds Signed-off-by: Mike Rapoport --- include/asm-generic/5level-fixup.h | 58

[PATCH v3 13/14] asm-generic: remove pgtable-nop4d-hack.h

2020-02-27 Thread Mike Rapoport
From: Mike Rapoport No architecture defines __ARCH_USE_5LEVEL_HACK and therefore pgtable-nop4d-hack.h will be never actually included. Remove it. Signed-off-by: Mike Rapoport --- include/asm-generic/pgtable-nop4d-hack.h | 64 include/asm-generic/pgtable-nopud.h

[PATCH v3 09/14] sh: fault: Modernize printing of kernel messages

2020-02-27 Thread Mike Rapoport
From: Geert Uytterhoeven - Convert from printk() to pr_*(), - Add missing continuations, - Use "%llx" to format u64, - Join multiple prints in show_fault_oops() into a single print. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mike Rapoport --- arch/sh/mm/fa

[PATCH v3 07/14] powerpc/32: drop get_pteptr()

2020-02-27 Thread Mike Rapoport
y user of get_pteptr() is __change_page_attr() which operates on kernel context and on lowmem pages only. Move page table traversal to __change_page_attr() and drop get_pteptr(). Signed-off-by: Christophe Leroy Signed-off-by: Mike Rapoport --- arch/powerpc/

[PATCH v3 12/14] unicore32: remove __ARCH_USE_5LEVEL_HACK

2020-02-27 Thread Mike Rapoport
From: Mike Rapoport The unicore32 architecture has 2 level page tables and asm-generic/pgtable-nopmd.h and explicit casts from pud_t to pgd_t for page table folding. Add p4d walk in the only place that actually unfolds the pud level and remove __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike

[PATCH v3 08/14] powerpc: add support for folded p4d page tables

2020-02-27 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and replace 5level-fixup.h with pgtable-nop4d.h. Signed-off-by: Mike Rapoport Tested-by: Christophe Leroy # 8xx and 83xx --- arch/powerpc/include/asm/book3s/32/pgtable.h

[PATCH v3 11/14] sh: add support for folded p4d page tables

2020-02-27 Thread Mike Rapoport
From: Mike Rapoport Implement primitives necessary for the 4th level folding, add walks of p4d level where appropriate and remove usage of __ARCH_USE_5LEVEL_HACK. Signed-off-by: Mike Rapoport --- arch/sh/include/asm/pgtable-2level.h | 1 - arch/sh/include/asm/pgtable-3level.h | 1 - arch/sh

  1   2   >