]> xenbits.xensource.com Git - xen.git/commit
x86: fix FS/GS base handling when using the fsgsbase feature
authorJan Beulich <jbeulich@suse.com>
Thu, 6 Feb 2014 11:19:06 +0000 (12:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Feb 2014 11:19:06 +0000 (12:19 +0100)
commitc42494acb2f7f31e561d38f06c59a50ee4198f36
tree83d3e710dc27f683b9c242049075d0ea120b70e2
parentff1745d5882b7356ea423709919e46e55c31b615
x86: fix FS/GS base handling when using the fsgsbase feature

In that case, due to the respective instructions not being privileged,
we can't rely on our in-memory data to always be correct: While the
guest is running, it may change without us knowing about it. Therefore
we need to
- read the correct values from hardware during context switch out
  (save_segments())
- read the correct values from hardware during RDMSR emulation
- update in-memory values during guest mode change
  (toggle_guest_mode())

For completeness/consistency, WRMSR emulation is also being switched
to use wr[fg]sbase().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/traps.c
xen/arch/x86/x86_64/traps.c
xen/include/asm-x86/msr.h