Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Add paravirt idle loop for 64-bit Book-E

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

authored by

Stuart Yoder and committed by
Kumar Gala
f070986a 19c29f17

+32 -2
+2
arch/powerpc/kernel/epapr_hcalls.S
··· 17 17 #include <asm/asm-compat.h> 18 18 #include <asm/asm-offsets.h> 19 19 20 + #ifndef CONFIG_PPC64 20 21 /* epapr_ev_idle() was derived from e500_idle() */ 21 22 _GLOBAL(epapr_ev_idle) 22 23 CURRENT_THREAD_INFO(r3, r1) ··· 43 42 * _TLF_NAPPING. 44 43 */ 45 44 b idle_loop 45 + #endif 46 46 47 47 /* Hypercall entry point. Will be patched with device tree instructions. */ 48 48 .global epapr_hypercall_start
+30 -2
arch/powerpc/kernel/idle_book3e.S
··· 16 16 #include <asm/ppc-opcode.h> 17 17 #include <asm/processor.h> 18 18 #include <asm/thread_info.h> 19 + #include <asm/epapr_hcalls.h> 19 20 20 21 /* 64-bit version only for now */ 21 22 #ifdef CONFIG_PPC64 22 23 23 - _GLOBAL(book3e_idle) 24 + .macro BOOK3E_IDLE name loop 25 + _GLOBAL(\name) 24 26 /* Save LR for later */ 25 27 mflr r0 26 28 std r0,16(r1) ··· 69 67 70 68 /* We can now re-enable hard interrupts and go to sleep */ 71 69 wrteei 1 72 - 1: PPC_WAIT(0) 70 + \loop 71 + 72 + .endm 73 + 74 + .macro BOOK3E_IDLE_LOOP 75 + 1: 76 + PPC_WAIT(0) 73 77 b 1b 78 + .endm 79 + 80 + /* epapr_ev_idle_start below is patched with the proper hcall 81 + opcodes during kernel initialization */ 82 + .macro EPAPR_EV_IDLE_LOOP 83 + idle_loop: 84 + LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE)) 85 + 86 + .global epapr_ev_idle_start 87 + epapr_ev_idle_start: 88 + li r3, -1 89 + nop 90 + nop 91 + nop 92 + b idle_loop 93 + .endm 94 + 95 + BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP 96 + 97 + BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP 74 98 75 99 #endif /* CONFIG_PPC64 */