Lines Matching +full:bl +full:- +full:code +full:- +full:offset

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)
89 bl kvmppc_hv_entry
91 /* Back from guest - restore host state and return to caller */
106 bl kvmhv_load_host_pmu
126 * the book3s_hv_interrupts.S code. For other interrupts
128 * code here.
202 bl kvmppc_check_wake_reason
244 bl kvmhv_start_timing
254 bl kvmhv_accumulate_time
258 bl kvmhv_commence_exit
263 * We come in here when wakened from Linux offline idle code.
274 stdu r1, -SWITCH_FRAME_SIZE(r4)
282 * code expects it to be in SRR1.
312 bl kvmppc_check_wake_reason
343 /* and set per-LPAR registers, if doing dynamic micro-threading */
358 bl kvmppc_hv_entry
365 * Once we clear HSTATE_KVM_VCORE(r13), the code in
384 bl CFUNC(hmi_exception_realmode)
388 * we may not turn on the MMU while hwthread_req is non-zero.
444 * whole-core mode, so we need to nap.
461 bl CFUNC(hmi_exception_realmode)
473 lis r6, (PPC_DBELL_SERVER << (63-36))@h
480 clrldi r4, r4, 61 /* micro-threading => P8 => 8 threads/core */
501 * Entry code *
515 * Does not preserve non-volatile GPRs or CR fields
519 stdu r1, -SFS(r1)
532 bl kvmhv_start_timing
540 * POWER7/POWER8 host -> guest partition switch code.
573 bl kvmppc_check_need_tlb_flush
577 /* Add timebase offset onto timebase */
611 bl kvmppc_subcore_enter_guest
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 */
683 bl kvmppc_restore_tm_hv
691 bl kvmhv_load_guest_pmu
695 bl kvmppc_load_fp
724 /* Load up POWER8-specific registers */
760 /* POWER8-only registers */
861 bl CFUNC(kvmppc_guest_entry_inject_int)
871 /* r11 = vcpu->arch.msr & ~MSR_HV */
872 rldicl r11, r11, 63 - MSR_HV_LG, 1
901 bl kvmhv_accumulate_time
952 bl kvmhv_accumulate_time
966 bl kvmhv_accumulate_time
972 * Exit code *
977 * We come here from the first-level interrupt handlers.
1055 * This becomes important for relocation-on interrupts from
1064 bl kvmhv_accumulate_time
1113 /* Hypervisor doorbell - exit only if host IPI flag set */
1143 bl kvmhv_accumulate_time
1205 bl kvmhv_commence_exit
1210 li r0, -1
1248 /* Save POWER8-specific registers */
1282 * Restore various registers to 0, where non-zero values
1314 /* Save non-volatile GPRs */
1346 bl kvmppc_save_fp
1353 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
1357 li r5, 0 /* don't preserve non-vol regs */
1358 bl kvmppc_save_tm_hv
1381 21: bl kvmhv_save_guest_pmu
1399 * POWER7/POWER8 guest -> host partition switch code.
1420 rlwinm r0,r3,32-8,0xff
1452 /* Subtract timebase offset from timebase */
1478 bl kvmppc_subcore_exit_guest
1506 bl kvmhv_accumulate_time
1528 bl .+4
1535 bl .+4
1547 bl CFUNC(kvmppc_read_intr)
1574 * -1 A guest wakeup IPI (which has now been cleared)
1578 * -2 A PCI passthrough external interrupt was handled
1586 /* Return code = 2 */
1591 1: /* Return code <= 1 */
1595 /* Return code <= 0 */
1629 bl CFUNC(kvmppc_hpte_hv_fault)
1636 cmpdi r3, -1 /* handle in kernel mode */
1638 cmpdi r3, -2 /* MMIO emulation; need instr word */
1650 bl kvmppc_msr_interrupt
1705 bl CFUNC(kvmppc_hpte_hv_fault)
1712 cmpdi r3, -1 /* handle in kernel mode */
1721 bl kvmppc_msr_interrupt
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 */
1777 bl kvmppc_msr_interrupt
1783 * before resuming the pass-it-to-qemu path */
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
2100 * switch occurs: SLB entries, PURR, SPURR, AMOR, UAMOR, AMR, SPRG0-3,
2103 /* Save non-volatile GPRs */
2124 bl kvmppc_save_fp
2131 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
2135 li r5, 0 /* don't preserve non-vol regs */
2136 bl kvmppc_save_tm_hv
2163 bl kvmhv_accumulate_time
2195 bl isa206_idle_insn_mayloss
2230 bl kvmhv_accumulate_time
2238 * NOTE THAT THIS TRASHES ALL NON-VOLATILE REGISTERS (but not CR)
2242 li r5, 0 /* don't preserve non-vol regs */
2243 bl kvmppc_restore_tm_hv
2250 bl kvmppc_load_fp
2279 bl kvmppc_check_wake_reason
2291 /* clear our bit in vcore->napping_threads */
2328 bl kvmppc_realmode_machine_check
2336 * Call C code to handle a HMI in real mode.
2345 bl CFUNC(kvmppc_realmode_hmi_handler)
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 */
2396 lis r6, (PPC_DBELL_SERVER << (63-36))@h
2403 /* if not, return -1 */
2404 li r3, -1
2412 /* external interrupt - create a stack frame so we can call C */
2415 stdu r1, -PPC_MIN_STKFRM(r1)
2416 bl CFUNC(kvmppc_read_intr)
2423 * Return code of 2 means PCI passthrough interrupt, but
2426 * exit code.
2459 bl store_fp_state
2463 bl store_vr_state
2495 bl load_fp_state
2499 bl load_vr_state
2511 * Save transactional state and TM-related registers.
2514 * r5 is non-zero iff non-volatile register state needs to be maintained.
2529 /* The following code handles the fake_suspend = 1 case */
2532 stdu r1, -TM_FRAME_SIZE(r1)
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? */
2543 bl pnv_power9_force_smt4_catch
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 */
2592 bl pnv_power9_force_smt4_release
2598 /* PSSCR_FAKE_SUSPEND is a write-only bit, but clear it anyway */
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.
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)
2669 bl kvmhv_emulate_tm_rollback
2679 * executing host real mode code while in guest MMU context.
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
2763 1: rldimi r11, r0, MSR_TS_S_LG, 63 - MSR_TS_T_LG
2900 li r3, -1 /* set all freeze bits */
2984 subf r5, r6, r5 /* subtract current timebase offset */
3000 subf r7, r8, r7 /* subtract current timebase offset */