aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r--include/linux/kvm.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 68e67e50d028..6c322a90b92f 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -162,6 +162,7 @@ struct kvm_pit_config {
162#define KVM_EXIT_INTERNAL_ERROR 17 162#define KVM_EXIT_INTERNAL_ERROR 17
163#define KVM_EXIT_OSI 18 163#define KVM_EXIT_OSI 18
164#define KVM_EXIT_PAPR_HCALL 19 164#define KVM_EXIT_PAPR_HCALL 19
165#define KVM_EXIT_S390_UCONTROL 20
165 166
166/* For KVM_EXIT_INTERNAL_ERROR */ 167/* For KVM_EXIT_INTERNAL_ERROR */
167#define KVM_INTERNAL_ERROR_EMULATION 1 168#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -249,6 +250,11 @@ struct kvm_run {
249#define KVM_S390_RESET_CPU_INIT 8 250#define KVM_S390_RESET_CPU_INIT 8
250#define KVM_S390_RESET_IPL 16 251#define KVM_S390_RESET_IPL 16
251 __u64 s390_reset_flags; 252 __u64 s390_reset_flags;
253 /* KVM_EXIT_S390_UCONTROL */
254 struct {
255 __u64 trans_exc_code;
256 __u32 pgm_code;
257 } s390_ucontrol;
252 /* KVM_EXIT_DCR */ 258 /* KVM_EXIT_DCR */
253 struct { 259 struct {
254 __u32 dcrn; 260 __u32 dcrn;
@@ -273,6 +279,20 @@ struct kvm_run {
273 /* Fix the size of the union. */ 279 /* Fix the size of the union. */
274 char padding[256]; 280 char padding[256];
275 }; 281 };
282
283 /*
284 * shared registers between kvm and userspace.
285 * kvm_valid_regs specifies the register classes set by the host
286 * kvm_dirty_regs specified the register classes dirtied by userspace
287 * struct kvm_sync_regs is architecture specific, as well as the
288 * bits for kvm_valid_regs and kvm_dirty_regs
289 */
290 __u64 kvm_valid_regs;
291 __u64 kvm_dirty_regs;
292 union {
293 struct kvm_sync_regs regs;
294 char padding[1024];
295 } s;
276}; 296};
277 297
278/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */ 298/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */
@@ -431,6 +451,11 @@ struct kvm_ppc_pvinfo {
431 451
432#define KVMIO 0xAE 452#define KVMIO 0xAE
433 453
454/* machine type bits, to be used as argument to KVM_CREATE_VM */
455#define KVM_VM_S390_UCONTROL 1
456
457#define KVM_S390_SIE_PAGE_OFFSET 1
458
434/* 459/*
435 * ioctls for /dev/kvm fds: 460 * ioctls for /dev/kvm fds:
436 */ 461 */
@@ -555,9 +580,15 @@ struct kvm_ppc_pvinfo {
555#define KVM_CAP_PPC_SMT 64 580#define KVM_CAP_PPC_SMT 64
556#define KVM_CAP_PPC_RMA 65 581#define KVM_CAP_PPC_RMA 65
557#define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */ 582#define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */
583#define KVM_CAP_PPC_HIOR 67
558#define KVM_CAP_PPC_PAPR 68 584#define KVM_CAP_PPC_PAPR 68
585#define KVM_CAP_SW_TLB 69
586#define KVM_CAP_ONE_REG 70
559#define KVM_CAP_S390_GMAP 71 587#define KVM_CAP_S390_GMAP 71
560#define KVM_CAP_TSC_DEADLINE_TIMER 72 588#define KVM_CAP_TSC_DEADLINE_TIMER 72
589#define KVM_CAP_S390_UCONTROL 73
590#define KVM_CAP_SYNC_REGS 74
591#define KVM_CAP_PCI_2_3 75
561 592
562#ifdef KVM_CAP_IRQ_ROUTING 593#ifdef KVM_CAP_IRQ_ROUTING
563 594
@@ -637,6 +668,52 @@ struct kvm_clock_data {
637 __u32 pad[9]; 668 __u32 pad[9];
638}; 669};
639 670
671#define KVM_MMU_FSL_BOOKE_NOHV 0
672#define KVM_MMU_FSL_BOOKE_HV 1
673
674struct kvm_config_tlb {
675 __u64 params;
676 __u64 array;
677 __u32 mmu_type;
678 __u32 array_len;
679};
680
681struct kvm_dirty_tlb {
682 __u64 bitmap;
683 __u32 num_dirty;
684};
685
686/* Available with KVM_CAP_ONE_REG */
687
688#define KVM_REG_ARCH_MASK 0xff00000000000000ULL
689#define KVM_REG_GENERIC 0x0000000000000000ULL
690
691/*
692 * Architecture specific registers are to be defined in arch headers and
693 * ORed with the arch identifier.
694 */
695#define KVM_REG_PPC 0x1000000000000000ULL
696#define KVM_REG_X86 0x2000000000000000ULL
697#define KVM_REG_IA64 0x3000000000000000ULL
698#define KVM_REG_ARM 0x4000000000000000ULL
699#define KVM_REG_S390 0x5000000000000000ULL
700
701#define KVM_REG_SIZE_SHIFT 52
702#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
703#define KVM_REG_SIZE_U8 0x0000000000000000ULL
704#define KVM_REG_SIZE_U16 0x0010000000000000ULL
705#define KVM_REG_SIZE_U32 0x0020000000000000ULL
706#define KVM_REG_SIZE_U64 0x0030000000000000ULL
707#define KVM_REG_SIZE_U128 0x0040000000000000ULL
708#define KVM_REG_SIZE_U256 0x0050000000000000ULL
709#define KVM_REG_SIZE_U512 0x0060000000000000ULL
710#define KVM_REG_SIZE_U1024 0x0070000000000000ULL
711
712struct kvm_one_reg {
713 __u64 id;
714 __u64 addr;
715};
716
640/* 717/*
641 * ioctls for VM fds 718 * ioctls for VM fds
642 */ 719 */
@@ -655,6 +732,17 @@ struct kvm_clock_data {
655 struct kvm_userspace_memory_region) 732 struct kvm_userspace_memory_region)
656#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) 733#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
657#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) 734#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
735
736/* enable ucontrol for s390 */
737struct kvm_s390_ucas_mapping {
738 __u64 user_addr;
739 __u64 vcpu_addr;
740 __u64 length;
741};
742#define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
743#define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
744#define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
745
658/* Device model IOC */ 746/* Device model IOC */
659#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) 747#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
660#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) 748#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
@@ -697,6 +785,9 @@ struct kvm_clock_data {
697/* Available with KVM_CAP_TSC_CONTROL */ 785/* Available with KVM_CAP_TSC_CONTROL */
698#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2) 786#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
699#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3) 787#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
788/* Available with KVM_CAP_PCI_2_3 */
789#define KVM_ASSIGN_SET_INTX_MASK _IOW(KVMIO, 0xa4, \
790 struct kvm_assigned_pci_dev)
700 791
701/* 792/*
702 * ioctls for vcpu fds 793 * ioctls for vcpu fds
@@ -763,8 +854,15 @@ struct kvm_clock_data {
763#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce) 854#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
764/* Available with KVM_CAP_RMA */ 855/* Available with KVM_CAP_RMA */
765#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma) 856#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
857/* Available with KVM_CAP_SW_TLB */
858#define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb)
859/* Available with KVM_CAP_ONE_REG */
860#define KVM_GET_ONE_REG _IOW(KVMIO, 0xab, struct kvm_one_reg)
861#define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg)
766 862
767#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 863#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
864#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
865#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
768 866
769struct kvm_assigned_pci_dev { 867struct kvm_assigned_pci_dev {
770 __u32 assigned_dev_id; 868 __u32 assigned_dev_id;