aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S24
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index c38afdb45d7b..bed9a29ee383 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -37,6 +37,7 @@
37#include <asm/firmware.h> 37#include <asm/firmware.h>
38#include <asm/page_64.h> 38#include <asm/page_64.h>
39#include <asm/irqflags.h> 39#include <asm/irqflags.h>
40#include <asm/kvm_book3s_64_asm.h>
40 41
41/* The physical memory is layed out such that the secondary processor 42/* The physical memory is layed out such that the secondary processor
42 * spin code sits at 0x0000...0x00ff. On server, the vectors follow 43 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
@@ -165,6 +166,12 @@ exception_marker:
165#include "exceptions-64s.S" 166#include "exceptions-64s.S"
166#endif 167#endif
167 168
169/* KVM trampoline code needs to be close to the interrupt handlers */
170
171#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
172#include "../kvm/book3s_64_rmhandlers.S"
173#endif
174
168_GLOBAL(generic_secondary_thread_init) 175_GLOBAL(generic_secondary_thread_init)
169 mr r24,r3 176 mr r24,r3
170 177
@@ -212,7 +219,8 @@ generic_secondary_common_init:
212 * physical cpu id in r24, we need to search the pacas to find 219 * physical cpu id in r24, we need to search the pacas to find
213 * which logical id maps to our physical one. 220 * which logical id maps to our physical one.
214 */ 221 */
215 LOAD_REG_ADDR(r13, paca) /* Get base vaddr of paca array */ 222 LOAD_REG_ADDR(r13, paca) /* Load paca pointer */
223 ld r13,0(r13) /* Get base vaddr of paca array */
216 li r5,0 /* logical cpu id */ 224 li r5,0 /* logical cpu id */
2171: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ 2251: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */
218 cmpw r6,r24 /* Compare to our id */ 226 cmpw r6,r24 /* Compare to our id */
@@ -529,7 +537,8 @@ _GLOBAL(pmac_secondary_start)
529 mtmsrd r3 /* RI on */ 537 mtmsrd r3 /* RI on */
530 538
531 /* Set up a paca value for this processor. */ 539 /* Set up a paca value for this processor. */
532 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */ 540 LOAD_REG_ADDR(r4,paca) /* Load paca pointer */
541 ld r4,0(r4) /* Get base vaddr of paca array */
533 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ 542 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
534 add r13,r13,r4 /* for this processor. */ 543 add r13,r13,r4 /* for this processor. */
535 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/ 544 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/
@@ -608,6 +617,17 @@ _GLOBAL(start_secondary_prolog)
608 std r3,0(r1) /* Zero the stack frame pointer */ 617 std r3,0(r1) /* Zero the stack frame pointer */
609 bl .start_secondary 618 bl .start_secondary
610 b . 619 b .
620/*
621 * Reset stack pointer and call start_secondary
622 * to continue with online operation when woken up
623 * from cede in cpu offline.
624 */
625_GLOBAL(start_secondary_resume)
626 ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */
627 li r3,0
628 std r3,0(r1) /* Zero the stack frame pointer */
629 bl .start_secondary
630 b .
611#endif 631#endif
612 632
613/* 633/*