qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 10/25] spapr: add MMIO handlers for the XIVE int


From: Benjamin Herrenschmidt
Subject: Re: [Qemu-devel] [PATCH 10/25] spapr: add MMIO handlers for the XIVE interrupt sources
Date: Sat, 02 Dec 2017 08:23:44 -0600

On Tue, 2017-11-28 at 17:38 +1100, David Gibson wrote:
> Hrm.  I don't love that you're dealing with clearing that LSI bit
> here, but setting it at a different level.
> 
> The state machines are doing my head in a bit, is there any way
> you could derive the STATUS_SENT bit from the PQ bits?

Yeah it should be...

So you should normally need only one extra bit of state for LSI which
is whether it's asserted or not and no extra bit of state for MSIs.

P is basically "sent". Q is whether another event has been queued up
(and is only meaningful for MSIs though the 01 combination will mask
LSIs too).

The state logic should be for MSIs on event:

        - if PQ=01 ignore (masked)
        - if P=1, set Q and finish
        - set P=1 and forward event to IVE

For EOI (load and store):

        - if PQ=01 ignore
        - P=Q, Q=0
        - (storeEOI only) if new P=1, forward event to IVE
 
For LSIs, and "event" is whenever the state is asserted, and Q is
meaningless, so basically on every change of state or ESB:

        - if PQ=01 ignore (masked)
        - if P=1 finish
        - set P=1 and forward event to IVE

For EOI (load and store):

        - if PQ=01 ignore
        - clear P
        - re-evaluate as above if asserted

Cheers,
Ben.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]