x86/hvm: Drop get_shadow_gs_base() hook and use hvm_get_reg()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 21 Jan 2022 03:47:05 +0000 (03:47 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 17:54:30 +0000 (17:54 +0000)
commitfe60fab0424b93c6688d285bd7995226a96937d4
tree37297a6327ee0ca9de24b7afe6de8c8ef734c1c7
parentf04231775c179b3424fca45d64f29e226a41a610
x86/hvm: Drop get_shadow_gs_base() hook and use hvm_get_reg()

This is a trivial accessor for an MSR, so use hvm_get_reg() rather than a
dedicated hook.  In arch_get_info_guest(), rework the logic to read GS_SHADOW
only once.

get_hvm_registers() is called on current, meaning that diagnostics print a
stale GS_SHADOW from the previous vcpu context switch.  Adjust both
implementations to obtain the correct value.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/include/asm/hvm/hvm.h
xen/arch/x86/x86_64/traps.c