1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Code that needs to run below 2 GB.
5 * Copyright IBM Corp. 2019
8 #include <linux/linkage.h>
12 #ifdef CC_USING_EXPOLINE
13 .pushsection .dma.text.__s390_indirect_jump_r14,"axG"
14 __dma__s390_indirect_jump_r14:
22 .section .dma.text,"ax"
24 * Simplified version of expoline thunk. The normal thunks can not be used here,
25 * because they might be more than 2 GB away, and not reachable by the relative
26 * branch. No comdat, exrl, etc. optimizations used here, because it only
27 * affects a few functions that are not performance-relevant.
30 #ifdef CC_USING_EXPOLINE
31 jg __dma__s390_indirect_jump_r14
38 * int _diag14_dma(unsigned long rx, unsigned long ry1, unsigned long subcode)
54 EX_TABLE_DMA(.Ldiag14_ex, .Ldiag14_fault)
58 * int _diag210_dma(struct diag210 *addr)
72 EX_TABLE_DMA(.Ldiag210_ex, .Ldiag210_fault)
76 * int _diag26c_dma(void *req, void *resp, enum diag26c_sc subcode)
86 EX_TABLE_DMA(.Ldiag26c_ex, .Ldiag26c_ex)
90 * void _diag0c_dma(struct hypfs_diag0c_entry *entry)
100 * void _diag308_reset_dma(void)
102 * Calls diag 308 subcode 1 and continues execution
104 ENTRY(_diag308_reset_dma)
105 larl %r4,.Lctlregs # Save control registers
106 stctg %c0,%c15,0(%r4)
107 lg %r2,0(%r4) # Disable lowcore protection
112 larl %r4,.Lfpctl # Floating point control register
114 larl %r4,.Lprefix # Save prefix register
116 larl %r4,.Lprefix_zero # Set prefix register to 0
118 larl %r4,.Lcontinue_psw # Save PSW flags
121 larl %r4,restart_part2 # Setup restart PSW at absolute 0
122 larl %r3,.Lrestart_diag308_psw
123 og %r4,0(%r3) # Save PSW
125 sturg %r4,%r3 # Use sturg, because of large pages
130 lhi %r0,0 # Load r0 with zero
131 lhi %r1,2 # Use mode 2 = ESAME (dump)
132 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
133 sam64 # Switch to 64 bit addressing mode
134 larl %r4,.Lctlregs # Restore control registers
135 lctlg %c0,%c15,0(%r4)
136 larl %r4,.Lfpctl # Restore floating point ctl register
138 larl %r4,.Lprefix # Restore prefix register
140 larl %r4,.Lcontinue_psw # Restore PSW flags
144 ENDPROC(_diag308_reset_dma)
146 .section .dma.data,"aw",@progbits
148 .Lrestart_diag308_psw:
149 .long 0x00080000,0x80000000