summaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-07-29 19:47:50 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-08-04 23:36:58 +0200
commit1d36430ead5d10508a3e1136cd1258ba534c3243 (patch)
treef06b155b861387acdf351c63e4e92e7e75c7422e /x86_64
parente2e78b6c461543e1d057a63eaa3d43d71ba0f3f8 (diff)
x86_64: disable V86 mode on full 64-bit configuration
* i386/i386/pcb.c: simplify exception stack location and adapt thread gettrs/setters * i386/i386/thread.h: don't include V86 fields on full 64-bit * x86_64/locore.S: don't include checks for V86 mode on full 64-bit Message-Id: <20230729174753.1145878-2-luca@orpolo.org>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/locore.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/x86_64/locore.S b/x86_64/locore.S
index ac7138b7..413d43c4 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -383,8 +383,10 @@ ENTRY(t_segnp)
/* indicate fault type */
trap_check_kernel_exit:
+#ifdef USER32
testq $(EFL_VM),32(%rsp) /* is trap from V86 mode? */
jnz EXT(alltraps) /* isn`t kernel trap if so */
+#endif
/* Note: handling KERNEL_RING value by hand */
testq $2,24(%rsp) /* is trap from kernel mode? */
jnz EXT(alltraps) /* if so: */
@@ -477,8 +479,10 @@ push_segregs:
*/
ENTRY(t_debug)
INT_FIX
+#ifdef USER32
testq $(EFL_VM),16(%rsp) /* is trap from V86 mode? */
jnz 0f /* isn`t kernel trap if so */
+#endif
/* Note: handling KERNEL_RING value by hand */
testq $2,8(%rsp) /* is trap from kernel mode? */
jnz 0f /* if so: */
@@ -544,8 +548,10 @@ trap_push_segs:
#endif
trap_set_segs:
cld /* clear direction flag */
+#ifdef USER32
testl $(EFL_VM),R_EFLAGS(%rsp) /* in V86 mode? */
jnz trap_from_user /* user mode trap if so */
+#endif
/* Note: handling KERNEL_RING value by hand */
testb $2,R_CS(%rsp) /* user mode trap? */
jz trap_from_kernel /* kernel trap if not */
@@ -799,8 +805,10 @@ LEXT(return_to_iret) /* ( label for kdb_kintr and hardclock) */
popq %rsp /* switch back to old stack */
+#ifdef USER32
testl $(EFL_VM),I_EFL(%rsp) /* if in V86 */
jnz 0f /* or */
+#endif
/* Note: handling KERNEL_RING value by hand */
testb $2,I_CS(%rsp) /* user mode, */
jz 1f /* check for ASTs */