linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] MIPS: fix memory setup for platforms with PHYS_OFFSET != 0
@ 2019-02-27  9:42 Thomas Bogendoerfer
  2019-02-28  2:51 ` Paul Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 2019-02-27  9:42 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel
  Cc: Mike Rapoport

For platforms, which use a PHYS_OFFSET != 0, symbol _end also
contains that offset. So when calling memblock_reserve() for
reserving kernel the size argument needs to be adjusted.

Fixes: bcec54bf3118 ("mips: switch to NO_BOOTMEM")
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 arch/mips/kernel/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 8c6c48ed786a..d2e5a5ad0e6f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -384,7 +384,8 @@ static void __init bootmem_init(void)
 	init_initrd();
 	reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
 
-	memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
+	memblock_reserve(PHYS_OFFSET,
+			 (reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
 
 	/*
 	 * max_low_pfn is not a number of pages. The number of pages
-- 
2.13.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] MIPS: fix memory setup for platforms with PHYS_OFFSET != 0
  2019-02-27  9:42 [PATCH v2] MIPS: fix memory setup for platforms with PHYS_OFFSET != 0 Thomas Bogendoerfer
@ 2019-02-28  2:51 ` Paul Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-02-28  2:51 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel,
	Mike Rapoport, linux-mips

Hello,

Thomas Bogendoerfer wrote:
> For platforms, which use a PHYS_OFFSET != 0, symbol _end also
> contains that offset. So when calling memblock_reserve() for
> reserving kernel the size argument needs to be adjusted.
> 
> Fixes: bcec54bf3118 ("mips: switch to NO_BOOTMEM")
> Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>

Applied to mips-fixes.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-28  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27  9:42 [PATCH v2] MIPS: fix memory setup for platforms with PHYS_OFFSET != 0 Thomas Bogendoerfer
2019-02-28  2:51 ` Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).