entry_32.S (9f4813b531a0b8cc502fcfb142937fe4e9104d77) entry_32.S (81ff2c37f9e5d77593928df0536d86443195fd64)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 1991,1992 Linus Torvalds
4 *
5 * entry_32.S contains the system-call and low-level fault and trap handling routines.
6 *
7 * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.

--- 158 unchanged lines hidden (view full) ---

167.Lend_\@:
168.endm
169
170.macro BUG_IF_WRONG_CR3 no_user_check=0
171#ifdef CONFIG_DEBUG_ENTRY
172 ALTERNATIVE "jmp .Lend_\@", "", X86_FEATURE_PTI
173 .if \no_user_check == 0
174 /* coming from usermode? */
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 1991,1992 Linus Torvalds
4 *
5 * entry_32.S contains the system-call and low-level fault and trap handling routines.
6 *
7 * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.

--- 158 unchanged lines hidden (view full) ---

167.Lend_\@:
168.endm
169
170.macro BUG_IF_WRONG_CR3 no_user_check=0
171#ifdef CONFIG_DEBUG_ENTRY
172 ALTERNATIVE "jmp .Lend_\@", "", X86_FEATURE_PTI
173 .if \no_user_check == 0
174 /* coming from usermode? */
175 testl $SEGMENT_RPL_MASK, PT_CS(%esp)
175 testl $USER_SEGMENT_RPL_MASK, PT_CS(%esp)
176 jz .Lend_\@
177 .endif
178 /* On user-cr3? */
179 movl %cr3, %eax
180 testl $PTI_SWITCH_MASK, %eax
181 jnz .Lend_\@
182 /* From userspace with kernel cr3 - BUG */
183 ud2

--- 28 unchanged lines hidden (view full) ---

212 * Clear them in case hardware didn't do this for us.
213 */
214 andl $0x0000ffff, 3*4(%esp)
215
216#ifdef CONFIG_VM86
217 testl $X86_EFLAGS_VM, 4*4(%esp)
218 jnz .Lfrom_usermode_no_fixup_\@
219#endif
176 jz .Lend_\@
177 .endif
178 /* On user-cr3? */
179 movl %cr3, %eax
180 testl $PTI_SWITCH_MASK, %eax
181 jnz .Lend_\@
182 /* From userspace with kernel cr3 - BUG */
183 ud2

--- 28 unchanged lines hidden (view full) ---

212 * Clear them in case hardware didn't do this for us.
213 */
214 andl $0x0000ffff, 3*4(%esp)
215
216#ifdef CONFIG_VM86
217 testl $X86_EFLAGS_VM, 4*4(%esp)
218 jnz .Lfrom_usermode_no_fixup_\@
219#endif
220 testl $SEGMENT_RPL_MASK, 3*4(%esp)
220 testl $USER_SEGMENT_RPL_MASK, 3*4(%esp)
221 jnz .Lfrom_usermode_no_fixup_\@
222
223 orl $CS_FROM_KERNEL, 3*4(%esp)
224
225 /*
226 * When we're here from kernel mode; the (exception) stack looks like:
227 *
228 * 5*4(%esp) - <previous context>

--- 1388 unchanged lines hidden ---
221 jnz .Lfrom_usermode_no_fixup_\@
222
223 orl $CS_FROM_KERNEL, 3*4(%esp)
224
225 /*
226 * When we're here from kernel mode; the (exception) stack looks like:
227 *
228 * 5*4(%esp) - <previous context>

--- 1388 unchanged lines hidden ---