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 _swsusp_reset_dma(void)
102 ENTRY(_swsusp_reset_dma)
103 larl %r1,restart_entry
104 larl %r2,.Lrestart_diag308_psw
111 sigp %r1,%r0,SIGP_SET_ARCHITECTURE
114 ENDPROC(_swsusp_reset_dma)
117 * void _diag308_reset_dma(void)
119 * Calls diag 308 subcode 1 and continues execution
121 ENTRY(_diag308_reset_dma)
122 larl %r4,.Lctlregs # Save control registers
123 stctg %c0,%c15,0(%r4)
124 lg %r2,0(%r4) # Disable lowcore protection
129 larl %r4,.Lfpctl # Floating point control register
131 larl %r4,.Lprefix # Save prefix register
133 larl %r4,.Lprefix_zero # Set prefix register to 0
135 larl %r4,.Lcontinue_psw # Save PSW flags
138 larl %r4,restart_part2 # Setup restart PSW at absolute 0
139 larl %r3,.Lrestart_diag308_psw
140 og %r4,0(%r3) # Save PSW
142 sturg %r4,%r3 # Use sturg, because of large pages
147 lhi %r0,0 # Load r0 with zero
148 lhi %r1,2 # Use mode 2 = ESAME (dump)
149 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
150 sam64 # Switch to 64 bit addressing mode
151 larl %r4,.Lctlregs # Restore control registers
152 lctlg %c0,%c15,0(%r4)
153 larl %r4,.Lfpctl # Restore floating point ctl register
155 larl %r4,.Lprefix # Restore prefix register
157 larl %r4,.Lcontinue_psw # Restore PSW flags
161 ENDPROC(_diag308_reset_dma)
163 .section .dma.data,"aw",@progbits
165 .Lrestart_diag308_psw:
166 .long 0x00080000,0x80000000