diff options
author | Luca Dariz <luca@orpolo.org> | 2023-07-29 19:47:52 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-04 23:41:35 +0200 |
commit | 55c6c03da81908fdf7de113e1b3c6efa758e82e7 (patch) | |
tree | 43035e2383974cbc36bf2f887f80db070d184a46 /kern/debug.c | |
parent | 0440b2aee5586daa986dc9322f4484266d09fb64 (diff) | |
download | gnumach-55c6c03da81908fdf7de113e1b3c6efa758e82e7.tar.gz gnumach-55c6c03da81908fdf7de113e1b3c6efa758e82e7.tar.bz2 gnumach-55c6c03da81908fdf7de113e1b3c6efa758e82e7.zip |
x86_64: refactor segment register handling
The actual values are not saved together with the rest of the thread
state, both because it would be quite espensive (reading MSR, unless
rdfsbase instructions are supported, but that's optional) and not
really needed. The only way the user has to change its value is with a
specific RPC, so we can intercept the change easily. Furthermore,
Leaving the values there exposes them to being corrupted in case of a
double interruption, e.g. an irq is handled just before iretq but
after starting to restore the thread state. This solution was
suggested by Sergey Bugaev.
* i386/i386/db_trace.c: remove fsbase/gsbase from the registers
available
* i386/i386/debug_i386.c: remove fsbase/gsbase from the printed thread
state
* i386/i386/i386asm.sym: remove fsbase/gsbase as it's not needed in
asm anymore
* i386/i386/pcb.c: point fsbase/gsbase to the new location
* i386/i386/thread.h: move fsbase/gsbase to the machine state
* x86_64/locore.S: generalize segment-handling including es/ds/gs/fs
and remove fsbase/gsbase handling. Also, factor out kernel segment
selector setting to a macro.
Message-Id: <20230729174753.1145878-4-luca@orpolo.org>
Diffstat (limited to 'kern/debug.c')
0 files changed, 0 insertions, 0 deletions