x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE.
PATCH 1/1 x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE.
Intercepting this MSR is pointless - The swapgs instruction does not cause a vmexit, so the cached result of this is potentially stale after the next guest instruction. It is correctly saved and restored on vcpu context switch.
Furthermore, 64bit Windows writes to this MSR on every thread context switch, so interception causes a substantial performance hit.
From: Paul Durrant <[email protected]>
--- xen/arch/x86/hvm/vmx/vmcs.c | 1 + 1 file changed, 1 insertion(+)
xen/arch/x86/hvm/vmx/vmcs.c +1 -0
@@ -950,6 +950,7 @@ static int construct_vmcs(struct vcpu *v)vmx_disable_intercept_for_msr (v,MSR_FS_BASE ,MSR_TYPE_R |MSR_TYPE_W );vmx_disable_intercept_for_msr (v,MSR_GS_BASE ,MSR_TYPE_R |MSR_TYPE_W ); +vmx_disable_intercept_for_msr (v,MSR_SHADOW_GS_BASE ,MSR_TYPE_R |MSR_TYPE_W );vmx_disable_intercept_for_msr (v,MSR_IA32_SYSENTER_CS ,MSR_TYPE_R |MSR_TYPE_W );vmx_disable_intercept_for_msr (v,MSR_IA32_SYSENTER_ESP ,MSR_TYPE_R |MSR_TYPE_W );vmx_disable_intercept_for_msr (v,MSR_IA32_SYSENTER_EIP ,MSR_TYPE_R |MSR_TYPE_W );
Signature · 1 line
1.7.10.4
Quoted 10 lines · Andrew Cooper
Intercepting this MSR is pointless - The swapgs instruction does not cause a vmexit, so the cached result of this is potentially stale after the next guest instruction. It is correctly saved and restored on vcpu context switch.
Furthermore, 64bit Windows writes to this MSR on every thread context switch, so interception causes a substantial performance hit.
From: Paul Durrant <[email protected]>
Signed-off-by Paul Durrant <[email protected]>Signed-off-by Andrew Cooper <[email protected]>
Nakajima, Jun
Acked-byQuoted 8 lines · Tim Deegan
Quoted 1 line · Andrew Cooper
Intercepting this MSR is pointless - The swapgs instruction does not
cause a
Quoted 1 line
vmexit, so the cached result of this is potentially stale after the next
guest
Quoted 3 lines
instruction. It is correctly saved and restored on vcpu context switch.
Furthermore, 64bit Windows writes to this MSR on every thread context
Quoted 9 lines
switch,
Quoted 5 lines
so interception causes a substantial performance hit.
From: Paul Durrant <[email protected]>
Signed-off-by Paul Durrant <[email protected]>Signed-off-by Andrew Cooper <[email protected]>Reviewed-by Tim Deegan <[email protected]>
Signature · 2 lines
Jun Intel Open Source Technology Center
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel