Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6be75d0 authored by David Daney's avatar David Daney Committed by Ralf Baechle
Browse files

MIPS: Calculate proper ebase value for 64-bit kernels



The ebase is relative to CKSEG0 not CAC_BASE.  On a 32-bit kernel they
are the same thing, for a 64-bit kernel they are not.

It happens to kind of work on a 64-bit kernel as they both reference
the same physical memory.  However since the CPU uses the CKSEG0 base,
determining if a J instruction will reach always gives the wrong result
unless we use the same number the CPU uses.

Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1093/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent d8000bee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1599,7 +1599,7 @@ void __init trap_init(void)
		ebase = (unsigned long)
			__alloc_bootmem(size, 1 << fls(size), 0);
	} else {
		ebase = CAC_BASE;
		ebase = CKSEG0;
		if (cpu_has_mips_r2)
			ebase += (read_c0_ebase() & 0x3ffff000);
	}