KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controller
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 17 Apr 2013 20:30:26 +0000 (20:30 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 26 Apr 2013 18:27:30 +0000 (20:27 +0200)
commitbc5ad3f3701116e7db57268e6f89010ec714697e
tree21a00d1213598eab4dc0ae3fb03bb7ba3344185a
parent8e591cb7204739efa8e15967ea334eb367039dde
KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controller

This adds in-kernel emulation of the XICS (eXternal Interrupt
Controller Specification) interrupt controller specified by PAPR, for
both HV and PR KVM guests.

The XICS emulation supports up to 1048560 interrupt sources.
Interrupt source numbers below 16 are reserved; 0 is used to mean no
interrupt and 2 is used for IPIs.  Internally these are represented in
blocks of 1024, called ICS (interrupt controller source) entities, but
that is not visible to userspace.

Each vcpu gets one ICP (interrupt controller presentation) entity,
used to store the per-vcpu state such as vcpu priority, pending
interrupt state, IPI request, etc.

This does not include any API or any way to connect vcpus to their
ICP state; that will be added in later patches.

This is based on an initial implementation by Michael Ellerman
<michael@ellerman.id.au> reworked by Benjamin Herrenschmidt and
Paul Mackerras.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
[agraf: fix typo, add dependency on !KVM_MPIC]
Signed-off-by: Alexander Graf <agraf@suse.de>
12 files changed:
arch/powerpc/include/asm/kvm_book3s.h
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/Kconfig
arch/powerpc/kvm/Makefile
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_pr_papr.c
arch/powerpc/kvm/book3s_rtas.c
arch/powerpc/kvm/book3s_xics.c [new file with mode: 0644]
arch/powerpc/kvm/book3s_xics.h [new file with mode: 0644]
arch/powerpc/kvm/powerpc.c