diff mbox

linux-headers: update to 3.18-rc5

Message ID 1416248898-6302-1-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit 444b1996cb3769d8636b223c281fb09ab89b7a31
Headers show

Commit Message

Ard Biesheuvel Nov. 17, 2014, 6:28 p.m. UTC
This updates the Linux header to version 3.18-rc5, adding support for
(among other things) read-only memslots on ARM and arm64.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 linux-headers/asm-arm/kvm.h     |  2 ++
 linux-headers/asm-arm64/kvm.h   |  2 ++
 linux-headers/asm-powerpc/kvm.h |  6 ++++++
 linux-headers/asm-s390/kvm.h    | 10 ++++++++++
 linux-headers/linux/kvm.h       | 28 +++++++++++++++++-----------
 linux-headers/linux/vfio.h      |  3 +++
 6 files changed, 40 insertions(+), 11 deletions(-)

Comments

Peter Maydell Nov. 17, 2014, 6:32 p.m. UTC | #1
On 17 November 2014 18:28, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> This updates the Linux header to version 3.18-rc5, adding support for
> (among other things) read-only memslots on ARM and arm64.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

So, to be clear, the idea is that this should go into 2.2 because
it (effectively) fixes a bug where running from emulated flash
devices under KVM/ARM doesn't work?

A KVM header update seems pretty safe to me; cc'ing Paolo
as KVM maintainer to ack/nak it.

thanks
-- PMM
Ard Biesheuvel Nov. 17, 2014, 7:01 p.m. UTC | #2
On 17 November 2014 19:32, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 17 November 2014 18:28, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> This updates the Linux header to version 3.18-rc5, adding support for
>> (among other things) read-only memslots on ARM and arm64.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> So, to be clear, the idea is that this should go into 2.2 because
> it (effectively) fixes a bug where running from emulated flash
> devices under KVM/ARM doesn't work?
>

To be perfectly honest: the support itself for readonly memslots under
ARM/arm64 only landed in 3.18.
However, the incorrect conditional #define of KVM_CAP_READONLY_MEM
(i.e., only if __KVM_HAVE_READONLY_MEM is defined) that interferes
with the capability detection is also fixed with this header update,
and /that/ is arguably a bugfix in itself. With that in place, QEMU is
able to correctly decide at runtime whether to use readonly memslots
or not.

> A KVM header update seems pretty safe to me; cc'ing Paolo
> as KVM maintainer to ack/nak it.
>

Regards,
Ard.
Paolo Bonzini Nov. 18, 2014, 5:19 a.m. UTC | #3
On 17/11/2014 19:32, Peter Maydell wrote:
> On 17 November 2014 18:28, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> This updates the Linux header to version 3.18-rc5, adding support for
>> (among other things) read-only memslots on ARM and arm64.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> So, to be clear, the idea is that this should go into 2.2 because
> it (effectively) fixes a bug where running from emulated flash
> devices under KVM/ARM doesn't work?
> 
> A KVM header update seems pretty safe to me; cc'ing Paolo
> as KVM maintainer to ack/nak it.

Sure, this is a good time (kernel-wise) to update headers.  And if it
fixes a bug, it's acceptable for hard freeze.

Paolo
Peter Maydell Nov. 18, 2014, 12:28 p.m. UTC | #4
On 18 November 2014 05:19, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 17/11/2014 19:32, Peter Maydell wrote:
>> On 17 November 2014 18:28, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>> This updates the Linux header to version 3.18-rc5, adding support for
>>> (among other things) read-only memslots on ARM and arm64.
>>>
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>
>> So, to be clear, the idea is that this should go into 2.2 because
>> it (effectively) fixes a bug where running from emulated flash
>> devices under KVM/ARM doesn't work?
>>
>> A KVM header update seems pretty safe to me; cc'ing Paolo
>> as KVM maintainer to ack/nak it.
>
> Sure, this is a good time (kernel-wise) to update headers.  And if it
> fixes a bug, it's acceptable for hard freeze.

OK; applied to master.

thanks
-- PMM
diff mbox

Patch

diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h
index e6ebdd3471e5..09ee408c1a67 100644
--- a/linux-headers/asm-arm/kvm.h
+++ b/linux-headers/asm-arm/kvm.h
@@ -25,6 +25,7 @@ 
 
 #define __KVM_HAVE_GUEST_DEBUG
 #define __KVM_HAVE_IRQ_LINE
+#define __KVM_HAVE_READONLY_MEM
 
 #define KVM_REG_SIZE(id)						\
 	(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
@@ -173,6 +174,7 @@  struct kvm_arch_memory_slot {
 #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)
+#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS	3
 
 /* KVM_IRQ_LINE irq field index values */
 #define KVM_ARM_IRQ_TYPE_SHIFT		24
diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h
index e633ff8cdec8..8e38878c87c6 100644
--- a/linux-headers/asm-arm64/kvm.h
+++ b/linux-headers/asm-arm64/kvm.h
@@ -37,6 +37,7 @@ 
 
 #define __KVM_HAVE_GUEST_DEBUG
 #define __KVM_HAVE_IRQ_LINE
+#define __KVM_HAVE_READONLY_MEM
 
 #define KVM_REG_SIZE(id)						\
 	(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
@@ -159,6 +160,7 @@  struct kvm_arch_memory_slot {
 #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)
+#define KVM_DEV_ARM_VGIC_GRP_NR_IRQS	3
 
 /* KVM_IRQ_LINE irq field index values */
 #define KVM_ARM_IRQ_TYPE_SHIFT		24
diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h
index e0e49dbb145d..ab4d4732c492 100644
--- a/linux-headers/asm-powerpc/kvm.h
+++ b/linux-headers/asm-powerpc/kvm.h
@@ -476,6 +476,11 @@  struct kvm_get_htab_header {
 
 /* FP and vector status/control registers */
 #define KVM_REG_PPC_FPSCR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x80)
+/*
+ * VSCR register is documented as a 32-bit register in the ISA, but it can
+ * only be accesses via a vector register. Expose VSCR as a 32-bit register
+ * even though the kernel represents it as a 128-bit vector.
+ */
 #define KVM_REG_PPC_VSCR	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x81)
 
 /* Virtual processor areas */
@@ -557,6 +562,7 @@  struct kvm_get_htab_header {
 #define KVM_REG_PPC_DABRX	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8)
 #define KVM_REG_PPC_WORT	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9)
 #define KVM_REG_PPC_SPRG9	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
+#define KVM_REG_PPC_DBSR	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb)
 
 /* Transactional Memory checkpointed state:
  * This is all GPRs, all VSX regs and a subset of SPRs
diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h
index 98bedf3c18d8..d36b2fa10d9a 100644
--- a/linux-headers/asm-s390/kvm.h
+++ b/linux-headers/asm-s390/kvm.h
@@ -111,12 +111,22 @@  struct kvm_guest_debug_arch {
 #define KVM_SYNC_GPRS   (1UL << 1)
 #define KVM_SYNC_ACRS   (1UL << 2)
 #define KVM_SYNC_CRS    (1UL << 3)
+#define KVM_SYNC_ARCH0  (1UL << 4)
+#define KVM_SYNC_PFAULT (1UL << 5)
 /* definition of registers in kvm_run */
 struct kvm_sync_regs {
 	__u64 prefix;	/* prefix register */
 	__u64 gprs[16];	/* general purpose registers */
 	__u32 acrs[16];	/* access registers */
 	__u64 crs[16];	/* control registers */
+	__u64 todpr;	/* tod programmable register [ARCH0] */
+	__u64 cputm;	/* cpu timer [ARCH0] */
+	__u64 ckc;	/* clock comparator [ARCH0] */
+	__u64 pp;	/* program parameter [ARCH0] */
+	__u64 gbea;	/* guest breaking-event address [ARCH0] */
+	__u64 pft;	/* pfault token [PFAULT] */
+	__u64 pfs;	/* pfault select [PFAULT] */
+	__u64 pfc;	/* pfault compare [PFAULT] */
 };
 
 #define KVM_REG_S390_TODPR	(KVM_REG_S390 | KVM_REG_SIZE_U32 | 0x1)
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index 266993879eac..12045a11c036 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -654,9 +654,7 @@  struct kvm_ppc_smmu_info {
 #endif
 /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
 #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
-#ifdef __KVM_HAVE_USER_NMI
 #define KVM_CAP_USER_NMI 22
-#endif
 #ifdef __KVM_HAVE_GUEST_DEBUG
 #define KVM_CAP_SET_GUEST_DEBUG 23
 #endif
@@ -738,9 +736,7 @@  struct kvm_ppc_smmu_info {
 #define KVM_CAP_PPC_GET_SMMU_INFO 78
 #define KVM_CAP_S390_COW 79
 #define KVM_CAP_PPC_ALLOC_HTAB 80
-#ifdef __KVM_HAVE_READONLY_MEM
 #define KVM_CAP_READONLY_MEM 81
-#endif
 #define KVM_CAP_IRQFD_RESAMPLE 82
 #define KVM_CAP_PPC_BOOKE_WATCHDOG 83
 #define KVM_CAP_PPC_HTAB_FD 84
@@ -947,15 +943,25 @@  struct kvm_device_attr {
 	__u64	addr;		/* userspace address of attr data */
 };
 
-#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_VFIO		4
 #define  KVM_DEV_VFIO_GROUP			1
 #define   KVM_DEV_VFIO_GROUP_ADD			1
 #define   KVM_DEV_VFIO_GROUP_DEL			2
-#define KVM_DEV_TYPE_ARM_VGIC_V2	5
-#define KVM_DEV_TYPE_FLIC		6
+
+enum kvm_device_type {
+	KVM_DEV_TYPE_FSL_MPIC_20	= 1,
+#define KVM_DEV_TYPE_FSL_MPIC_20	KVM_DEV_TYPE_FSL_MPIC_20
+	KVM_DEV_TYPE_FSL_MPIC_42,
+#define KVM_DEV_TYPE_FSL_MPIC_42	KVM_DEV_TYPE_FSL_MPIC_42
+	KVM_DEV_TYPE_XICS,
+#define KVM_DEV_TYPE_XICS		KVM_DEV_TYPE_XICS
+	KVM_DEV_TYPE_VFIO,
+#define KVM_DEV_TYPE_VFIO		KVM_DEV_TYPE_VFIO
+	KVM_DEV_TYPE_ARM_VGIC_V2,
+#define KVM_DEV_TYPE_ARM_VGIC_V2	KVM_DEV_TYPE_ARM_VGIC_V2
+	KVM_DEV_TYPE_FLIC,
+#define KVM_DEV_TYPE_FLIC		KVM_DEV_TYPE_FLIC
+	KVM_DEV_TYPE_MAX,
+};
 
 /*
  * ioctls for VM fds
@@ -1093,7 +1099,7 @@  struct kvm_s390_ucas_mapping {
 #define KVM_S390_INITIAL_RESET    _IO(KVMIO,   0x97)
 #define KVM_GET_MP_STATE          _IOR(KVMIO,  0x98, struct kvm_mp_state)
 #define KVM_SET_MP_STATE          _IOW(KVMIO,  0x99, struct kvm_mp_state)
-/* Available with KVM_CAP_NMI */
+/* Available with KVM_CAP_USER_NMI */
 #define KVM_NMI                   _IO(KVMIO,   0x9a)
 /* Available with KVM_CAP_SET_GUEST_DEBUG */
 #define KVM_SET_GUEST_DEBUG       _IOW(KVMIO,  0x9b, struct kvm_guest_debug)
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index 95b591b61a7d..0f21aa6266cf 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -33,6 +33,9 @@ 
 /* Check if EEH is supported */
 #define VFIO_EEH			5
 
+/* Two-stage IOMMU */
+#define VFIO_TYPE1_NESTING_IOMMU	6	/* Implies v2 */
+
 /*
  * The IOCTL interface is designed for extensibility by embedding the
  * structure length (argsz) and flags into structures passed between