[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 14/21] ppc/xive: add support for the SET_
From: |
Benjamin Herrenschmidt |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 14/21] ppc/xive: add support for the SET_OS_PENDING command |
Date: |
Thu, 28 Sep 2017 10:18:06 +0200 |
On Wed, 2017-09-20 at 11:47 +0200, Cédric Le Goater wrote:
> > > @@ -162,7 +162,14 @@ static bool spapr_xive_tm_is_readonly(uint8_t index)
> > > static void spapr_xive_tm_write_special(ICPState *icp, hwaddr offset,
> > > uint64_t value, unsigned size)
> > > {
> > > - /* TODO: support TM_SPC_SET_OS_PENDING */
> > > + if (offset == TM_SPC_SET_OS_PENDING && size == 1) {
> > > + icp->tima_os[TM_IPB] |= priority_to_ipb(value & 0xff);
> > > + icp->tima_os[TM_PIPR] = ipb_to_pipr(icp->tima_os[TM_IPB]);
> >
> > This only lets the cpu raise bits in the IPB, never clear them.> Is that
> > right?
>
> The clear is done when the OS acks the interrupt.
>
> > I don't see how you'd implement the handling of multiple
> > priorities without being able to clear bits here.
>
> I am not sure how this command should be used from the OS.
> Currently, I only see KVM handling it in the XICS/XIVE glue.
> I need to take a closer look.
It's a way to avoid the SW replay on EOI.
IE, assume you have 2 interrupts in the queue. You take the exception,
ack the first one, process it etc...
Then you EOI, the HW won't send a second notification. You need to look
at the queue and continue consuming until it's empty.
Today Linux checks the queue on EOI and use a SW mechanism to
synthetize a new pseudo-external interrupt.
This MMIO command would allow the OS to instead set back the
corresponding priority bit to 1 in the IPB and cause the HW to re-emit
the interrupt instead of SW.
Linux doesn't use this today because DD1 didn't support it for the HV
level, but other OSes might and we also might use it when we do groups,
thus allowing redistribution.
Cheers,
Ben.
[Qemu-devel] [RFC PATCH v2 15/21] spapr: modify spapr_populate_pci_dt() to use a 'nr_irqs' argument, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 16/21] spapr: add a XIVE object to the sPAPR machine, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 17/21] ppc/xive: add hcalls support, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 18/21] ppc/xive: add device tree support, Cédric Le Goater, 2017/09/11