Lines Matching +full:li +full:-
1 /* SPDX-License-Identifier: GPL-2.0-only */
17 #include <asm/code-patching-asm.h>
24 #include <asm/asm-offsets.h>
25 #include <asm/exception-64s.h>
27 #include <asm/book3s/64/mmu-hash.h>
31 #include <asm/asm-compat.h>
32 #include <asm/feature-fixups.h>
42 #define STACK_SLOT_TRAP (SFS-4)
43 #define STACK_SLOT_TID (SFS-16)
44 #define STACK_SLOT_PSSCR (SFS-24)
45 #define STACK_SLOT_PID (SFS-32)
46 #define STACK_SLOT_IAMR (SFS-40)
47 #define STACK_SLOT_CIABR (SFS-48)
48 #define STACK_SLOT_DAWR0 (SFS-56)
49 #define STACK_SLOT_DAWRX0 (SFS-64)
50 #define STACK_SLOT_HFSCR (SFS-72)
51 #define STACK_SLOT_AMR (SFS-80)
52 #define STACK_SLOT_UAMOR (SFS-88)
53 #define STACK_SLOT_FSCR (SFS-96)
65 * Must be called with interrupts hard-disabled.
69 * LR = return address to continue at after eventually re-enabling MMU
74 stdu r1, -112(r1)
78 li r0,MSR_RI
80 li r6,MSR_IR | MSR_DR
91 /* Back from guest - restore host state and return to caller */
96 li r6,7
118 li r0, 0
139 li r0, MSR_RI
169 li r0, 1
178 li r12, 0
182 li r3, NAPPING_NOVCPU
185 li r3, 0 /* Don't wake on privileged (OS) doorbell */
198 li r0, 0
218 li r0, 1
233 li r12, BOOK3S_INTERRUPT_HV_DECREMENTER
274 stdu r1, -SWITCH_FRAME_SIZE(r4)
286 li r0,0
289 li r0,KVM_HWTHREAD_IN_KVM
299 li r0, 0
330 li r0, 0
343 /* and set per-LPAR registers, if doing dynamic micro-threading */
362 li r0, 0
383 li r3,0 /* NULL argument */
388 * we may not turn on the MMU while hwthread_req is non-zero.
396 li r0, KVM_HWTHREAD_IN_KERNEL
408 li r3, LPCR_PECE0
438 54: li r0, KVM_HWTHREAD_IN_KVM
444 * whole-core mode, so we need to nap.
460 li r3, 0 /* NULL argument */
473 lis r6, (PPC_DBELL_SERVER << (63-36))@h
478 li r0, 1
480 clrldi r4, r4, 61 /* micro-threading => P8 => 8 threads/core */
488 li r3, NAPPING_UNSPLIT
490 li r3, (LPCR_PECEDH | LPCR_PECE0) >> 4
495 57: li r0, 0
515 * Does not preserve non-volatile GPRs or CR fields
519 stdu r1, -SFS(r1)
524 li r6, KVM_GUEST_MODE_HOST_HV
540 * POWER7/POWER8 host -> guest partition switch code.
545 li r7, 1
562 li r0,LPID_RSVD /* switch to reserved LPID */
572 li r5, 0 /* nested vcpu pointer */
615 li r0,1
626 li r6, LPPACA_YIELDCOUNT
630 li r6, 1
665 /* Do this before re-enabling PMU to avoid P7 DABR corruption bug */
678 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
682 li r5, 0 /* don't preserve non-vol regs */
724 /* Load up POWER8-specific registers */
760 /* POWER8-only registers */
797 li r6,0
837 li r6, 0
871 /* r11 = vcpu->arch.msr & ~MSR_HV */
872 rldicl r11, r11, 63 - MSR_HV_LG, 1
889 li r0,0
895 li r9, KVM_GUEST_MODE_GUEST_HV
945 li r12, 0
958 li r12, 0
961 li r12, BOOK3S_INTERRUPT_HV_DECREMENTER
977 * We come here from the first-level interrupt handlers.
993 li r9, KVM_GUEST_MODE_HOST_HV
1055 * This becomes important for relocation-on interrupts from
1058 li r0, MSR_RI
1073 li r3,KVM_INST_FETCH_FAILED
1113 /* Hypervisor doorbell - exit only if host IPI flag set */
1154 li r5, 0
1157 li r6,0
1171 li r0,0
1181 li r3, SLBSHADOW_SAVEAREA
1210 li r0, -1
1219 li r6,1
1248 /* Save POWER8-specific registers */
1282 * Restore various registers to 0, where non-zero values
1285 li r0, 0
1290 li r0, 1
1314 /* Save non-volatile GPRs */
1353 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
1357 li r5, 0 /* don't preserve non-vol regs */
1368 li r4, LPPACA_YIELDCOUNT
1372 li r3, 1
1378 li r4, 1
1399 * POWER7/POWER8 guest -> host partition switch code.
1420 rlwinm r0,r3,32-8,0xff
1434 li r8,LPID_RSVD /* switch to reserved LPID */
1448 li r8, 0
1456 li r0, 0
1491 li r0, 0
1504 li r3, 0
1510 li r0, KVM_GUEST_MODE_NONE
1554 li r12, BOOK3S_INTERRUPT_EXTERNAL
1574 * -1 A guest wakeup IPI (which has now been cleared)
1578 * -2 A PCI passthrough external interrupt was handled
1587 li r12, BOOK3S_INTERRUPT_HV_RM_HARD
1621 li r0, BOOK3S_INTERRUPT_DATA_SEGMENT
1628 li r7, 1 /* data fault */
1633 li r12, BOOK3S_INTERRUPT_H_DATA_STORAGE
1636 cmpdi r3, -1 /* handle in kernel mode */
1638 cmpdi r3, -2 /* MMIO emulation; need instr word */
1644 1: li r0, BOOK3S_INTERRUPT_DATA_STORAGE
1664 2: li r8, KVM_INST_FETCH_FAILED /* In case lwz faults */
1668 li r0, KVM_GUEST_MODE_SKIP
1682 li r0, KVM_GUEST_MODE_HOST_HV
1697 li r0, BOOK3S_INTERRUPT_INST_SEGMENT
1704 li r7, 0 /* instruction fault */
1709 li r12, BOOK3S_INTERRUPT_H_INST_STORAGE
1712 cmpdi r3, -1 /* handle in kernel mode */
1717 1: li r0, BOOK3S_INTERRUPT_INST_STORAGE
1734 * r5 - r8 contain hcall args,
1740 /* sc 1 from userspace - reflect to guest syscall */
1743 cmpldi r3,hcall_real_table_end - hcall_real_table
1745 /* See if this hcall is enabled for in-kernel handling */
1748 sldi r0, r0, 3 /* index into kvm->arch.enabled_hcalls[] */
1751 rlwinm r4, r3, 32-2, 0x3f /* r4 = (r3 / 4) & 0x3f */
1776 li r10, BOOK3S_INTERRUPT_SYSCALL
1783 * before resuming the pass-it-to-qemu path */
1785 li r12,BOOK3S_INTERRUPT_SYSCALL
1792 .long 0 /* 0 - unused */
1793 .long DOTSYM(kvmppc_h_remove) - hcall_real_table
1794 .long DOTSYM(kvmppc_h_enter) - hcall_real_table
1795 .long DOTSYM(kvmppc_h_read) - hcall_real_table
1796 .long DOTSYM(kvmppc_h_clear_mod) - hcall_real_table
1797 .long DOTSYM(kvmppc_h_clear_ref) - hcall_real_table
1798 .long DOTSYM(kvmppc_h_protect) - hcall_real_table
1801 .long 0 /* 0x24 - H_SET_SPRG0 */
1802 .long DOTSYM(kvmppc_h_set_dabr) - hcall_real_table
1803 .long DOTSYM(kvmppc_rm_h_page_init) - hcall_real_table
1818 .long DOTSYM(xics_rm_h_eoi) - hcall_real_table
1819 .long DOTSYM(xics_rm_h_cppr) - hcall_real_table
1820 .long DOTSYM(xics_rm_h_ipi) - hcall_real_table
1821 .long 0 /* 0x70 - H_IPOLL */
1822 .long DOTSYM(xics_rm_h_xirr) - hcall_real_table
1824 .long 0 /* 0x64 - H_EOI */
1825 .long 0 /* 0x68 - H_CPPR */
1826 .long 0 /* 0x6c - H_IPI */
1827 .long 0 /* 0x70 - H_IPOLL */
1828 .long 0 /* 0x74 - H_XIRR */
1856 .long DOTSYM(kvmppc_h_cede) - hcall_real_table
1857 .long DOTSYM(kvmppc_rm_h_confer) - hcall_real_table
1873 .long DOTSYM(kvmppc_h_bulk_remove) - hcall_real_table
1877 .long DOTSYM(kvmppc_h_set_xdabr) - hcall_real_table
1992 .long DOTSYM(xics_rm_h_xirr_x) - hcall_real_table
1994 .long 0 /* 0x2fc - H_XIRR_X*/
1996 .long DOTSYM(kvmppc_rm_h_random) - hcall_real_table
2004 li r0, DABRX_USER | DABRX_KERNEL | DABRX_BTI
2007 6: li r3, H_PARAMETER
2012 li r5, DABRX_USER | DABRX_KERNEL
2026 li r3,0
2034 li r3, H_HARDWARE
2054 4: li r3, 0
2060 li r0,1
2066 li r12,0 /* set trap to 0 to say hcall is handled */
2068 li r0,H_SUCCESS
2080 li r0,1
2091 li r0,NAPPING_CEDE
2100 * switch occurs: SLB entries, PURR, SPURR, AMOR, UAMOR, AMR, SPRG0-3,
2103 /* Save non-volatile GPRs */
2131 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
2135 li r5, 0 /* don't preserve non-vol regs */
2178 li r0,0
2181 li r0,1
2191 li r3, PNV_THREAD_NAP
2197 li r0,1
2202 li r0, 0
2205 li r0, KVM_HWTHREAD_IN_KVM
2218 li r3, 0
2219 li r12, 0
2238 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
2242 li r5, 0 /* don't preserve non-vol regs */
2291 /* clear our bit in vcore->napping_threads */
2294 li r0,1
2301 li r0,0
2313 li r0,0
2317 li r3,H_SUCCESS
2332 li r12, BOOK3S_INTERRUPT_MACHINE_CHECK
2347 li r12, BOOK3S_INTERRUPT_HMI
2355 * -1 if there was a guest wakeup (IPI or msgsnd)
2356 * -2 if we handled a PCI passthrough interrupt (returned by
2368 rlwinm r6, r6, 45-31, 0xf /* extract wake reason field (P8) */
2370 rlwinm r6, r6, 45-31, 0xe /* P7 wake reason field is 3 bits */
2374 li r3, 0
2375 li r12, 0
2386 li r3, 1 /* anything else, return 1 */
2390 3: li r12, BOOK3S_INTERRUPT_H_DOORBELL
2396 lis r6, (PPC_DBELL_SERVER << (63-36))@h
2399 li r3, 1
2403 /* if not, return -1 */
2404 li r3, -1
2408 4: li r12, BOOK3S_INTERRUPT_HMI
2409 li r3, 1
2412 /* external interrupt - create a stack frame so we can call C */
2415 stdu r1, -PPC_MIN_STKFRM(r1)
2418 li r12, BOOK3S_INTERRUPT_EXTERNAL
2428 li r12, BOOK3S_INTERRUPT_HV_RM_HARD
2511 * Save transactional state and TM-related registers.
2514 * r5 is non-zero iff non-volatile register state needs to be maintained.
2532 stdu r1, -TM_FRAME_SIZE(r1)
2536 li r0, 1
2537 rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG
2540 rldicl. r8, r8, 64 - MSR_TS_S_LG, 62 /* Did we actually hrfid? */
2549 * track of fake-suspend state in the guest due to it using rfscv.
2565 /* We have to treclaim here because that's the only way to do S->N */
2566 li r3, TM_CAUSE_KVM_RESCHED
2598 /* PSSCR_FAKE_SUSPEND is a write-only bit, but clear it anyway */
2599 li r0, PSSCR_FAKE_SUSPEND
2616 * Restore transactional state and TM-related registers.
2619 * r5 is non-zero iff non-volatile register state needs to be maintained.
2627 * then we don't actually do a trechkpt -- we either set up
2628 * fake-suspend mode, or emulate a TM rollback.
2636 li r0, 0
2641 li r0, 1
2642 rldimi r5, r0, MSR_TM_LG, 63-MSR_TM_LG
2656 rldicl. r5, r4, 64 - MSR_TS_S_LG, 62
2667 10: stdu r1, -PPC_MIN_STKFRM(r1)
2690 * Switch to the emergency stack, but start half-way down in
2744 * coordinate with them) - but at least we now have register state
2757 rldicl r0, r11, 64 - MSR_TS_S_LG, 62
2762 li r0, 1
2763 1: rldimi r11, r0, MSR_TS_S_LG, 63 - MSR_TS_T_LG
2775 li r3, 1
2900 li r3, -1 /* set all freeze bits */
2906 li r3, 1
2912 li r7, 0
2964 li r3, 0