Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-14 Thread Paolo Bonzini
Il 13/03/2014 18:08, Radim Krčmář ha scritto: > I agree that old code is wrong and the patch looks correct, but I only > see how the bug may cause pending IRR to not be delivered in time, > not how interrupt can disrupt a higher priority task. Right. Also, on SMP guests the effect would

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-14 Thread Paolo Bonzini
Il 13/03/2014 18:08, Radim Krčmář ha scritto: I agree that old code is wrong and the patch looks correct, but I only see how the bug may cause pending IRR to not be delivered in time, not how interrupt can disrupt a higher priority task. Right. Also, on SMP guests the effect would likely

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-13 Thread Radim Krčmář
2014-03-13 15:52+0200, Gleb Natapov: > On Wed, Mar 12, 2014 at 06:20:01PM +0100, Paolo Bonzini wrote: > > Il 12/03/2014 11:40, Radim Krčmář ha scritto: > > >2014-03-11 22:05-0300, Marcelo Tosatti: > > >>On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > > >>>We always disable cr8

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-13 Thread Gleb Natapov
On Wed, Mar 12, 2014 at 06:20:01PM +0100, Paolo Bonzini wrote: > Il 12/03/2014 11:40, Radim Krčmář ha scritto: > >2014-03-11 22:05-0300, Marcelo Tosatti: > >>On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > >>>We always disable cr8 intercept in its handler, but only re-enable it >

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-13 Thread Gleb Natapov
On Wed, Mar 12, 2014 at 06:20:01PM +0100, Paolo Bonzini wrote: Il 12/03/2014 11:40, Radim Krčmář ha scritto: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-13 Thread Radim Krčmář
2014-03-13 15:52+0200, Gleb Natapov: On Wed, Mar 12, 2014 at 06:20:01PM +0100, Paolo Bonzini wrote: Il 12/03/2014 11:40, Radim Krčmář ha scritto: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Paolo Bonzini
Il 12/03/2014 11:40, Radim Krčmář ha scritto: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Marcelo Tosatti
On Wed, Mar 12, 2014 at 11:40:48AM +0100, Radim Krčmář wrote: > 2014-03-11 22:05-0300, Marcelo Tosatti: > > On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > > > We always disable cr8 intercept in its handler, but only re-enable it > > > if handling KVM_REQ_EVENT, so there can be a

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Radim Krčmář
2014-03-11 22:05-0300, Marcelo Tosatti: > On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > > We always disable cr8 intercept in its handler, but only re-enable it > > if handling KVM_REQ_EVENT, so there can be a window where we do not > > intercept cr8 writes, which allows an

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Marcelo Tosatti
On Wed, Mar 12, 2014 at 11:40:48AM +0100, Radim Krčmář wrote: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Paolo Bonzini
Il 12/03/2014 11:40, Radim Krčmář ha scritto: 2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-12 Thread Radim Krčmář
2014-03-11 22:05-0300, Marcelo Tosatti: On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not intercept cr8 writes, which allows an interrupt to

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-11 Thread Marcelo Tosatti
On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: > We always disable cr8 intercept in its handler, but only re-enable it > if handling KVM_REQ_EVENT, so there can be a window where we do not > intercept cr8 writes, which allows an interrupt to disrupt a higher > priority task. > >

[PATCH] KVM: SVM: fix cr8 intercept window

2014-03-11 Thread Radim Krčmář
We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not intercept cr8 writes, which allows an interrupt to disrupt a higher priority task. Fix this by disabling intercepts in the same function that re-enables them

[PATCH] KVM: SVM: fix cr8 intercept window

2014-03-11 Thread Radim Krčmář
We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not intercept cr8 writes, which allows an interrupt to disrupt a higher priority task. Fix this by disabling intercepts in the same function that re-enables them

Re: [PATCH] KVM: SVM: fix cr8 intercept window

2014-03-11 Thread Marcelo Tosatti
On Tue, Mar 11, 2014 at 07:11:18PM +0100, Radim Krčmář wrote: We always disable cr8 intercept in its handler, but only re-enable it if handling KVM_REQ_EVENT, so there can be a window where we do not intercept cr8 writes, which allows an interrupt to disrupt a higher priority task. Fix this