From: Christoffer Dall <c.dall@virtualopensystems.com>
To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Cc: peter.maydell@linaro.org, marc.zyngier@arm.com,
Christoffer Dall <c.dall@virtualopensystems.com>
Subject: [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl
Date: Sat, 13 Oct 2012 20:04:23 -0400 [thread overview]
Message-ID: <1350173065-35350-2-git-send-email-c.dall@virtualopensystems.com> (raw)
In-Reply-To: <1350173065-35350-1-git-send-email-c.dall@virtualopensystems.com>
Used to initialize the in-kernel interrupt controller. On ARM we need to
map the virtual generic interrupt controller (vGIC) into Hyp the guest's
physicall address space so the guest can access the virtual cpu
interface. This must be done after the IRQ chips is create and after a
base address has been provided for the emulated platform (patch is
following), but before the CPU is initally run.
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
---
Documentation/virtual/kvm/api.txt | 16 ++++++++++++++++
arch/arm/kvm/arm.c | 1 +
include/linux/kvm.h | 3 +++
3 files changed, 20 insertions(+)
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 25eacc6..26e953d 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -2102,6 +2102,22 @@ This ioctl returns the guest registers that are supported for the
KVM_GET_ONE_REG/KVM_SET_ONE_REG calls.
+4.79 KVM_INIT_IRQCHIP
+
+Capability: KVM_CAP_INIT_IRQCHIP
+Architectures: arm
+Type: vm ioctl
+Parameters: none
+Returns: 0 on success, -1 on error
+
+Initialize the in-kernel interrupt controller. On ARM we need to map the
+virtual generic interrupt controller (vGIC) into Hyp the guest's physicall
+address space so the guest can access the virtual cpu interface. This must be
+done after the IRQ chips is create and after a base address has been provided
+for the emulated platofrm (see KVM_SET_DEVICE_ADDRESS), but before the CPU is
+initally run.
+
+
5. The kvm_run structure
------------------------
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index f8c377b..85c76e4 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -195,6 +195,7 @@ int kvm_dev_ioctl_check_extension(long ext)
switch (ext) {
#ifdef CONFIG_KVM_ARM_VGIC
case KVM_CAP_IRQCHIP:
+ case KVM_CAP_INIT_IRQCHIP:
r = vgic_present;
break;
#endif
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 8091b1d..90ee023 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -626,6 +626,7 @@ struct kvm_ppc_smmu_info {
#ifdef __KVM_HAVE_READONLY_MEM
#define KVM_CAP_READONLY_MEM 81
#endif
+#define KVM_CAP_INIT_IRQCHIP 82
#ifdef KVM_CAP_IRQ_ROUTING
@@ -839,6 +840,8 @@ struct kvm_s390_ucas_mapping {
#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
/* Available with KVM_CAP_PPC_ALLOC_HTAB */
#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
+/* Available with KVM_CAP_INIT_IRQCHIP */
+#define KVM_INIT_IRQCHIP _IO(KVMIO, 0xa8)
/*
* ioctls for vcpu fds
--
1.7.9.5
next prev parent reply other threads:[~2012-10-14 0:04 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-14 0:04 [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses Christoffer Dall
2012-10-14 0:04 ` Christoffer Dall [this message]
2012-10-17 20:21 ` [RFC PATCH 1/3] KVM: ARM: Introduce KVM_INIT_IRQCHIP ioctl Peter Maydell
2012-10-17 20:23 ` Christoffer Dall
2012-10-17 20:31 ` Peter Maydell
2012-10-17 20:39 ` Christoffer Dall
2012-10-18 12:20 ` Avi Kivity
2012-10-19 18:42 ` Christoffer Dall
2012-10-14 0:04 ` [RFC PATCH 2/3] KVM: ARM: Introduce KVM_SET_DEVICE_ADDRESS ioctl Christoffer Dall
2012-10-17 20:29 ` Peter Maydell
2012-10-19 18:46 ` Christoffer Dall
2012-10-19 20:24 ` Peter Maydell
2012-10-19 20:27 ` Christoffer Dall
2012-10-19 20:33 ` Christoffer Dall
2012-10-14 0:04 ` [RFC PATCH 3/3] KVM: ARM: Split KVM_CREATE_IRQCHIP and KVM_INIT_IRQCHIP Christoffer Dall
2012-10-18 11:15 ` Peter Maydell
2012-10-17 20:38 ` [kvmarm] [RFC PATCH 0/3] KVM: ARM: Get rid of hardcoded VGIC addresses Alexander Graf
2012-10-17 20:39 ` Christoffer Dall
2012-10-17 21:19 ` Benjamin Herrenschmidt
2012-10-17 22:10 ` Paul Mackerras
2012-10-17 23:58 ` Benjamin Herrenschmidt
2012-10-18 13:48 ` Christoffer Dall
2012-10-18 13:49 ` Alexander Graf
2012-10-18 15:25 ` Avi Kivity
2012-10-23 10:48 ` Jan Kiszka
2012-10-23 10:52 ` Peter Maydell
2012-10-23 11:00 ` Jan Kiszka
2012-10-23 11:04 ` Peter Maydell
2012-10-23 11:08 ` Jan Kiszka
2012-10-24 0:50 ` Paul Mackerras
2012-10-25 11:57 ` Jan Kiszka
2012-10-25 16:14 ` Paolo Bonzini
2012-10-25 16:32 ` Jan Kiszka
2012-10-25 18:27 ` Paolo Bonzini
2012-10-25 19:40 ` Benjamin Herrenschmidt
2012-10-26 9:58 ` Paolo Bonzini
2012-10-26 10:09 ` Peter Maydell
2012-10-26 10:15 ` Paolo Bonzini
2012-10-26 10:22 ` Jan Kiszka
2012-10-26 10:44 ` Benjamin Herrenschmidt
2012-10-26 11:00 ` Jan Kiszka
2012-10-26 11:09 ` Benjamin Herrenschmidt
2012-10-26 11:57 ` Paolo Bonzini
2012-10-26 12:08 ` Peter Maydell
2012-10-26 12:41 ` Jan Kiszka
2012-10-26 20:21 ` Benjamin Herrenschmidt
2012-10-26 11:17 ` Peter Maydell
2012-10-26 11:39 ` Benjamin Herrenschmidt
2012-10-26 12:39 ` Jan Kiszka
2012-10-26 20:45 ` Benjamin Herrenschmidt
2012-10-26 22:03 ` Benjamin Herrenschmidt
2012-10-27 8:06 ` Jan Kiszka
2012-10-27 10:01 ` Peter Maydell
2012-10-28 22:19 ` Benjamin Herrenschmidt
2012-10-26 10:37 ` Benjamin Herrenschmidt
2012-10-26 10:40 ` Paolo Bonzini
2012-10-26 10:47 ` Benjamin Herrenschmidt
2012-10-26 11:47 ` Paolo Bonzini
2012-10-25 19:39 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350173065-35350-2-git-send-email-c.dall@virtualopensystems.com \
--to=c.dall@virtualopensystems.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=marc.zyngier@arm.com \
--cc=peter.maydell@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).