Commit a13c9962 authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle

MIPS: traps: tidy up ebase calculation

Rather than #ifdef on CONFIG_KVM_GUEST & redefine the guest kseg0 base
locally, make use of the CAC_BASE macro which has the correct value in
both cases.
Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-kernel@vger.kernel.org
Cc: Markos Chandras <markos.chandras@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11183/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent ee42a334
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/branch.h> #include <asm/branch.h>
#include <asm/break.h> #include <asm/break.h>
...@@ -2204,12 +2205,8 @@ void __init trap_init(void) ...@@ -2204,12 +2205,8 @@ void __init trap_init(void)
ebase = (unsigned long) ebase = (unsigned long)
__alloc_bootmem(size, 1 << fls(size), 0); __alloc_bootmem(size, 1 << fls(size), 0);
} else { } else {
#ifdef CONFIG_KVM_GUEST ebase = CAC_BASE;
#define KVM_GUEST_KSEG0 0x40000000
ebase = KVM_GUEST_KSEG0;
#else
ebase = CKSEG0;
#endif
if (cpu_has_mips_r2_r6) if (cpu_has_mips_r2_r6)
ebase += (read_c0_ebase() & 0x3ffff000); ebase += (read_c0_ebase() & 0x3ffff000);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment