Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-31 Thread David Hildenbrand
> > We have > > - wait (wait bit in PSW) > > - disabled wait (wait bit and interrupt fencing in PSW) > > - STOPPED (not related to PSW, state change usually handled via service > > processor or hypervisor) > > > > I think we have to differentiate between KVM/TCG. On KVM we always do in > > kernel

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-29 Thread David Hildenbrand
> Il 28/07/2014 17:03, David Hildenbrand ha scritto: > > Well the difference is, that a STOPPED vcpu can be woken up by non-interrupt > > like things (SIGP START) AND a special interrupt (SIGP RESTART - which is > > like > > a "SIPI"++ as it performs a psw exchange - "NMI"). So we basically have t

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-29 Thread Paolo Bonzini
Il 28/07/2014 17:03, David Hildenbrand ha scritto: > Well the difference is, that a STOPPED vcpu can be woken up by non-interrupt > like things (SIGP START) AND a special interrupt (SIGP RESTART - which is like > a "SIPI"++ as it performs a psw exchange - "NMI"). So we basically have two > paths th

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-29 Thread Alexander Graf
On 29.07.14 13:44, Christian Borntraeger wrote: On 28/07/14 16:22, Alexander Graf wrote: On 28.07.2014, at 16:16, David Hildenbrand wrote: On 10.07.14 15:10, Christian Borntraeger wrote: From: David Hildenbrand If a cpu is stopped, it must never be allowed to run and no interrupt may wake

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-29 Thread Christian Borntraeger
On 28/07/14 16:22, Alexander Graf wrote: > > On 28.07.2014, at 16:16, David Hildenbrand wrote: > >>> >>> On 10.07.14 15:10, Christian Borntraeger wrote: From: David Hildenbrand If a cpu is stopped, it must never be allowed to run and no interrupt may wake it up. A cpu

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread Alexander Graf
On 28.07.14 17:03, David Hildenbrand wrote: On 28.07.2014, at 16:16, David Hildenbrand wrote: On 10.07.14 15:10, Christian Borntraeger wrote: From: David Hildenbrand If a cpu is stopped, it must never be allowed to run and no interrupt may wake it up. A cpu also has to be unhalted if it i

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread David Hildenbrand
> > > > On 28.07.2014, at 16:16, David Hildenbrand wrote: > > > > >> > > >> On 10.07.14 15:10, Christian Borntraeger wrote: > > >>> From: David Hildenbrand > > >>> > > >>> If a cpu is stopped, it must never be allowed to run and no interrupt > > >>> may wake it > > >>> up. A cpu also has to

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread David Hildenbrand
> > On 28.07.2014, at 16:16, David Hildenbrand wrote: > > >> > >> On 10.07.14 15:10, Christian Borntraeger wrote: > >>> From: David Hildenbrand > >>> > >>> If a cpu is stopped, it must never be allowed to run and no interrupt may > >>> wake it > >>> up. A cpu also has to be unhalted if it is

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread Alexander Graf
On 28.07.2014, at 16:16, David Hildenbrand wrote: >> >> On 10.07.14 15:10, Christian Borntraeger wrote: >>> From: David Hildenbrand >>> >>> If a cpu is stopped, it must never be allowed to run and no interrupt may >>> wake it >>> up. A cpu also has to be unhalted if it is halted and has work

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread Paolo Bonzini
Il 28/07/2014 16:16, David Hildenbrand ha scritto: > Later, another vcpu might decide to turn that vcpu back on (by e.g. sending a > SIGP START to that vcpu). > > I am not sure if such a mechanism/scenario is applicable to any other arch. > They > all seem to reset the cs->halted flag if they kno

Re: [Qemu-devel] [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread David Hildenbrand
> > On 10.07.14 15:10, Christian Borntraeger wrote: > > From: David Hildenbrand > > > > If a cpu is stopped, it must never be allowed to run and no interrupt may > > wake it > > up. A cpu also has to be unhalted if it is halted and has work to do - this > > scenario wasn't hit in kvm case yet, a

Re: [PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-28 Thread Alexander Graf
On 10.07.14 15:10, Christian Borntraeger wrote: From: David Hildenbrand If a cpu is stopped, it must never be allowed to run and no interrupt may wake it up. A cpu also has to be unhalted if it is halted and has work to do - this scenario wasn't hit in kvm case yet, as only "disabled wait" is

[PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking "has_work"

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand If a cpu is stopped, it must never be allowed to run and no interrupt may wake it up. A cpu also has to be unhalted if it is halted and has work to do - this scenario wasn't hit in kvm case yet, as only "disabled wait" is processed within QEMU. Signed-off-by: David Hilde