79f0056002
* The vm86 code or the code running in virtual 8086 mode may clobber the %fs register that we use for the CPU dependent thread local storage (TLS). Previously the vm86 code would simply restore %fs on exit, but this doesn't always work. If the thread got unscheduled while running in virtual 8086 mode and was then rescheduled on a different CPU, the vm86 exit code would restore the %fs register with the TLS value of the old CPU, causing anything using TLS in userland to crash later on. Instead we skip the %fs register restore on exit (as do the other interrupt return functions) and explicitly update the potentially clobbered %fs by calling x86_set_tls_context(). This will repopulate the %fs register with the TLS value for the right CPU. Fixes #8068. * Made the static set_tls_context() into x86_set_tls_context() and made it available to others to faciliate the above. * Sync the vm86 specific interrupt code with the changes from hrev23370, using the iframe pop macro to properly return. Previously what was pushed in int_bottom wasn't poped on return. * Account for the time update macro resetting the in_kernel flag and reset it to 1, as we aren't actually returning to userland. This didn't cause any harm though as only the time tracking is using that flag so far. * Some minor cleanup. |
||
---|---|---|
.. | ||
alpha | ||
arm | ||
m68k | ||
mipsel | ||
ppc | ||
sh4 | ||
sparc | ||
x86 | ||
cpu.h | ||
debug_console.h | ||
debug.h | ||
elf.h | ||
int.h | ||
platform.h | ||
real_time_clock.h | ||
smp.h | ||
system_info.h | ||
thread_types.h | ||
thread.h | ||
timer.h | ||
user_debugger.h | ||
vm_translation_map.h | ||
vm_types.h | ||
vm.h |