Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Marcelo Tosatti
On Wed, Mar 06, 2013 at 01:12:52AM -0500, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Marcelo Tosatti
On Wed, Mar 06, 2013 at 08:57:54AM +0100, Jan Kiszka wrote: On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Jan Kiszka
On 2013-03-06 22:30, Marcelo Tosatti wrote: On Wed, Mar 06, 2013 at 08:57:54AM +0100, Jan Kiszka wrote: On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Marcelo Tosatti
On Wed, Mar 06, 2013 at 10:39:27PM +0100, Jan Kiszka wrote: On 2013-03-06 22:30, Marcelo Tosatti wrote: On Wed, Mar 06, 2013 at 08:57:54AM +0100, Jan Kiszka wrote: On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04,

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Jan Kiszka
On 2013-03-06 22:50, Marcelo Tosatti wrote: On Wed, Mar 06, 2013 at 10:39:27PM +0100, Jan Kiszka wrote: On 2013-03-06 22:30, Marcelo Tosatti wrote: On Wed, Mar 06, 2013 at 08:57:54AM +0100, Jan Kiszka wrote: On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300,

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Paolo Bonzini
Il 06/03/2013 22:19, Marcelo Tosatti ha scritto: Vcpu should only invoke kvm_emulate_halt if it has been through a KVM_MP_STATE_UNINITIALIZED - KVM_MP_STATE_INIT_RECEIVED - KVM_MP_STATE_SIPI_RECEIVED - KVM_MP_STATE_RUNNABLE transition. If it has been through that, how can a

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-06 Thread Marcelo Tosatti
On Wed, Mar 06, 2013 at 11:43:30PM +0100, Paolo Bonzini wrote: Il 06/03/2013 22:19, Marcelo Tosatti ha scritto: Vcpu should only invoke kvm_emulate_halt if it has been through a KVM_MP_STATE_UNINITIALIZED - KVM_MP_STATE_INIT_RECEIVED - KVM_MP_STATE_SIPI_RECEIVED - KVM_MP_STATE_RUNNABLE

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 09:46, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 10:12:05AM +0100, Jan Kiszka wrote: On 2013-03-05 09:46, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 09:24:40AM +0100, Jan Kiszka wrote: On 2013-03-05 08:57, Gleb Natapov wrote: On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Paolo Bonzini
Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident from this code: + if (vcpu-arch.mp_state ==

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-05 11:50, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident from this code: + if

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 11:50:58AM +0100, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT and SIPI are. As evident

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 02:25:51PM +0100, Jan Kiszka wrote: On 2013-03-05 11:50, Paolo Bonzini wrote: Il 05/03/2013 10:37, Gleb Natapov ha scritto: Not at all. I'm keeping the state in a single place, mp_state. I just have to make sure that I do not loose asynchronous events - what INIT

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED was overwritten by kvm_emulate_halt and, thus, got

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky,

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Marcelo Tosatti
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky,

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Paolo Bonzini
On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-05 Thread Jan Kiszka
On 2013-03-06 07:12, Paolo Bonzini wrote: On Tue, Mar 05, 2013 at 08:16:41PM -0300, Marcelo Tosatti wrote: On Mon, Mar 04, 2013 at 10:41:43PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-04 Thread Jan Kiszka
On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED was overwritten by kvm_emulate_halt and, thus, got lost. Fix this by

Re: [PATCH v2] KVM: x86: Convert INIT and SIPI signals into synchronously handled requests

2013-03-04 Thread Gleb Natapov
On Tue, Mar 05, 2013 at 12:00:10AM +0100, Jan Kiszka wrote: On 2013-03-04 22:41, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED was