.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | .text |
---|
2 | 3 | #include <linux/linkage.h> |
---|
3 | 4 | #include <asm/segment.h> |
---|
.. | .. |
---|
7 | 8 | #include <asm/asm-offsets.h> |
---|
8 | 9 | #include <asm/frame.h> |
---|
9 | 10 | |
---|
10 | | -# Copyright 2003 Pavel Machek <pavel@suse.cz>, distribute under GPLv2 |
---|
| 11 | +# Copyright 2003 Pavel Machek <pavel@suse.cz |
---|
11 | 12 | |
---|
12 | 13 | .code64 |
---|
13 | 14 | /* |
---|
14 | 15 | * Hooray, we are in Long 64-bit mode (but still running in low memory) |
---|
15 | 16 | */ |
---|
16 | | -ENTRY(wakeup_long64) |
---|
| 17 | +SYM_FUNC_START(wakeup_long64) |
---|
17 | 18 | movq saved_magic, %rax |
---|
18 | 19 | movq $0x123456789abcdef0, %rdx |
---|
19 | 20 | cmpq %rdx, %rax |
---|
20 | | - jne bogus_64_magic |
---|
| 21 | + je 2f |
---|
21 | 22 | |
---|
| 23 | + /* stop here on a saved_magic mismatch */ |
---|
| 24 | + movq $0xbad6d61676963, %rcx |
---|
| 25 | +1: |
---|
| 26 | + jmp 1b |
---|
| 27 | +2: |
---|
22 | 28 | movw $__KERNEL_DS, %ax |
---|
23 | 29 | movw %ax, %ss |
---|
24 | 30 | movw %ax, %ds |
---|
.. | .. |
---|
34 | 40 | |
---|
35 | 41 | movq saved_rip, %rax |
---|
36 | 42 | jmp *%rax |
---|
37 | | -ENDPROC(wakeup_long64) |
---|
| 43 | +SYM_FUNC_END(wakeup_long64) |
---|
38 | 44 | |
---|
39 | | -bogus_64_magic: |
---|
40 | | - jmp bogus_64_magic |
---|
41 | | - |
---|
42 | | -ENTRY(do_suspend_lowlevel) |
---|
| 45 | +SYM_FUNC_START(do_suspend_lowlevel) |
---|
43 | 46 | FRAME_BEGIN |
---|
44 | 47 | subq $8, %rsp |
---|
45 | 48 | xorl %eax, %eax |
---|
.. | .. |
---|
109 | 112 | movq pt_regs_r14(%rax), %r14 |
---|
110 | 113 | movq pt_regs_r15(%rax), %r15 |
---|
111 | 114 | |
---|
112 | | -#ifdef CONFIG_KASAN |
---|
| 115 | +#if defined(CONFIG_KASAN) && defined(CONFIG_KASAN_STACK) |
---|
113 | 116 | /* |
---|
114 | 117 | * The suspend path may have poisoned some areas deeper in the stack, |
---|
115 | 118 | * which we now need to unpoison. |
---|
.. | .. |
---|
122 | 125 | addq $8, %rsp |
---|
123 | 126 | FRAME_END |
---|
124 | 127 | jmp restore_processor_state |
---|
125 | | -ENDPROC(do_suspend_lowlevel) |
---|
| 128 | +SYM_FUNC_END(do_suspend_lowlevel) |
---|
126 | 129 | |
---|
127 | 130 | .data |
---|
128 | | -ENTRY(saved_rbp) .quad 0 |
---|
129 | | -ENTRY(saved_rsi) .quad 0 |
---|
130 | | -ENTRY(saved_rdi) .quad 0 |
---|
131 | | -ENTRY(saved_rbx) .quad 0 |
---|
| 131 | +saved_rbp: .quad 0 |
---|
| 132 | +saved_rsi: .quad 0 |
---|
| 133 | +saved_rdi: .quad 0 |
---|
| 134 | +saved_rbx: .quad 0 |
---|
132 | 135 | |
---|
133 | | -ENTRY(saved_rip) .quad 0 |
---|
134 | | -ENTRY(saved_rsp) .quad 0 |
---|
| 136 | +saved_rip: .quad 0 |
---|
| 137 | +saved_rsp: .quad 0 |
---|
135 | 138 | |
---|
136 | | -ENTRY(saved_magic) .quad 0 |
---|
| 139 | +SYM_DATA(saved_magic, .quad 0) |
---|