Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de9ba2f3 authored by Alexander Graf's avatar Alexander Graf
Browse files

KVM: PPC: Support irq routing and irqfd for in-kernel MPIC



Now that all the irq routing and irqfd pieces are generic, we can expose
real irqchip support to all of KVM's internal helpers.

This allows us to use irqfd with the in-kernel MPIC.

Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent eb1e4f43
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -35,3 +35,22 @@ Groups:

    "attr" is the IRQ number.  IRQ numbers for standard sources are the
    byte offset of the relevant IVPR from EIVPR0, divided by 32.

IRQ Routing:

  The MPIC emulation supports IRQ routing. Only a single MPIC device can
  be instantiated. Once that device has been created, it's available as
  irqchip id 0.

  This irqchip 0 has 256 interrupt pins, which expose the interrupts in
  the main array of interrupt sources (a.k.a. "SRC" interrupts).

  The numbering is the same as the MPIC device tree binding -- based on
  the register offset from the beginning of the sources array, without
  regard to any subdivisions in chip documentation such as "internal"
  or "external" interrupts.

  Default routes are established for these pins, with the GSI being equal
  to the pin number.

  Access to non-SRC interrupts is not implemented through IRQ routing mechanisms.
+7 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
#endif

/* These values are internal and can be increased later */
#define KVM_NR_IRQCHIPS          1
#define KVM_IRQCHIP_NUM_PINS     256

#if !defined(CONFIG_KVM_440)
#include <linux/mmu_notifier.h>

@@ -256,6 +260,9 @@ struct kvm_arch {
#ifdef CONFIG_PPC_BOOK3S_64
	struct list_head spapr_tce_tables;
#endif
#ifdef CONFIG_KVM_MPIC
	struct openpic *mpic;
#endif
};

/*
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
/* Select powerpc specific features in <linux/kvm.h> */
#define __KVM_HAVE_SPAPR_TCE
#define __KVM_HAVE_PPC_SMT
#define __KVM_HAVE_IRQCHIP

struct kvm_regs {
	__u64 pc;
+3 −0
Original line number Diff line number Diff line
@@ -154,6 +154,9 @@ config KVM_E500MC
config KVM_MPIC
	bool "KVM in-kernel MPIC emulation"
	depends on KVM
	select HAVE_KVM_IRQCHIP
	select HAVE_KVM_IRQ_ROUTING
	select HAVE_KVM_MSI
	help
	  Enable support for emulating MPIC devices inside the
          host kernel, rather than relying on userspace to emulate.
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ kvm-book3s_32-objs := \
kvm-objs-$(CONFIG_KVM_BOOK3S_32) := $(kvm-book3s_32-objs)

kvm-objs-$(CONFIG_KVM_MPIC) += mpic.o
kvm-objs-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(addprefix ../../../virt/kvm/, irqchip.o)

kvm-objs := $(kvm-objs-m) $(kvm-objs-y)

Loading