Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-18 Thread Russell King - ARM Linux admin
On Sun, Aug 18, 2019 at 11:20:35AM +0300, Mike Rapoport wrote: > On Sun, Aug 18, 2019 at 03:46:51PM +0800, Zhaoyang Huang wrote: > > On Sun, Aug 18, 2019 at 2:32 AM Russell King - ARM Linux admin > > wrote: > > > > > > On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > > > > From: Z

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-18 Thread Mike Rapoport
On Sun, Aug 18, 2019 at 03:46:51PM +0800, Zhaoyang Huang wrote: > On Sun, Aug 18, 2019 at 2:32 AM Russell King - ARM Linux admin > wrote: > > > > On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > > > From: Zhaoyang Huang > > > > > > pfn_valid can be wrong while the MSB of physical

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-18 Thread Zhaoyang Huang
On Sun, Aug 18, 2019 at 2:32 AM Russell King - ARM Linux admin wrote: > > On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > > From: Zhaoyang Huang > > > > pfn_valid can be wrong while the MSB of physical address be trimed as pfn > > larger than the max_pfn. > > What scenario are y

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-17 Thread Russell King - ARM Linux admin
On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > From: Zhaoyang Huang > > pfn_valid can be wrong while the MSB of physical address be trimed as pfn > larger than the max_pfn. What scenario are you addressing here? At a guess, you're addressing the non-LPAE case with PFNs that c

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-17 Thread Zhaoyang Huang
On Sat, Aug 17, 2019 at 5:00 PM Mike Rapoport wrote: > > On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > > From: Zhaoyang Huang > > > > pfn_valid can be wrong while the MSB of physical address be trimed as pfn > > larger than the max_pfn. > > How the overflow of __pfn_to_phys()

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-17 Thread Mike Rapoport
On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > From: Zhaoyang Huang > > pfn_valid can be wrong while the MSB of physical address be trimed as pfn > larger than the max_pfn. How the overflow of __pfn_to_phys() is related to max_pfn? Where is the guarantee that __pfn_to_phys(max

Re: [PATCH] arch : arm : add a criteria for pfn_valid

2019-08-16 Thread Matthew Wilcox
On Sat, Aug 17, 2019 at 11:00:13AM +0800, Zhaoyang Huang wrote: > #ifdef CONFIG_HAVE_ARCH_PFN_VALID > int pfn_valid(unsigned long pfn) > { > - return memblock_is_map_memory(__pfn_to_phys(pfn)); > + return (pfn > max_pfn) ? > + false : memblock_is_map_memory(__pfn_to_phys(pfn)

[PATCH] arch : arm : add a criteria for pfn_valid

2019-08-16 Thread Zhaoyang Huang
From: Zhaoyang Huang pfn_valid can be wrong while the MSB of physical address be trimed as pfn larger than the max_pfn. Signed-off-by: Zhaoyang Huang --- arch/arm/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index c2daa