Skip to content

In-kernel XICS interrupt controller emulation

Paul Mackerras kvm kvm-ppc 3 versions – In review

Get series with b4
b4 am 20130418062926.GA25033@drongo

Versions newest first · linked by author and title

  1. v5 Latest8 patches 8 repliesIn review
  2. v48 patches 1 replySuperseded
  3. v19 patches 22 repliesApplied

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8KVM: PPC: Book3S: Add infrastructure to implement kernel-side RTAS callsDocumentation/virtual/kvm/api.txt arch/powerpc/include/asm/hvcall.h arch/powerpc/include/asm/kvm_host.h +9 more+252 -10 replies
2/8KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controllerarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h arch/powerpc/include/asm/kvm_ppc.h +9 more+1192 -20 replies
3/8KVM: PPC: Book3S HV: Speed up wakeups of CPUs on HV KVMarch/powerpc/include/asm/kvm_book3s_asm.h arch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kernel/asm-offsets.c +4 more+158 -190 replies
4/8KVM: PPC: Book3S HV: Add support for real mode ICP in XICS emulationarch/powerpc/kvm/Makefile arch/powerpc/kvm/book3s_hv_rm_xics.c arch/powerpc/kvm/book3s_hv_rmhandlers.S +2 more+490 -190 replies
5/8KVM: PPC: Book3S HV: Improve real-mode handling of external interruptsarch/powerpc/include/asm/reg.h arch/powerpc/kvm/book3s_hv.c arch/powerpc/kvm/book3s_hv_rmhandlers.S+80 -640 replies
6/8KVM: PPC: Book3S: Add support for ibm,int-on/off RTAS callsarch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s_rtas.c arch/powerpc/kvm/book3s_xics.c +1 more+113 -150 replies
7/8KVM: PPC: Book3S: Facilities to save/restore XICS presentation ctrler stateDocumentation/virtual/kvm/api.txt arch/powerpc/include/asm/kvm_ppc.h arch/powerpc/include/uapi/asm/kvm.h +2 more+124 -00 replies
8/8KVM: PPC: Book 3S: Add API for in-kernel XICS emulationDocumentation/virtual/kvm/api.txt Documentation/virtual/kvm/devices/xics.txt arch/powerpc/include/asm/kvm_ppc.h +7 more+339 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/8] In-kernel XICS interrupt controller emulation

This is a repost of my patch series implementing in-kernel emulation of the XICS interrupt controller architecture defined in PAPR (Power Architecture Platform Requirements, the document that defines IBM's pSeries platform architecture). This version of the patch series uses the latest device API as posted by Scott Wood, that is, i.e., the version where the core device code provides the file descriptor and ioctl handler. I have structured the series so that the API is added by the last two patches, so as to be able to accommodate any future revisions to the device API with minimal changes.

The series is based on Alex Graf's kvm-ppc-queue branch with Scott Wood's recent patch series applied on top, together with the patch below to allow it to build with CONFIG_KVM_MPIC=n.

The API defined here uses KVM_CREATE_DEVICE to create the XICS, KVM_DEVICE_SET_ATTR/KVM_DEVICE_GET_ATTR to manipulate the interrupt sources (for initialization and migration), a new KVM_CAP_IRQ_XICS capability to connect vcpus to the XICS, a new identifier KVM_REG_PPC_ICP_STATE for the one-reg interface to get and set per-vcpu state, and the existing KVM_IRQ_LINE ioctl to assert and deassert interrupt sources.

This version also cleans up some checkpatch.pl errors and clarifies the lifetime rules for the various objects. There are two checkpatch warnings for long lines, but they are long because they have long strings in them, and if I break the strings over two lines then checkpatch warns about that.

Paul.

arch/powerpc/kvm/powerpc.c +2 -0
index 1d3888b..bd41eea 100644
@@ -466,9 +466,11 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
 	kvmppc_remove_vcpu_debugfs(vcpu);
 
 	switch (vcpu->arch.irq_type) {
+#ifdef CONFIG_KVM_MPIC
 	case KVMPPC_IRQ_MPIC:
 		kvmppc_mpic_disconnect_vcpu(vcpu->arch.mpic, vcpu);
 		break;
+#endif
 	}
 
 	kvmppc_core_vcpu_free(vcpu);