Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-04 Thread Alex Bennée
Christoffer Dall writes: > On Thu, Jul 31, 2014 at 07:21:44PM +0200, Paolo Bonzini wrote: >> Il 31/07/2014 19:04, Peter Maydell ha scritto: >> > On 31 July 2014 17:57, Paolo Bonzini wrote: >> >> Il 09/07/2014 15:55, Alex Bennée ha scritto: >> >> No, it's not. It's just the state of the CPU, s

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-04 Thread Christoffer Dall
On Thu, Jul 31, 2014 at 07:21:44PM +0200, Paolo Bonzini wrote: > Il 31/07/2014 19:04, Peter Maydell ha scritto: > > On 31 July 2014 17:57, Paolo Bonzini wrote: > >> Il 09/07/2014 15:55, Alex Bennée ha scritto: > >>> To cleanly restore an SMP VM we need to ensure that the current pause > >>> state

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-04 Thread Christoffer Dall
On Fri, Aug 01, 2014 at 10:11:52AM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Bennée wrote: > >> > >> Christoffer Dall writes: > >> > >> > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote: > >> >> To cleanly restore an

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-04 Thread Christoffer Dall
On Fri, Aug 01, 2014 at 10:48:36AM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Thu, Jul 31, 2014 at 05:45:28PM +0100, Peter Maydell wrote: > >> On 31 July 2014 17:38, Christoffer Dall > >> wrote: > >> >> > If we are not complaining when setting the pause value to false if it

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-01 Thread Alex Bennée
Christoffer Dall writes: > On Thu, Jul 31, 2014 at 05:45:28PM +0100, Peter Maydell wrote: >> On 31 July 2014 17:38, Christoffer Dall wrote: >> >> > If we are not complaining when setting the pause value to false if it >> >> > was true before, then we probably also need to wake up the thread in >

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-08-01 Thread Alex Bennée
Christoffer Dall writes: > On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Bennée wrote: >> >> Christoffer Dall writes: >> >> > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote: >> >> To cleanly restore an SMP VM we need to ensure that the current pause >> >> state of each vcpu is cor

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Will Deacon
On Thu, Jul 31, 2014 at 06:36:35PM +0100, Peter Maydell wrote: > On 31 July 2014 18:21, Paolo Bonzini wrote: > > What does ARM do if you have a WFI while interrupts are disabled? On > > x86 after "cli;hlt" only an NMI will wake you up. With spurious > > wakeups, it's pretty much guaranteed that

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Peter Maydell
On 31 July 2014 18:21, Paolo Bonzini wrote: > What does ARM do if you have a WFI while interrupts are disabled? On > x86 after "cli;hlt" only an NMI will wake you up. With spurious > wakeups, it's pretty much guaranteed that you will break such "cli;hlt" > sequences. The architecture mandates s

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Paolo Bonzini
Il 31/07/2014 19:04, Peter Maydell ha scritto: > On 31 July 2014 17:57, Paolo Bonzini wrote: >> Il 09/07/2014 15:55, Alex Bennée ha scritto: >>> To cleanly restore an SMP VM we need to ensure that the current pause >>> state of each vcpu is correctly recorded. Things could get confused if >>> the

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Peter Maydell
On 31 July 2014 17:57, Paolo Bonzini wrote: > Il 09/07/2014 15:55, Alex Bennée ha scritto: >> To cleanly restore an SMP VM we need to ensure that the current pause >> state of each vcpu is correctly recorded. Things could get confused if >> the CPU starts running after migration restore completes

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Paolo Bonzini
Il 09/07/2014 15:55, Alex Bennée ha scritto: > To cleanly restore an SMP VM we need to ensure that the current pause > state of each vcpu is correctly recorded. Things could get confused if > the CPU starts running after migration restore completes when it was > paused before it state was captured.

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Peter Maydell
On 31 July 2014 17:50, Christoffer Dall wrote: > On Thu, Jul 31, 2014 at 05:45:28PM +0100, Peter Maydell wrote: >> Consider the case where the reset state of the system is >> "CPU 0 running, CPUs 1..N stopped", and we're doing an >> incoming migration to a state where all CPUs are running. >> In t

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Christoffer Dall
On Thu, Jul 31, 2014 at 05:45:28PM +0100, Peter Maydell wrote: > On 31 July 2014 17:38, Christoffer Dall wrote: > >> > If we are not complaining when setting the pause value to false if it > >> > was true before, then we probably also need to wake up the thread in > >> > case this is called from a

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Peter Maydell
On 31 July 2014 17:38, Christoffer Dall wrote: >> > If we are not complaining when setting the pause value to false if it >> > was true before, then we probably also need to wake up the thread in >> > case this is called from another thread, right? >> > >> > or perhaps we should just return an err

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Christoffer Dall
On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote: > >> To cleanly restore an SMP VM we need to ensure that the current pause > >> state of each vcpu is correctly recorded. Things could get c

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Alex Bennée
Christoffer Dall writes: > On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote: >> To cleanly restore an SMP VM we need to ensure that the current pause >> state of each vcpu is correctly recorded. Things could get confused if >> the CPU starts running after migration restore completes wh

Re: [PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-31 Thread Christoffer Dall
On Wed, Jul 09, 2014 at 02:55:12PM +0100, Alex Bennée wrote: > To cleanly restore an SMP VM we need to ensure that the current pause > state of each vcpu is correctly recorded. Things could get confused if > the CPU starts running after migration restore completes when it was > paused before it sta

[PATCH] arm64: KVM: export current vcpu->pause state via pseudo regs

2014-07-09 Thread Alex Bennée
To cleanly restore an SMP VM we need to ensure that the current pause state of each vcpu is correctly recorded. Things could get confused if the CPU starts running after migration restore completes when it was paused before it state was captured. I've done this by exposing a register (currently on