Commit 61e2390e authored by Michael Neuling's avatar Michael Neuling Committed by Benjamin Herrenschmidt

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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent faab4dd2
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
* word. * word.
*/ */
#define LOAD_HANDLER(reg, label) \ #define LOAD_HANDLER(reg, label) \
addi reg,reg,(label)-_stext; /* virt addr of handler ... */ /* Handlers must be within 64K of kbase, which must be 64k aligned */ \
ori reg,reg,(label)-_stext; /* virt addr of handler ... */
/* Exception register prefixes */ /* Exception register prefixes */
#define EXC_HV H #define EXC_HV H
......
...@@ -585,8 +585,8 @@ __end_interrupts: ...@@ -585,8 +585,8 @@ __end_interrupts:
* Code from here down to __end_handlers is invoked from the * Code from here down to __end_handlers is invoked from the
* exception prologs above. Because the prologs assemble the * exception prologs above. Because the prologs assemble the
* addresses of these handlers using the LOAD_HANDLER macro, * addresses of these handlers using the LOAD_HANDLER macro,
* which uses an addi instruction, these handlers must be in * which uses an ori instruction, these handlers must be in
* the first 32k of the kernel image. * the first 64k of the kernel image.
*/ */
/*** Common interrupt handlers ***/ /*** Common interrupt handlers ***/
......
...@@ -601,6 +601,11 @@ void __init setup_arch(char **cmdline_p) ...@@ -601,6 +601,11 @@ void __init setup_arch(char **cmdline_p)
kvm_linear_init(); kvm_linear_init();
/* Interrupt code needs to be 64K-aligned */
if ((unsigned long)_stext & 0xffff)
panic("Kernelbase not 64K-aligned (0x%lx)!\n",
(unsigned long)_stext);
ppc64_boot_msg(0x15, "Setup Done"); ppc64_boot_msg(0x15, "Setup Done");
} }
......
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