cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From 203e2f3b71821558653d08bbd90ee493396ec1a6 Mon Sep 17 00:00:00 2001
218e99
From: Nigel Croxon <ncroxon@redhat.com>
218e99
Date: Tue, 6 Aug 2013 19:52:03 +0200
218e99
Subject: linux-headers: Update to v3.10-rc5
218e99
218e99
RH-Author: Nigel Croxon <ncroxon@redhat.com>
218e99
Message-id: <1375818724-41239-2-git-send-email-ncroxon@redhat.com>
218e99
Patchwork-id: 53016
218e99
O-Subject: [RHEL7.0 qemu-kvm PATCH v2 1/2] linux-headers: Update to v3.10-rc5
218e99
Bugzilla: 984604
218e99
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
218e99
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
218e99
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
218e99
From: Alexey Kardashevskiy <aik@ozlabs.ru>
218e99
218e99
This adds symbols required for PPC64 pseries platform features:
218e99
1. sPAPR live migration;
218e99
2. in-kernel XICS interrupt controller.
218e99
218e99
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
218e99
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
218e99
(cherry picked from commit e098b45386a86fecc1e573d305a240a2f4aa461d)
218e99
218e99
diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h
218e99
index 023bfeb..c1ee007 100644
218e99
--- a/linux-headers/asm-arm/kvm.h
218e99
+++ b/linux-headers/asm-arm/kvm.h
218e99
@@ -53,12 +53,12 @@
218e99
 #define KVM_ARM_FIQ_spsr	fiq_regs[7]
218e99
 
218e99
 struct kvm_regs {
218e99
-	struct pt_regs usr_regs;/* R0_usr - R14_usr, PC, CPSR */
218e99
-	__u32 svc_regs[3];	/* SP_svc, LR_svc, SPSR_svc */
218e99
-	__u32 abt_regs[3];	/* SP_abt, LR_abt, SPSR_abt */
218e99
-	__u32 und_regs[3];	/* SP_und, LR_und, SPSR_und */
218e99
-	__u32 irq_regs[3];	/* SP_irq, LR_irq, SPSR_irq */
218e99
-	__u32 fiq_regs[8];	/* R8_fiq - R14_fiq, SPSR_fiq */
218e99
+	struct pt_regs usr_regs;	/* R0_usr - R14_usr, PC, CPSR */
218e99
+	unsigned long svc_regs[3];	/* SP_svc, LR_svc, SPSR_svc */
218e99
+	unsigned long abt_regs[3];	/* SP_abt, LR_abt, SPSR_abt */
218e99
+	unsigned long und_regs[3];	/* SP_und, LR_und, SPSR_und */
218e99
+	unsigned long irq_regs[3];	/* SP_irq, LR_irq, SPSR_irq */
218e99
+	unsigned long fiq_regs[8];	/* R8_fiq - R14_fiq, SPSR_fiq */
218e99
 };
218e99
 
218e99
 /* Supported Processor Types */
218e99
diff --git a/linux-headers/asm-mips/kvm.h b/linux-headers/asm-mips/kvm.h
218e99
new file mode 100644
218e99
index 0000000..3f424f5
218e99
--- /dev/null
218e99
+++ b/linux-headers/asm-mips/kvm.h
218e99
@@ -0,0 +1,138 @@
218e99
+/*
218e99
+ * This file is subject to the terms and conditions of the GNU General Public
218e99
+ * License.  See the file "COPYING" in the main directory of this archive
218e99
+ * for more details.
218e99
+ *
218e99
+ * Copyright (C) 2012  MIPS Technologies, Inc.  All rights reserved.
218e99
+ * Copyright (C) 2013 Cavium, Inc.
218e99
+ * Authors: Sanjay Lal <sanjayl@kymasys.com>
218e99
+ */
218e99
+
218e99
+#ifndef __LINUX_KVM_MIPS_H
218e99
+#define __LINUX_KVM_MIPS_H
218e99
+
218e99
+#include <linux/types.h>
218e99
+
218e99
+/*
218e99
+ * KVM MIPS specific structures and definitions.
218e99
+ *
218e99
+ * Some parts derived from the x86 version of this file.
218e99
+ */
218e99
+
218e99
+/*
218e99
+ * for KVM_GET_REGS and KVM_SET_REGS
218e99
+ *
218e99
+ * If Config[AT] is zero (32-bit CPU), the register contents are
218e99
+ * stored in the lower 32-bits of the struct kvm_regs fields and sign
218e99
+ * extended to 64-bits.
218e99
+ */
218e99
+struct kvm_regs {
218e99
+	/* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
218e99
+	__u64 gpr[32];
218e99
+	__u64 hi;
218e99
+	__u64 lo;
218e99
+	__u64 pc;
218e99
+};
218e99
+
218e99
+/*
218e99
+ * for KVM_GET_FPU and KVM_SET_FPU
218e99
+ *
218e99
+ * If Status[FR] is zero (32-bit FPU), the upper 32-bits of the FPRs
218e99
+ * are zero filled.
218e99
+ */
218e99
+struct kvm_fpu {
218e99
+	__u64 fpr[32];
218e99
+	__u32 fir;
218e99
+	__u32 fccr;
218e99
+	__u32 fexr;
218e99
+	__u32 fenr;
218e99
+	__u32 fcsr;
218e99
+	__u32 pad;
218e99
+};
218e99
+
218e99
+
218e99
+/*
218e99
+ * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access CP0
218e99
+ * registers.  The id field is broken down as follows:
218e99
+ *
218e99
+ *  bits[2..0]   - Register 'sel' index.
218e99
+ *  bits[7..3]   - Register 'rd'  index.
218e99
+ *  bits[15..8]  - Must be zero.
218e99
+ *  bits[63..16] - 1 -> CP0 registers.
218e99
+ *
218e99
+ * Other sets registers may be added in the future.  Each set would
218e99
+ * have its own identifier in bits[63..16].
218e99
+ *
218e99
+ * The addr field of struct kvm_one_reg must point to an aligned
218e99
+ * 64-bit wide location.  For registers that are narrower than
218e99
+ * 64-bits, the value is stored in the low order bits of the location,
218e99
+ * and sign extended to 64-bits.
218e99
+ *
218e99
+ * The registers defined in struct kvm_regs are also accessible, the
218e99
+ * id values for these are below.
218e99
+ */
218e99
+
218e99
+#define KVM_REG_MIPS_R0 0
218e99
+#define KVM_REG_MIPS_R1 1
218e99
+#define KVM_REG_MIPS_R2 2
218e99
+#define KVM_REG_MIPS_R3 3
218e99
+#define KVM_REG_MIPS_R4 4
218e99
+#define KVM_REG_MIPS_R5 5
218e99
+#define KVM_REG_MIPS_R6 6
218e99
+#define KVM_REG_MIPS_R7 7
218e99
+#define KVM_REG_MIPS_R8 8
218e99
+#define KVM_REG_MIPS_R9 9
218e99
+#define KVM_REG_MIPS_R10 10
218e99
+#define KVM_REG_MIPS_R11 11
218e99
+#define KVM_REG_MIPS_R12 12
218e99
+#define KVM_REG_MIPS_R13 13
218e99
+#define KVM_REG_MIPS_R14 14
218e99
+#define KVM_REG_MIPS_R15 15
218e99
+#define KVM_REG_MIPS_R16 16
218e99
+#define KVM_REG_MIPS_R17 17
218e99
+#define KVM_REG_MIPS_R18 18
218e99
+#define KVM_REG_MIPS_R19 19
218e99
+#define KVM_REG_MIPS_R20 20
218e99
+#define KVM_REG_MIPS_R21 21
218e99
+#define KVM_REG_MIPS_R22 22
218e99
+#define KVM_REG_MIPS_R23 23
218e99
+#define KVM_REG_MIPS_R24 24
218e99
+#define KVM_REG_MIPS_R25 25
218e99
+#define KVM_REG_MIPS_R26 26
218e99
+#define KVM_REG_MIPS_R27 27
218e99
+#define KVM_REG_MIPS_R28 28
218e99
+#define KVM_REG_MIPS_R29 29
218e99
+#define KVM_REG_MIPS_R30 30
218e99
+#define KVM_REG_MIPS_R31 31
218e99
+
218e99
+#define KVM_REG_MIPS_HI 32
218e99
+#define KVM_REG_MIPS_LO 33
218e99
+#define KVM_REG_MIPS_PC 34
218e99
+
218e99
+/*
218e99
+ * KVM MIPS specific structures and definitions
218e99
+ *
218e99
+ */
218e99
+struct kvm_debug_exit_arch {
218e99
+	__u64 epc;
218e99
+};
218e99
+
218e99
+/* for KVM_SET_GUEST_DEBUG */
218e99
+struct kvm_guest_debug_arch {
218e99
+};
218e99
+
218e99
+/* definition of registers in kvm_run */
218e99
+struct kvm_sync_regs {
218e99
+};
218e99
+
218e99
+/* dummy definition */
218e99
+struct kvm_sregs {
218e99
+};
218e99
+
218e99
+struct kvm_mips_interrupt {
218e99
+	/* in */
218e99
+	__u32 cpu;
218e99
+	__u32 irq;
218e99
+};
218e99
+
218e99
+#endif /* __LINUX_KVM_MIPS_H */
218e99
diff --git a/linux-headers/asm-mips/kvm_para.h b/linux-headers/asm-mips/kvm_para.h
218e99
new file mode 100644
218e99
index 0000000..14fab8f
218e99
--- /dev/null
218e99
+++ b/linux-headers/asm-mips/kvm_para.h
218e99
@@ -0,0 +1 @@
218e99
+#include <asm-generic/kvm_para.h>
218e99
diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h
218e99
index ef072b1..0fb1a6e 100644
218e99
--- a/linux-headers/asm-powerpc/kvm.h
218e99
+++ b/linux-headers/asm-powerpc/kvm.h
218e99
@@ -25,6 +25,8 @@
218e99
 /* Select powerpc specific features in <linux/kvm.h> */
218e99
 #define __KVM_HAVE_SPAPR_TCE
218e99
 #define __KVM_HAVE_PPC_SMT
218e99
+#define __KVM_HAVE_IRQCHIP
218e99
+#define __KVM_HAVE_IRQ_LINE
218e99
 
218e99
 struct kvm_regs {
218e99
 	__u64 pc;
218e99
@@ -272,8 +274,31 @@ struct kvm_debug_exit_arch {
218e99
 
218e99
 /* for KVM_SET_GUEST_DEBUG */
218e99
 struct kvm_guest_debug_arch {
218e99
+	struct {
218e99
+		/* H/W breakpoint/watchpoint address */
218e99
+		__u64 addr;
218e99
+		/*
218e99
+		 * Type denotes h/w breakpoint, read watchpoint, write
218e99
+		 * watchpoint or watchpoint (both read and write).
218e99
+		 */
218e99
+#define KVMPPC_DEBUG_NONE		0x0
218e99
+#define KVMPPC_DEBUG_BREAKPOINT		(1UL << 1)
218e99
+#define KVMPPC_DEBUG_WATCH_WRITE	(1UL << 2)
218e99
+#define KVMPPC_DEBUG_WATCH_READ		(1UL << 3)
218e99
+		__u32 type;
218e99
+		__u32 reserved;
218e99
+	} bp[16];
218e99
 };
218e99
 
218e99
+/* Debug related defines */
218e99
+/*
218e99
+ * kvm_guest_debug->control is a 32 bit field. The lower 16 bits are generic
218e99
+ * and upper 16 bits are architecture specific. Architecture specific defines
218e99
+ * that ioctl is for setting hardware breakpoint or software breakpoint.
218e99
+ */
218e99
+#define KVM_GUESTDBG_USE_SW_BP		0x00010000
218e99
+#define KVM_GUESTDBG_USE_HW_BP		0x00020000
218e99
+
218e99
 /* definition of registers in kvm_run */
218e99
 struct kvm_sync_regs {
218e99
 };
218e99
@@ -299,6 +324,12 @@ struct kvm_allocate_rma {
218e99
 	__u64 rma_size;
218e99
 };
218e99
 
218e99
+/* for KVM_CAP_PPC_RTAS */
218e99
+struct kvm_rtas_token_args {
218e99
+	char name[120];
218e99
+	__u64 token;	/* Use a token of 0 to undefine a mapping */
218e99
+};
218e99
+
218e99
 struct kvm_book3e_206_tlb_entry {
218e99
 	__u32 mas8;
218e99
 	__u32 mas1;
218e99
@@ -359,6 +390,26 @@ struct kvm_get_htab_header {
218e99
 	__u16	n_invalid;
218e99
 };
218e99
 
218e99
+/* Per-vcpu XICS interrupt controller state */
218e99
+#define KVM_REG_PPC_ICP_STATE	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
218e99
+
218e99
+#define  KVM_REG_PPC_ICP_CPPR_SHIFT	56	/* current proc priority */
218e99
+#define  KVM_REG_PPC_ICP_CPPR_MASK	0xff
218e99
+#define  KVM_REG_PPC_ICP_XISR_SHIFT	32	/* interrupt status field */
218e99
+#define  KVM_REG_PPC_ICP_XISR_MASK	0xffffff
218e99
+#define  KVM_REG_PPC_ICP_MFRR_SHIFT	24	/* pending IPI priority */
218e99
+#define  KVM_REG_PPC_ICP_MFRR_MASK	0xff
218e99
+#define  KVM_REG_PPC_ICP_PPRI_SHIFT	16	/* pending irq priority */
218e99
+#define  KVM_REG_PPC_ICP_PPRI_MASK	0xff
218e99
+
218e99
+/* Device control API: PPC-specific devices */
218e99
+#define KVM_DEV_MPIC_GRP_MISC		1
218e99
+#define   KVM_DEV_MPIC_BASE_ADDR	0	/* 64-bit */
218e99
+
218e99
+#define KVM_DEV_MPIC_GRP_REGISTER	2	/* 32-bit */
218e99
+#define KVM_DEV_MPIC_GRP_IRQ_ACTIVE	3	/* 32-bit */
218e99
+
218e99
+/* One-Reg API: PPC-specific registers */
218e99
 #define KVM_REG_PPC_HIOR	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x1)
218e99
 #define KVM_REG_PPC_IAC1	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x2)
218e99
 #define KVM_REG_PPC_IAC2	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x3)
218e99
@@ -422,4 +473,42 @@ struct kvm_get_htab_header {
218e99
 #define KVM_REG_PPC_CLEAR_TSR	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88)
218e99
 #define KVM_REG_PPC_TCR		(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89)
218e99
 #define KVM_REG_PPC_TSR		(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a)
218e99
+
218e99
+/* Debugging: Special instruction for software breakpoint */
218e99
+#define KVM_REG_PPC_DEBUG_INST	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b)
218e99
+
218e99
+/* MMU registers */
218e99
+#define KVM_REG_PPC_MAS0	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8c)
218e99
+#define KVM_REG_PPC_MAS1	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8d)
218e99
+#define KVM_REG_PPC_MAS2	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8e)
218e99
+#define KVM_REG_PPC_MAS7_3	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8f)
218e99
+#define KVM_REG_PPC_MAS4	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x90)
218e99
+#define KVM_REG_PPC_MAS6	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x91)
218e99
+#define KVM_REG_PPC_MMUCFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x92)
218e99
+/*
218e99
+ * TLBnCFG fields TLBnCFG_N_ENTRY and TLBnCFG_ASSOC can be changed only using
218e99
+ * KVM_CAP_SW_TLB ioctl
218e99
+ */
218e99
+#define KVM_REG_PPC_TLB0CFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x93)
218e99
+#define KVM_REG_PPC_TLB1CFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x94)
218e99
+#define KVM_REG_PPC_TLB2CFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x95)
218e99
+#define KVM_REG_PPC_TLB3CFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x96)
218e99
+#define KVM_REG_PPC_TLB0PS	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x97)
218e99
+#define KVM_REG_PPC_TLB1PS	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x98)
218e99
+#define KVM_REG_PPC_TLB2PS	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x99)
218e99
+#define KVM_REG_PPC_TLB3PS	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9a)
218e99
+#define KVM_REG_PPC_EPTCFG	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x9b)
218e99
+
218e99
+/* PPC64 eXternal Interrupt Controller Specification */
218e99
+#define KVM_DEV_XICS_GRP_SOURCES	1	/* 64-bit source attributes */
218e99
+
218e99
+/* Layout of 64-bit source attribute values */
218e99
+#define  KVM_XICS_DESTINATION_SHIFT	0
218e99
+#define  KVM_XICS_DESTINATION_MASK	0xffffffffULL
218e99
+#define  KVM_XICS_PRIORITY_SHIFT	32
218e99
+#define  KVM_XICS_PRIORITY_MASK		0xff
218e99
+#define  KVM_XICS_LEVEL_SENSITIVE	(1ULL << 40)
218e99
+#define  KVM_XICS_MASKED		(1ULL << 41)
218e99
+#define  KVM_XICS_PENDING		(1ULL << 42)
218e99
+
218e99
 #endif /* __LINUX_KVM_POWERPC_H */
218e99
diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
218e99
index a65ec29..5d9a303 100644
218e99
--- a/linux-headers/asm-x86/kvm.h
218e99
+++ b/linux-headers/asm-x86/kvm.h
218e99
@@ -29,7 +29,6 @@
218e99
 #define __KVM_HAVE_PIT
218e99
 #define __KVM_HAVE_IOAPIC
218e99
 #define __KVM_HAVE_IRQ_LINE
218e99
-#define __KVM_HAVE_DEVICE_ASSIGNMENT
218e99
 #define __KVM_HAVE_MSI
218e99
 #define __KVM_HAVE_USER_NMI
218e99
 #define __KVM_HAVE_GUEST_DEBUG
218e99
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
218e99
index eb02d8a..c614070 100644
218e99
--- a/linux-headers/linux/kvm.h
218e99
+++ b/linux-headers/linux/kvm.h
218e99
@@ -561,9 +561,7 @@ struct kvm_ppc_smmu_info {
218e99
 #define KVM_CAP_MP_STATE 14
218e99
 #define KVM_CAP_COALESCED_MMIO 15
218e99
 #define KVM_CAP_SYNC_MMU 16  /* Changes to host mmap are reflected in guest */
218e99
-#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
218e99
 #define KVM_CAP_DEVICE_ASSIGNMENT 17
218e99
-#endif
218e99
 #define KVM_CAP_IOMMU 18
218e99
 #ifdef __KVM_HAVE_MSI
218e99
 #define KVM_CAP_DEVICE_MSI 20
218e99
@@ -579,13 +577,9 @@ struct kvm_ppc_smmu_info {
218e99
 #ifdef __KVM_HAVE_PIT
218e99
 #define KVM_CAP_REINJECT_CONTROL 24
218e99
 #endif
218e99
-#ifdef __KVM_HAVE_IOAPIC
218e99
 #define KVM_CAP_IRQ_ROUTING 25
218e99
-#endif
218e99
 #define KVM_CAP_IRQ_INJECT_STATUS 26
218e99
-#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
218e99
 #define KVM_CAP_DEVICE_DEASSIGNMENT 27
218e99
-#endif
218e99
 #ifdef __KVM_HAVE_MSIX
218e99
 #define KVM_CAP_DEVICE_MSIX 28
218e99
 #endif
218e99
@@ -668,6 +662,10 @@ struct kvm_ppc_smmu_info {
218e99
 #define KVM_CAP_PPC_EPR 86
218e99
 #define KVM_CAP_ARM_PSCI 87
218e99
 #define KVM_CAP_ARM_SET_DEVICE_ADDR 88
218e99
+#define KVM_CAP_DEVICE_CTRL 89
218e99
+#define KVM_CAP_IRQ_MPIC 90
218e99
+#define KVM_CAP_PPC_RTAS 91
218e99
+#define KVM_CAP_IRQ_XICS 92
218e99
 
218e99
 #ifdef KVM_CAP_IRQ_ROUTING
218e99
 
218e99
@@ -821,6 +819,28 @@ struct kvm_arm_device_addr {
218e99
 };
218e99
 
218e99
 /*
218e99
+ * Device control API, available with KVM_CAP_DEVICE_CTRL
218e99
+ */
218e99
+#define KVM_CREATE_DEVICE_TEST		1
218e99
+
218e99
+struct kvm_create_device {
218e99
+	__u32	type;	/* in: KVM_DEV_TYPE_xxx */
218e99
+	__u32	fd;	/* out: device handle */
218e99
+	__u32	flags;	/* in: KVM_CREATE_DEVICE_xxx */
218e99
+};
218e99
+
218e99
+struct kvm_device_attr {
218e99
+	__u32	flags;		/* no flags currently defined */
218e99
+	__u32	group;		/* device-defined */
218e99
+	__u64	attr;		/* group-defined */
218e99
+	__u64	addr;		/* userspace address of attr data */
218e99
+};
218e99
+
218e99
+#define KVM_DEV_TYPE_FSL_MPIC_20	1
218e99
+#define KVM_DEV_TYPE_FSL_MPIC_42	2
218e99
+#define KVM_DEV_TYPE_XICS		3
218e99
+
218e99
+/*
218e99
  * ioctls for VM fds
218e99
  */
218e99
 #define KVM_SET_MEMORY_REGION     _IOW(KVMIO,  0x40, struct kvm_memory_region)
218e99
@@ -907,6 +927,16 @@ struct kvm_s390_ucas_mapping {
218e99
 #define KVM_PPC_GET_HTAB_FD	  _IOW(KVMIO,  0xaa, struct kvm_get_htab_fd)
218e99
 /* Available with KVM_CAP_ARM_SET_DEVICE_ADDR */
218e99
 #define KVM_ARM_SET_DEVICE_ADDR	  _IOW(KVMIO,  0xab, struct kvm_arm_device_addr)
218e99
+/* Available with KVM_CAP_PPC_RTAS */
218e99
+#define KVM_PPC_RTAS_DEFINE_TOKEN _IOW(KVMIO,  0xac, struct kvm_rtas_token_args)
218e99
+
218e99
+/* ioctl for vm fd */
218e99
+#define KVM_CREATE_DEVICE	  _IOWR(KVMIO,  0xe0, struct kvm_create_device)
218e99
+
218e99
+/* ioctls for fds returned by KVM_CREATE_DEVICE */
218e99
+#define KVM_SET_DEVICE_ATTR	  _IOW(KVMIO,  0xe1, struct kvm_device_attr)
218e99
+#define KVM_GET_DEVICE_ATTR	  _IOW(KVMIO,  0xe2, struct kvm_device_attr)
218e99
+#define KVM_HAS_DEVICE_ATTR	  _IOW(KVMIO,  0xe3, struct kvm_device_attr)
218e99
 
218e99
 /*
218e99
  * ioctls for vcpu fds
218e99
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
218e99
index e094121..7ec1864 100644
218e99
--- a/linux-headers/linux/vfio.h
218e99
+++ b/linux-headers/linux/vfio.h
218e99
@@ -319,6 +319,7 @@ enum {
218e99
 	VFIO_PCI_INTX_IRQ_INDEX,
218e99
 	VFIO_PCI_MSI_IRQ_INDEX,
218e99
 	VFIO_PCI_MSIX_IRQ_INDEX,
218e99
+	VFIO_PCI_ERR_IRQ_INDEX,
218e99
 	VFIO_PCI_NUM_IRQS
218e99
 };
218e99
 
218e99
diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
218e99
index 165a484..c656f61 100644
218e99
--- a/linux-headers/linux/vhost.h
218e99
+++ b/linux-headers/linux/vhost.h
218e99
@@ -127,4 +127,32 @@ struct vhost_memory {
218e99
 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
218e99
 #define VHOST_NET_F_VIRTIO_NET_HDR 27
218e99
 
218e99
+/* VHOST_SCSI specific definitions */
218e99
+
218e99
+/*
218e99
+ * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
218e99
+ *
218e99
+ * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
218e99
+ *            RFC-v2 vhost-scsi userspace.  Add GET_ABI_VERSION ioctl usage
218e99
+ * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
218e99
+ *            All the targets under vhost_wwpn can be seen and used by guset.
218e99
+ */
218e99
+
218e99
+#define VHOST_SCSI_ABI_VERSION	1
218e99
+
218e99
+struct vhost_scsi_target {
218e99
+	int abi_version;
218e99
+	char vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */
218e99
+	unsigned short vhost_tpgt;
218e99
+	unsigned short reserved;
218e99
+};
218e99
+
218e99
+#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
218e99
+#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
218e99
+/* Changing this breaks userspace. */
218e99
+#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
218e99
+/* Set and get the events missed flag */
218e99
+#define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32)
218e99
+#define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32)
218e99
+
218e99
 #endif