Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Suresh Siddha
On Thu, 2012-09-20 at 12:50 +0300, Avi Kivity wrote: > On 09/20/2012 03:10 AM, Suresh Siddha wrote: > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > > index b06737d..8ff328b 100644 > > --- a/arch/x86/kvm/vmx.c > > +++ b/arch/x86/kvm/vmx.c > > @@ -1493,7 +1493,8 @@ static void

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/20/2012 03:10 AM, Suresh Siddha wrote: > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index b06737d..8ff328b 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -1493,7 +1493,8 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) > #ifdef CONFIG_X86_64 >

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:26 PM, H. Peter Anvin wrote: > On 09/19/2012 10:22 AM, Avi Kivity wrote: >> >> Note, we could also go in a different direction and make >> kernel_fpu_begin() use preempt notifiers and thus make its users >> preemptible. But that's for a separate patchset. >> > > Where would

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:25 PM, Suresh Siddha wrote: > On Wed, 2012-09-19 at 20:22 +0300, Avi Kivity wrote: >> On 09/19/2012 08:18 PM, Suresh Siddha wrote: >> >> > These routines (kvm_load/put_guest_fpu()) are already called with >> > preemption disabled but as you mentioned, we don't want the preemption

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:25 PM, Suresh Siddha wrote: On Wed, 2012-09-19 at 20:22 +0300, Avi Kivity wrote: On 09/19/2012 08:18 PM, Suresh Siddha wrote: These routines (kvm_load/put_guest_fpu()) are already called with preemption disabled but as you mentioned, we don't want the preemption to be

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:26 PM, H. Peter Anvin wrote: On 09/19/2012 10:22 AM, Avi Kivity wrote: Note, we could also go in a different direction and make kernel_fpu_begin() use preempt notifiers and thus make its users preemptible. But that's for a separate patchset. Where would you put the

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Avi Kivity
On 09/20/2012 03:10 AM, Suresh Siddha wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b06737d..8ff328b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1493,7 +1493,8 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) #ifdef CONFIG_X86_64

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-20 Thread Suresh Siddha
On Thu, 2012-09-20 at 12:50 +0300, Avi Kivity wrote: On 09/20/2012 03:10 AM, Suresh Siddha wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b06737d..8ff328b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1493,7 +1493,8 @@ static void

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 10:18 -0700, Suresh Siddha wrote: > These routines (kvm_load/put_guest_fpu()) are already called with > preemption disabled but as you mentioned, we don't want the preemption > to be disabled completely between the kvm_load_guest_fpu() and > kvm_put_guest_fpu(). > > Also KVM

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread H. Peter Anvin
On 09/19/2012 10:22 AM, Avi Kivity wrote: > > Note, we could also go in a different direction and make > kernel_fpu_begin() use preempt notifiers and thus make its users > preemptible. But that's for a separate patchset. > Where would you put the state if you were preempted? You want to

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 20:22 +0300, Avi Kivity wrote: > On 09/19/2012 08:18 PM, Suresh Siddha wrote: > > > These routines (kvm_load/put_guest_fpu()) are already called with > > preemption disabled but as you mentioned, we don't want the preemption > > to be disabled completely between the

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Avi Kivity
On 09/19/2012 08:18 PM, Suresh Siddha wrote: > These routines (kvm_load/put_guest_fpu()) are already called with > preemption disabled but as you mentioned, we don't want the preemption > to be disabled completely between the kvm_load_guest_fpu() and > kvm_put_guest_fpu(). > > Also KVM already

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 13:13 +0300, Avi Kivity wrote: > On 08/25/2012 12:12 AM, Suresh Siddha wrote: > > kvm's guest fpu save/restore should be wrapped around > > kernel_fpu_begin/end(). This will avoid for example taking a DNA > > in kvm_load_guest_fpu() when it tries to load the fpu immediately >

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Avi Kivity
On 08/25/2012 12:12 AM, Suresh Siddha wrote: > kvm's guest fpu save/restore should be wrapped around > kernel_fpu_begin/end(). This will avoid for example taking a DNA > in kvm_load_guest_fpu() when it tries to load the fpu immediately > after doing unlazy_fpu() on the host side. > > More

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Avi Kivity
On 08/25/2012 12:12 AM, Suresh Siddha wrote: kvm's guest fpu save/restore should be wrapped around kernel_fpu_begin/end(). This will avoid for example taking a DNA in kvm_load_guest_fpu() when it tries to load the fpu immediately after doing unlazy_fpu() on the host side. More importantly

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 13:13 +0300, Avi Kivity wrote: On 08/25/2012 12:12 AM, Suresh Siddha wrote: kvm's guest fpu save/restore should be wrapped around kernel_fpu_begin/end(). This will avoid for example taking a DNA in kvm_load_guest_fpu() when it tries to load the fpu immediately after

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Avi Kivity
On 09/19/2012 08:18 PM, Suresh Siddha wrote: These routines (kvm_load/put_guest_fpu()) are already called with preemption disabled but as you mentioned, we don't want the preemption to be disabled completely between the kvm_load_guest_fpu() and kvm_put_guest_fpu(). Also KVM already has the

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 20:22 +0300, Avi Kivity wrote: On 09/19/2012 08:18 PM, Suresh Siddha wrote: These routines (kvm_load/put_guest_fpu()) are already called with preemption disabled but as you mentioned, we don't want the preemption to be disabled completely between the

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread H. Peter Anvin
On 09/19/2012 10:22 AM, Avi Kivity wrote: Note, we could also go in a different direction and make kernel_fpu_begin() use preempt notifiers and thus make its users preemptible. But that's for a separate patchset. Where would you put the state if you were preempted? You want to allocate a

Re: [PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-09-19 Thread Suresh Siddha
On Wed, 2012-09-19 at 10:18 -0700, Suresh Siddha wrote: These routines (kvm_load/put_guest_fpu()) are already called with preemption disabled but as you mentioned, we don't want the preemption to be disabled completely between the kvm_load_guest_fpu() and kvm_put_guest_fpu(). Also KVM

[PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-08-24 Thread Suresh Siddha
kvm's guest fpu save/restore should be wrapped around kernel_fpu_begin/end(). This will avoid for example taking a DNA in kvm_load_guest_fpu() when it tries to load the fpu immediately after doing unlazy_fpu() on the host side. More importantly this will prevent the host process fpu from being

[PATCH 3/6] x86, kvm: use kernel_fpu_begin/end() in kvm_load/put_guest_fpu()

2012-08-24 Thread Suresh Siddha
kvm's guest fpu save/restore should be wrapped around kernel_fpu_begin/end(). This will avoid for example taking a DNA in kvm_load_guest_fpu() when it tries to load the fpu immediately after doing unlazy_fpu() on the host side. More importantly this will prevent the host process fpu from being