Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-25 Thread Cédric Le Goater
On 07/25/2017 02:39 PM, David Gibson wrote: > On Tue, Jul 25, 2017 at 10:52:27AM +0200, Cédric Le Goater wrote: >> On 07/24/2017 12:03 PM, David Gibson wrote: >>> On Mon, Jul 24, 2017 at 05:20:26PM +1000, Benjamin Herrenschmidt wrote: On Mon, 2017-07-24 at 15:38 +1000, David Gibson wrote:

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-25 Thread David Gibson
On Tue, Jul 25, 2017 at 10:52:27AM +0200, Cédric Le Goater wrote: > On 07/24/2017 12:03 PM, David Gibson wrote: > > On Mon, Jul 24, 2017 at 05:20:26PM +1000, Benjamin Herrenschmidt wrote: > >> On Mon, 2017-07-24 at 15:38 +1000, David Gibson wrote: > >>> > >>> Can we assign our logical numbers spars

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-25 Thread Cédric Le Goater
On 07/24/2017 12:03 PM, David Gibson wrote: > On Mon, Jul 24, 2017 at 05:20:26PM +1000, Benjamin Herrenschmidt wrote: >> On Mon, 2017-07-24 at 15:38 +1000, David Gibson wrote: >>> >>> Can we assign our logical numbers sparsely, or will that cause other >>> problems? >> >> The main issue is that the

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-24 Thread Cédric Le Goater
>> +#include "qemu/osdep.h" >> +#include "qemu/log.h" >> +#include "qapi/error.h" >> +#include "target/ppc/cpu.h" >> +#include "sysemu/cpus.h" >> +#include "sysemu/dma.h" >> +#include "monitor/monitor.h" >> +#include "hw/ppc/xive.h" >> + >> +#include "xive-internal.h" >> + >> +/* >> + * Main XIVE o

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-24 Thread David Gibson
On Mon, Jul 24, 2017 at 05:20:26PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2017-07-24 at 15:38 +1000, David Gibson wrote: > > > > Can we assign our logical numbers sparsely, or will that cause other > > problems? > > The main issue is that they probably needs to be the same between XICS >

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-24 Thread Benjamin Herrenschmidt
On Mon, 2017-07-24 at 15:38 +1000, David Gibson wrote: > > Can we assign our logical numbers sparsely, or will that cause other > problems? The main issue is that they probably needs to be the same between XICS and XIVE because by the time we get the CAS call to chose between XICS and XIVE, we ha

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-23 Thread David Gibson
On Mon, Jul 24, 2017 at 03:04:05PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2017-07-24 at 13:28 +1000, David Gibson wrote: > > > So yes, in PAPR there's an "allocator" because the hypervisor will > > > create a guest "virtual" (or logical to use PAPR terminology) interrupt > > > number space,

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-23 Thread Benjamin Herrenschmidt
On Mon, 2017-07-24 at 13:28 +1000, David Gibson wrote: > > So yes, in PAPR there's an "allocator" because the hypervisor will > > create a guest "virtual" (or logical to use PAPR terminology) interrupt > > number space, in order to represents the various interrupts into the > > guest. > > Ok, but

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-23 Thread Alexey Kardashevskiy
On 24/07/17 13:28, David Gibson wrote: > On Fri, Jul 21, 2017 at 06:21:31PM +1000, Benjamin Herrenschmidt wrote: >> On Fri, 2017-07-21 at 17:50 +1000, David Gibson wrote: >>> On Wed, Jul 19, 2017 at 02:02:18PM +1000, Benjamin Herrenschmidt wrote: On Wed, 2017-07-19 at 13:08 +1000, David Gibson

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-23 Thread David Gibson
On Fri, Jul 21, 2017 at 06:21:31PM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2017-07-21 at 17:50 +1000, David Gibson wrote: > > On Wed, Jul 19, 2017 at 02:02:18PM +1000, Benjamin Herrenschmidt wrote: > > > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > > > > > > > I'm somewhat unc

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-21 Thread Benjamin Herrenschmidt
On Fri, 2017-07-21 at 17:50 +1000, David Gibson wrote: > On Wed, Jul 19, 2017 at 02:02:18PM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > > > > > I'm somewhat uncomfortable with an irq allocater here in the intc > > > code. As a rule, irq allo

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-21 Thread David Gibson
On Wed, Jul 19, 2017 at 02:02:18PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > > > I'm somewhat uncomfortable with an irq allocater here in the intc > > code. As a rule, irq allocation is the responsibility of the machine, > > not any sub-comp

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread David Gibson
On Wed, Jul 19, 2017 at 02:18:17PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2017-07-19 at 14:01 +1000, David Gibson wrote: > > On Wed, Jul 19, 2017 at 01:56:57PM +1000, Benjamin Herrenschmidt wrote: > > > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > > > On Wed, Jul 05, 2017 at 0

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread Benjamin Herrenschmidt
On Wed, 2017-07-19 at 14:01 +1000, David Gibson wrote: > On Wed, Jul 19, 2017 at 01:56:57PM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > > On Wed, Jul 05, 2017 at 07:13:17PM +0200, Cédric Le Goater wrote: > > > > Let's provide an empty shell fo

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread Benjamin Herrenschmidt
On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > I'm somewhat uncomfortable with an irq allocater here in the intc > code. As a rule, irq allocation is the responsibility of the machine, > not any sub-component. Furthermore, it should allocate in a way which > is repeatable, since they

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread David Gibson
On Wed, Jul 19, 2017 at 01:56:57PM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > > On Wed, Jul 05, 2017 at 07:13:17PM +0200, Cédric Le Goater wrote: > > > Let's provide an empty shell for the XIVE controller model with a > > > couple of attributes f

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread Benjamin Herrenschmidt
On Wed, 2017-07-19 at 13:08 +1000, David Gibson wrote: > On Wed, Jul 05, 2017 at 07:13:17PM +0200, Cédric Le Goater wrote: > > Let's provide an empty shell for the XIVE controller model with a > > couple of attributes for the IRQ number allocator. The latter is > > largely inspired by OPAL which al

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread David Gibson
On Wed, Jul 05, 2017 at 07:13:17PM +0200, Cédric Le Goater wrote: > Let's provide an empty shell for the XIVE controller model with a > couple of attributes for the IRQ number allocator. The latter is > largely inspired by OPAL which allocates IPI IRQ numbers from the > bottom of the IRQ number spa

Re: [Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-18 Thread David Gibson
On Wed, Jul 19, 2017 at 01:08:49PM +1000, David Gibson wrote: > On Wed, Jul 05, 2017 at 07:13:17PM +0200, Cédric Le Goater wrote: > > Let's provide an empty shell for the XIVE controller model with a > > couple of attributes for the IRQ number allocator. The latter is > > largely inspired by OPAL w

[Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-05 Thread Cédric Le Goater
Let's provide an empty shell for the XIVE controller model with a couple of attributes for the IRQ number allocator. The latter is largely inspired by OPAL which allocates IPI IRQ numbers from the bottom of the IRQ number space and allocates the HW IRQ numbers from the top. The number of IPIs is s