x86: improve MSR_SHADOW_GS accesses
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Mar 2018 16:29:45 +0000 (17:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Mar 2018 16:29:45 +0000 (17:29 +0100)
commitb78a43d60af39a8a3d59ddc2e33d5aa290f5a7f9
treefecf86e25022aeb7a74488398d5c7fc20450a799
parent044fedfaa29b5d5774196e3fc7d955a48bfceac4
x86: improve MSR_SHADOW_GS accesses

Instead of using RDMSR/WRMSR, on fsgsbase-capable systems use a double
SWAPGS combined with RDGSBASE/WRGSBASE. This halves execution time for
a shadow GS update alone on my Haswell (and we have indications of
good performance improvements by this on Skylake too), while the win is
even higher when e.g. updating more than one base (as may and commonly
will happen in load_segments()).

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