From aaa33bd1ef300380279d9e2875b61a7abaf2c88d Mon Sep 17 00:00:00 2001 From: Luca Dariz Date: Sat, 29 Jul 2023 19:47:53 +0200 Subject: x86_64: remove unneeded segment selectors handling on full 64 bit * i386/i386/db_interface.c: don't set unused segment selectors on full 64-bit * i386/i386/db_trace.c: likewise. * i386/i386/i386asm.sym: likewise. * i386/i386/pcb.c:: likewise. * i386/i386/thread.h: remove ES/DS/FS/GS from thread state on !USER32, as they are unused in this configuration. Only SS and CS are kept. * x86_64/locore.S: convert segment handling macros to no-op on full 64-bit Message-Id: <20230729174753.1145878-5-luca@orpolo.org> --- x86_64/locore.S | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'x86_64') diff --git a/x86_64/locore.S b/x86_64/locore.S index 66a9436a..271a9071 100644 --- a/x86_64/locore.S +++ b/x86_64/locore.S @@ -94,8 +94,7 @@ pushq %fs ;\ pushq %gs #else -#define PUSH_SEGMENTS(reg) \ - subq $32,%rsp +#define PUSH_SEGMENTS(reg) #endif #ifdef USER32 @@ -107,8 +106,7 @@ popq reg ;\ movq reg,%ds #else -#define POP_SEGMENTS(reg) \ - addq $32,%rsp +#define POP_SEGMENTS(reg) #endif #ifdef USER32 @@ -120,8 +118,7 @@ pushq %fs ;\ pushq %gs #else -#define PUSH_SEGMENTS_ISR(reg) \ - subq $32,%rsp +#define PUSH_SEGMENTS_ISR(reg) #endif #ifdef USER32 @@ -133,8 +130,7 @@ popq reg ;\ movq reg,%ds #else -#define POP_SEGMENTS_ISR(reg) \ - addq $32,%rsp +#define POP_SEGMENTS_ISR(reg) #endif #ifdef USER32 @@ -639,9 +635,7 @@ _return_to_user: */ _return_from_kernel: -#ifndef USER32 - addq $32,%rsp /* skip FS/GS selector */ -#else +#ifdef USER32 _kret_popl_gs: popq %gs /* restore segment registers */ _kret_popl_fs: -- cgit v1.2.3