diff options
author | Li Zhong <zhong@linux.vnet.ibm.com> | 2016-11-11 05:57:35 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2017-01-27 00:27:02 +0100 |
commit | 17d48610ae0fa218aa386b16a538c792991a3652 (patch) | |
tree | 344f26e281c3111d92f1a43c20cce00fd8739eb7 /arch/powerpc/kvm/book3s_xics.h | |
parent | KVM: PPC: Book 3S: XICS: Fix potential issue with duplicate IRQ resends (diff) | |
download | linux-17d48610ae0fa218aa386b16a538c792991a3652.tar.xz linux-17d48610ae0fa218aa386b16a538c792991a3652.zip |
KVM: PPC: Book 3S: XICS: Implement ICS P/Q states
This patch implements P(Presented)/Q(Queued) states for ICS irqs.
When the interrupt is presented, set P. Present if P was not set.
If P is already set, don't present again, set Q.
When the interrupt is EOI'ed, move Q into P (and clear Q). If it is
set, re-present.
The asserted flag used by LSI is also incorporated into the P bit.
When the irq state is saved, P/Q bits are also saved, they need some
qemu modifications to be recognized and passed around to be restored.
KVM_XICS_PENDING bit set and saved should also indicate
KVM_XICS_PRESENTED bit set and saved. But it is possible some old
code doesn't have/recognize the P bit, so when we restore, we set P
for PENDING bit, too.
The idea and much of the code come from Ben.
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_xics.h')
-rw-r--r-- | arch/powerpc/kvm/book3s_xics.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_xics.h b/arch/powerpc/kvm/book3s_xics.h index 1d5fac80b706..ec5474cf70c6 100644 --- a/arch/powerpc/kvm/book3s_xics.h +++ b/arch/powerpc/kvm/book3s_xics.h @@ -31,16 +31,19 @@ /* Priority value to use for disabling an interrupt */ #define MASKED 0xff +#define PQ_PRESENTED 1 +#define PQ_QUEUED 2 + /* State for one irq source */ struct ics_irq_state { u32 number; u32 server; + u32 pq_state; u8 priority; u8 saved_priority; u8 resend; u8 masked_pending; u8 lsi; /* level-sensitive interrupt */ - u8 asserted; /* Only for LSI */ u8 exists; int intr_cpu; u32 host_irq; |