Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-10-01 Thread Cédric Le Goater
On 10/1/21 12:38, Greg Kurz wrote: On Fri, 1 Oct 2021 11:59:45 +0200 Cédric Le Goater wrote: Maybe it would be simpler to call xive_source_is_initialized() instead of xive_eas_is_valid() in cases like this, e.g. hcall code since it is shared between emulation and KVM ? Yes but we need a

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-10-01 Thread Greg Kurz
On Fri, 1 Oct 2021 11:59:45 +0200 Cédric Le Goater wrote: > >>> Maybe it would be simpler to call xive_source_is_initialized() instead of > >>> xive_eas_is_valid() in cases like this, e.g. hcall code since it is shared > >>> between emulation and KVM ? > >> > >> Yes but we need a better check

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-10-01 Thread Cédric Le Goater
Maybe it would be simpler to call xive_source_is_initialized() instead of xive_eas_is_valid() in cases like this, e.g. hcall code since it is shared between emulation and KVM ? Yes but we need a better check than : if (lisn < SPAPR_XIRQ_BASE) { return

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-28 Thread Greg Kurz
On Mon, 27 Sep 2021 18:50:40 +0200 Cédric Le Goater wrote: > On 9/24/21 19:13, Greg Kurz wrote: > > On Fri, 24 Sep 2021 16:58:00 +0200 > > Cédric Le Goater wrote: > > > >> [ ... ] > >> > The changes only impact KVM support since we are deferring the IRQ > initialization at the KVM

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-27 Thread Cédric Le Goater
On 9/24/21 19:13, Greg Kurz wrote: On Fri, 24 Sep 2021 16:58:00 +0200 Cédric Le Goater wrote: [ ... ] The changes only impact KVM support since we are deferring the IRQ initialization at the KVM level. What we have to be careful about is not accessing an ESB page of an interrupt that would

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-24 Thread Greg Kurz
On Fri, 24 Sep 2021 16:58:00 +0200 Cédric Le Goater wrote: > [ ... ] > > >> The changes only impact KVM support since we are deferring the IRQ > >> initialization at the KVM level. What we have to be careful about is not > >> accessing an ESB page of an interrupt that would not have been

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-24 Thread Cédric Le Goater
[ ... ] The changes only impact KVM support since we are deferring the IRQ initialization at the KVM level. What we have to be careful about is not accessing an ESB page of an interrupt that would not have been initiliazed in the KVM device, else QEMU gets a sigbus. Ok, so this is just

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-24 Thread Greg Kurz
On Fri, 24 Sep 2021 14:40:24 +0200 Cédric Le Goater wrote: > On 9/23/21 11:12, Greg Kurz wrote: > > On Wed, 22 Sep 2021 16:41:20 +0200 > > Cédric Le Goater wrote: > > > >> When QEMU switches to the XIVE interrupt mode, it creates all possible > >> guest interrupts at the level of the KVM

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-24 Thread Cédric Le Goater
On 9/23/21 11:12, Greg Kurz wrote: On Wed, 22 Sep 2021 16:41:20 +0200 Cédric Le Goater wrote: When QEMU switches to the XIVE interrupt mode, it creates all possible guest interrupts at the level of the KVM device. These interrupts are backed by real HW interrupts from the IPI interrupt pool

Re: [RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-23 Thread Greg Kurz
On Wed, 22 Sep 2021 16:41:20 +0200 Cédric Le Goater wrote: > When QEMU switches to the XIVE interrupt mode, it creates all possible > guest interrupts at the level of the KVM device. These interrupts are > backed by real HW interrupts from the IPI interrupt pool of the XIVE > controller. > >

[RFC PATCH] spapr/xive: Allocate vCPU IPIs from local context

2021-09-22 Thread Cédric Le Goater
When QEMU switches to the XIVE interrupt mode, it creates all possible guest interrupts at the level of the KVM device. These interrupts are backed by real HW interrupts from the IPI interrupt pool of the XIVE controller. Currently, this is done from the QEMU main thread, which results in