fixups for generic implementation of pfn_valid()
cover fixups for generic implementation of pfn_valid()
From: "Mike Rapoport (IBM)" <[email protected]>
Hi,
Guenter reported boot failures on m68k-nommu and sh caused by the switch to the generic implementation of pfn_valid():
https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/all/[email protected]
These are small fixups on top of mm-stable that address the issues.
Mike Rapoport (IBM) (2):
m68k/nommu: add missing definition of ARCH_PFN_OFFSET
sh: initialize max_mapnr
arch/m68k/include/asm/page_no.h | 2 ++ arch/sh/mm/init.c | 1 + 2 files changed, 3 insertions(+)
base-commit: f67d6b26649379f8520abe6a6c7ed335310bf01e
Signature · 1 line
2.35.1
PATCH 1/2 m68k/nommu: add missing definition of ARCH_PFN_OFFSET
From: "Mike Rapoport (IBM)" <[email protected]>
On m68k/nommu RAM does not necessarily start at 0x0 and when it does not pfn_valid() uses a wrong offset into the memory map which causes silent boot failures.
Define ARCH_PFN_OFFSET to make pfn_valid() use the correct offset.
--- arch/m68k/include/asm/page_no.h | 2 ++ 1 file changed, 2 insertions(+)
arch/m68k/include/asm/page_no.h +2 -0
@@ -28,6 +28,8 @@ extern unsigned long memory_end;#define virt_addr_valid (kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \ ((unsigned long)(kaddr) < memory_end)) +#define ARCH_PFN_OFFSET PHYS_PFN(PAGE_OFFSET_RAW) +#endif /* __ASSEMBLY__ */ #endif /* _M68K_PAGE_NO_H */
Signature · 1 line
2.35.1
Re: [PATCH 1/2] m68k/nommu: add missing definition of ARCH_PFN_OFFSET
Quoted 11 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
On m68k/nommu RAM does not necessarily start at
0x0and when it does notpfn_valid()uses a wrong offset into the memory map which causes silent boot failures.Define
ARCH_PFN_OFFSETto makepfn_valid()use the correct offset.Reported-by Guenter Roeck <[email protected]>Fixes d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU")Signed-off-by Mike Rapoport (IBM) <[email protected]>
Quoted 17 lines
--- arch/m68k/include/asm/page_no.h | 2 ++ 1 file changed, 2 insertions(+)arch/m68k/include/asm/page_no.h +2
-0@@ -28,6 +28,8 @@ extern unsigned long memory_end;#define virt_addr_valid (kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \ ((unsigned long)(kaddr) < memory_end)) +#define ARCH_PFN_OFFSET PHYS_PFN(PAGE_OFFSET_RAW) +#endif /* __ASSEMBLY__ */ #endif /* _M68K_PAGE_NO_H */
Re: [PATCH 1/2] m68k/nommu: add missing definition of ARCH_PFN_OFFSET
In reply to Mike RapoportQuoted 6 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
On m68k/nommu RAM does not necessarily start at
0x0and when it does notpfn_valid()uses a wrong offset into the memory map which causes silent boot failures.
Quoted 6 lines
Define
ARCH_PFN_OFFSETto makepfn_valid()use the correct offset.Reported-by Guenter Roeck <[email protected]>Fixes d82f07f06cf8 ("m68k: use asm-generic/memory_model.h for both MMU and !MMU")Signed-off-by Mike Rapoport (IBM) <[email protected]>---
Signature · 3 lines
Thanks, David / dhildenb
PATCH 2/2 sh: initialize max_mapnr
In reply to Mike RapoportFrom: "Mike Rapoport (IBM)" <[email protected]>
sh never initializes max_mapnr which is used by the generic implementation of pfn_valid().
Initialize max_mapnr with set_max_mapnr() in sh::paging_init().
--- arch/sh/mm/init.c | 1 + 1 file changed, 1 insertion(+)
arch/sh/mm/init.c +1 -0
@@ -301,6 +301,7 @@ void __init paging_init(void)*/ max_low_pfn = max_pfn =memblock_end_of_DRAM () >>PAGE_SHIFT ; min_low_pfn = __MEMORY_START >>PAGE_SHIFT ; +set_max_mapnr (max_low_pfn - min_low_pfn);nodes_clear (node_online_map);
Signature · 1 line
2.35.1
Re: [PATCH 2/2] sh: initialize max_mapnr
Quoted 19 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
sh never initializes
max_mapnrwhich is used by the generic implementation ofpfn_valid().Initialize
max_mapnrwithset_max_mapnr()insh::paging_init().Reported-by Guenter Roeck <[email protected]>Fixes e5080a967785 ("mm, arch: add generic implementation of pfn_valid() for FLATMEM")Signed-off-by Mike Rapoport (IBM) <[email protected]>--- arch/sh/mm/init.c | 1 + 1 file changed, 1 insertion(+)arch/sh/mm/init.c +0
-0
arch/sh/mm/init.c void __init paging_init(void) · line 307
Quoted 7 lines
arch/sh/mm/init.c +1
-0@@ -301,6 +301,7 @@ void __init paging_init(void)*/ max_low_pfn = max_pfn =memblock_end_of_DRAM () >>PAGE_SHIFT ; min_low_pfn = __MEMORY_START >>PAGE_SHIFT ; +set_max_mapnr (max_low_pfn - min_low_pfn);nodes_clear (node_online_map);
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Re: [PATCH 2/2] sh: initialize max_mapnr
In reply to Mike RapoportQuoted 19 lines · Mike Rapoport
From: "Mike Rapoport (IBM)" <[email protected]>
sh never initializes
max_mapnrwhich is used by the generic implementation ofpfn_valid().Initialize
max_mapnrwithset_max_mapnr()insh::paging_init().Reported-by Guenter Roeck <[email protected]>Fixes e5080a967785 ("mm, arch: add generic implementation of pfn_valid() for FLATMEM")Signed-off-by Mike Rapoport (IBM) <[email protected]>--- arch/sh/mm/init.c | 1 + 1 file changed, 1 insertion(+)arch/sh/mm/init.c +0
-0
arch/sh/mm/init.c void __init paging_init(void) · line 307
Quoted 7 lines
arch/sh/mm/init.c +1
-0@@ -301,6 +301,7 @@ void __init paging_init(void)*/ max_low_pfn = max_pfn =memblock_end_of_DRAM () >>PAGE_SHIFT ; min_low_pfn = __MEMORY_START >>PAGE_SHIFT ; +set_max_mapnr (max_low_pfn - min_low_pfn);nodes_clear (node_online_map);
Signature · 3 lines
Thanks, David / dhildenb