diff mbox

[1/4] kvm: Update headers for device control api

Message ID 1377286862-5879-2-git-send-email-christoffer.dall@linaro.org
State New
Headers show

Commit Message

Christoffer Dall Aug. 23, 2013, 7:40 p.m. UTC
Update the KVM kernel headers to add support for the device control API
on ARM used to create in-kernel devices and set and get attributes on
these.

This is needed for VGIC save/restore with KVM ARM targets.

Headers are included from:
git://git.linaro.org/people/cdall/linux-kvm-arm.git vgic-migrate

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 linux-headers/asm-arm/kvm.h |    8 ++++++++
 linux-headers/linux/kvm.h   |    1 +
 2 files changed, 9 insertions(+)

Comments

Peter Maydell Aug. 24, 2013, 10:31 a.m. UTC | #1
On 23 August 2013 20:40, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> Update the KVM kernel headers to add support for the device control API
> on ARM used to create in-kernel devices and set and get attributes on
> these.
>
> This is needed for VGIC save/restore with KVM ARM targets.
>
> Headers are included from:
> git://git.linaro.org/people/cdall/linux-kvm-arm.git vgic-migrate

NB: this makes this an "RFC" patchset because we can't apply
it until the kernel headers have been accepted upstream.

-- PMM
diff mbox

Patch

diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h
index c1ee007..587f1ae 100644
--- a/linux-headers/asm-arm/kvm.h
+++ b/linux-headers/asm-arm/kvm.h
@@ -142,6 +142,14 @@  struct kvm_arch_memory_slot {
 #define KVM_REG_ARM_VFP_FPINST		0x1009
 #define KVM_REG_ARM_VFP_FPINST2		0x100A
 
+/* Device Control API: ARM VGIC */
+#define KVM_DEV_ARM_VGIC_GRP_ADDR	0
+#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS	1
+#define KVM_DEV_ARM_VGIC_GRP_CPU_REGS	2
+#define   KVM_DEV_ARM_VGIC_CPUID_SHIFT	32
+#define   KVM_DEV_ARM_VGIC_CPUID_MASK	(0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT)
+#define   KVM_DEV_ARM_VGIC_OFFSET_SHIFT	0
+#define   KVM_DEV_ARM_VGIC_OFFSET_MASK	(0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT)
 
 /* KVM_IRQ_LINE irq field index values */
 #define KVM_ARM_IRQ_TYPE_SHIFT		24
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index c614070..7f66a4f 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -839,6 +839,7 @@  struct kvm_device_attr {
 #define KVM_DEV_TYPE_FSL_MPIC_20	1
 #define KVM_DEV_TYPE_FSL_MPIC_42	2
 #define KVM_DEV_TYPE_XICS		3
+#define KVM_DEV_TYPE_ARM_VGIC_V2	4
 
 /*
  * ioctls for VM fds