* [PATCH] x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE.
@ 2013-11-14 14:02 Andrew Cooper
2013-11-14 16:01 ` Tim Deegan
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cooper @ 2013-11-14 14:02 UTC (permalink / raw)
To: Xen-devel
Cc: Eddie Dong, Keir Fraser, Jan Beulich, Andrew Cooper, Tim Deegan,
Paul Durrant, Jun Nakajima
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 <paul.durrant@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Eddie Dong <eddie.dong@intel.com>
---
xen/arch/x86/hvm/vmx/vmcs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 290b42f..4aab971 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -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);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE.
2013-11-14 14:02 [PATCH] x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE Andrew Cooper
@ 2013-11-14 16:01 ` Tim Deegan
2013-11-14 22:30 ` Nakajima, Jun
0 siblings, 1 reply; 3+ messages in thread
From: Tim Deegan @ 2013-11-14 16:01 UTC (permalink / raw)
To: Andrew Cooper
Cc: Keir Fraser, Jan Beulich, Eddie Dong, Xen-devel, Paul Durrant,
Jun Nakajima
At 14:02 +0000 on 14 Nov (1384434176), Andrew Cooper wrote:
> 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 <paul.durrant@citrix.com>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE.
2013-11-14 16:01 ` Tim Deegan
@ 2013-11-14 22:30 ` Nakajima, Jun
0 siblings, 0 replies; 3+ messages in thread
From: Nakajima, Jun @ 2013-11-14 22:30 UTC (permalink / raw)
To: Tim Deegan
Cc: Keir Fraser, Andrew Cooper, Eddie Dong, Xen-devel, Paul Durrant,
Jan Beulich
[-- Attachment #1.1: Type: text/plain, Size: 828 bytes --]
On Thu, Nov 14, 2013 at 8:01 AM, Tim Deegan <tim@xen.org> wrote:
> At 14:02 +0000 on 14 Nov (1384434176), Andrew Cooper wrote:
> > 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 <paul.durrant@citrix.com>
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Reviewed-by: Tim Deegan <tim@xen.org>
>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
--
Jun
Intel Open Source Technology Center
[-- Attachment #1.2: Type: text/html, Size: 1603 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-14 22:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 14:02 [PATCH] x86/VT-x: Disable MSR intercept for SHADOW_GS_BASE Andrew Cooper
2013-11-14 16:01 ` Tim Deegan
2013-11-14 22:30 ` Nakajima, Jun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).