Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-10 Thread David Gibson
On Thu, Aug 10, 2017 at 09:36:04PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2017-08-10 at 09:19 +0200, Cédric Le Goater wrote: > > > > > > + /* Perform the acknowledge hypervisor to register cycle */ > > > > > > + ack = be16_to_cpu(__raw_readw(xive_tima + TM_SPC_ACK_OS_REG)); > > > > > > >

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-10 Thread Benjamin Herrenschmidt
On Thu, 2017-08-10 at 09:19 +0200, Cédric Le Goater wrote: > > > > > + /* Perform the acknowledge hypervisor to register cycle */ > > > > > + ack = be16_to_cpu(__raw_readw(xive_tima + TM_SPC_ACK_OS_REG)); > > > > > > > > Why do you need the raw_readw() + be16_to_cpu + mb, rather than one of > >

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-10 Thread Benjamin Herrenschmidt
On Thu, 2017-08-10 at 08:45 +0200, Cédric Le Goater wrote: > > The problem with doorbells on POWER9 guests is that they may have > > to trap and be emulated by the hypervisor, since the guest threads > > on P9 don't have to match the HW threads of the core. > > Well, the pseries cause_ipi() handle

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-10 Thread Cédric Le Goater
On 08/10/2017 07:54 AM, David Gibson wrote: > On Thu, Aug 10, 2017 at 02:46:00PM +1000, Benjamin Herrenschmidt wrote: >> On Thu, 2017-08-10 at 14:28 +1000, David Gibson wrote: >>> >>> Also, will POWER9 always have doorbells? In which case you could >>> reduce it to 3 options. >> >> The problem wit

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-10 Thread Cédric Le Goater
+static void xive_spapr_update_pending(struct xive_cpu *xc) +{ + u8 nsr, cppr; + u16 ack; + + /* Perform the acknowledge hypervisor to register cycle */ + ack = be16_to_cpu(__raw_readw(xive_tima + TM_SPC_ACK_OS_REG)); >>> >>> Why do you need the raw_readw() +

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-09 Thread Cédric Le Goater
On 08/10/2017 06:46 AM, Benjamin Herrenschmidt wrote: > On Thu, 2017-08-10 at 14:28 +1000, David Gibson wrote: >> >> Also, will POWER9 always have doorbells? In which case you could >> reduce it to 3 options. > > The problem with doorbells on POWER9 guests is that they may have > to trap and be e

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-09 Thread David Gibson
On Thu, Aug 10, 2017 at 02:46:00PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2017-08-10 at 14:28 +1000, David Gibson wrote: > > > > Also, will POWER9 always have doorbells? In which case you could > > reduce it to 3 options. > > The problem with doorbells on POWER9 guests is that they may h

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-09 Thread Benjamin Herrenschmidt
On Thu, 2017-08-10 at 14:28 +1000, David Gibson wrote: > > Also, will POWER9 always have doorbells? In which case you could > reduce it to 3 options. The problem with doorbells on POWER9 guests is that they may have to trap and be emulated by the hypervisor, since the guest threads on P9 don't h

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-09 Thread David Gibson
On Wed, Aug 09, 2017 at 10:48:48AM +0200, Cédric Le Goater wrote: > On 08/09/2017 05:53 AM, David Gibson wrote: > > On Tue, Aug 08, 2017 at 10:56:12AM +0200, Cédric Le Goater wrote: > >> This is the framework for using XIVE in a PowerVM guest. The support > >> is very similar to the native one in a

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-09 Thread Cédric Le Goater
On 08/09/2017 05:53 AM, David Gibson wrote: > On Tue, Aug 08, 2017 at 10:56:12AM +0200, Cédric Le Goater wrote: >> This is the framework for using XIVE in a PowerVM guest. The support >> is very similar to the native one in a much simpler form. >> >> Instead of OPAL calls, a set of Hypervisors call

Re: [PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-08 Thread David Gibson
On Tue, Aug 08, 2017 at 10:56:12AM +0200, Cédric Le Goater wrote: > This is the framework for using XIVE in a PowerVM guest. The support > is very similar to the native one in a much simpler form. > > Instead of OPAL calls, a set of Hypervisors call are used to configure > the interrupt sources an

[PATCH 02/10] powerpc/xive: guest exploitation of the XIVE interrupt controller

2017-08-08 Thread Cédric Le Goater
This is the framework for using XIVE in a PowerVM guest. The support is very similar to the native one in a much simpler form. Instead of OPAL calls, a set of Hypervisors call are used to configure the interrupt sources and the event/notification queues of the guest: - H_INT_GET_SOURCE_INFO