aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2012-11-05 01:10:35 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 23:08:03 -0500
commit61e2390ede3cea186cc01f5f3d0c9eb570c42c40 (patch)
tree503eea0cd552d61e29505bc3442a0d630ba6184f /arch
parentfaab4dd2d281d42cb46b16e36f769be59c0a7338 (diff)
powerpc: Make load_hander handle upto 64k offset
If we change load_hander() to use an ori instead of addi, we can load handlers upto 64k away provided we are still 64k aligned. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/exception-64s.h3
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S4
-rw-r--r--arch/powerpc/kernel/setup_64.c5
3 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index a43c1473915f..9258daac4964 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -55,7 +55,8 @@
55 * word. 55 * word.
56 */ 56 */
57#define LOAD_HANDLER(reg, label) \ 57#define LOAD_HANDLER(reg, label) \
58 addi reg,reg,(label)-_stext; /* virt addr of handler ... */ 58 /* Handlers must be within 64K of kbase, which must be 64k aligned */ \
59 ori reg,reg,(label)-_stext; /* virt addr of handler ... */
59 60
60/* Exception register prefixes */ 61/* Exception register prefixes */
61#define EXC_HV H 62#define EXC_HV H
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index de029640ba26..0969b7ff0f87 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -585,8 +585,8 @@ __end_interrupts:
585 * Code from here down to __end_handlers is invoked from the 585 * Code from here down to __end_handlers is invoked from the
586 * exception prologs above. Because the prologs assemble the 586 * exception prologs above. Because the prologs assemble the
587 * addresses of these handlers using the LOAD_HANDLER macro, 587 * addresses of these handlers using the LOAD_HANDLER macro,
588 * which uses an addi instruction, these handlers must be in 588 * which uses an ori instruction, these handlers must be in
589 * the first 32k of the kernel image. 589 * the first 64k of the kernel image.
590 */ 590 */
591 591
592/*** Common interrupt handlers ***/ 592/*** Common interrupt handlers ***/
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index efb6a41b3131..6da881b35dac 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -601,6 +601,11 @@ void __init setup_arch(char **cmdline_p)
601 601
602 kvm_linear_init(); 602 kvm_linear_init();
603 603
604 /* Interrupt code needs to be 64K-aligned */
605 if ((unsigned long)_stext & 0xffff)
606 panic("Kernelbase not 64K-aligned (0x%lx)!\n",
607 (unsigned long)_stext);
608
604 ppc64_boot_msg(0x15, "Setup Done"); 609 ppc64_boot_msg(0x15, "Setup Done");
605} 610}
606 611