Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-09 Thread Cédric Le Goater
On 10/06/2017 12:10 PM, David Gibson wrote: > On Fri, Oct 06, 2017 at 11:53:30AM +0200, Benjamin Herrenschmidt wrote: >> On Fri, 2017-10-06 at 20:07 +1100, David Gibson wrote: >>> Hm. Checking mmu_model doesn't seem right to me. I mean, it'll get >>> the right answer in practice, but the LPCR

Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-06 Thread David Gibson
On Fri, Oct 06, 2017 at 11:15:31PM +0200, Cédric Le Goater wrote: > On 10/06/2017 11:07 AM, David Gibson wrote: > > On Thu, Oct 05, 2017 at 06:49:58PM +0200, Cédric Le Goater wrote: > >> When a CPU is stopped with the 'stop-self' RTAS call, its state > >> 'halted' is switched to 1 and, in this

Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-06 Thread Cédric Le Goater
On 10/06/2017 11:07 AM, David Gibson wrote: > On Thu, Oct 05, 2017 at 06:49:58PM +0200, Cédric Le Goater wrote: >> When a CPU is stopped with the 'stop-self' RTAS call, its state >> 'halted' is switched to 1 and, in this case, the MSR is not taken into >> account anymore in the cpu_has_work()

Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-06 Thread David Gibson
On Fri, Oct 06, 2017 at 11:53:30AM +0200, Benjamin Herrenschmidt wrote: > On Fri, 2017-10-06 at 20:07 +1100, David Gibson wrote: > > Hm. Checking mmu_model doesn't seem right to me. I mean, it'll get > > the right answer in practice, but the LPCR programming has nothing > > whatsoever to do with

Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-06 Thread Benjamin Herrenschmidt
On Fri, 2017-10-06 at 20:07 +1100, David Gibson wrote: > Hm. Checking mmu_model doesn't seem right to me. I mean, it'll get > the right answer in practice, but the LPCR programming has nothing > whatsoever to do with the MMU. > > I think explicitly checking if cpu_ is a POWER9 instance with >

Re: [Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-06 Thread David Gibson
On Thu, Oct 05, 2017 at 06:49:58PM +0200, Cédric Le Goater wrote: > When a CPU is stopped with the 'stop-self' RTAS call, its state > 'halted' is switched to 1 and, in this case, the MSR is not taken into > account anymore in the cpu_has_work() routine. Only the pending > hardware interrupts are

[Qemu-devel] [PATCH 1/2] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged

2017-10-05 Thread Cédric Le Goater
When a CPU is stopped with the 'stop-self' RTAS call, its state 'halted' is switched to 1 and, in this case, the MSR is not taken into account anymore in the cpu_has_work() routine. Only the pending hardware interrupts are checked with their LPCR:PECE* enablement bit. If the DECR timer fires