Module Name: src Committed By: maxv Date: Thu Oct 19 19:05:53 UTC 2017
Modified Files: src/sys/arch/amd64/amd64: locore.S machdep.c src/sys/arch/x86/x86: sys_machdep.c Log Message: Improve our segregs model. Pass 2/3. Treat %fs the same way we treat %ds and %es. For a new 32bit LWP %fs is set to GUDATA32_SEL, and always updated in INTRFASTEXIT. This solves an important issue we had until now: we couldn't handle the faults generated by the "movw $val,%fs" instructions, because they were deep into the kernel context. Now %fs can fault only in INTRFASTEXIT, which is safe. Note that it also fixes a bug I believe affected the kernel: on AMD CPUs, setting %fs to zero does not flush the internal register state, and therefore we could leak the %fs base address when context-switching. This being said, I couldn't trigger the issue on the AMD cpu I have. Whatever, it's fixed now, since we first set %fs to GUDATA32 - which does flush the register state. To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.135 src/sys/arch/amd64/amd64/locore.S cvs rdiff -u -r1.270 -r1.271 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/x86/sys_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.