diff options
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r-- | include/linux/kvm.h | 117 |
1 files changed, 100 insertions, 17 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 0424326f1679..8cc137911b34 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -48,7 +48,10 @@ struct kvm_irq_level { | |||
48 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. | 48 | * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. |
49 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. | 49 | * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. |
50 | */ | 50 | */ |
51 | __u32 irq; | 51 | union { |
52 | __u32 irq; | ||
53 | __s32 status; | ||
54 | }; | ||
52 | __u32 level; | 55 | __u32 level; |
53 | }; | 56 | }; |
54 | 57 | ||
@@ -126,6 +129,7 @@ struct kvm_run { | |||
126 | __u64 data_offset; /* relative to kvm_run start */ | 129 | __u64 data_offset; /* relative to kvm_run start */ |
127 | } io; | 130 | } io; |
128 | struct { | 131 | struct { |
132 | struct kvm_debug_exit_arch arch; | ||
129 | } debug; | 133 | } debug; |
130 | /* KVM_EXIT_MMIO */ | 134 | /* KVM_EXIT_MMIO */ |
131 | struct { | 135 | struct { |
@@ -217,21 +221,6 @@ struct kvm_interrupt { | |||
217 | __u32 irq; | 221 | __u32 irq; |
218 | }; | 222 | }; |
219 | 223 | ||
220 | struct kvm_breakpoint { | ||
221 | __u32 enabled; | ||
222 | __u32 padding; | ||
223 | __u64 address; | ||
224 | }; | ||
225 | |||
226 | /* for KVM_DEBUG_GUEST */ | ||
227 | struct kvm_debug_guest { | ||
228 | /* int */ | ||
229 | __u32 enabled; | ||
230 | __u32 pad; | ||
231 | struct kvm_breakpoint breakpoints[4]; | ||
232 | __u32 singlestep; | ||
233 | }; | ||
234 | |||
235 | /* for KVM_GET_DIRTY_LOG */ | 224 | /* for KVM_GET_DIRTY_LOG */ |
236 | struct kvm_dirty_log { | 225 | struct kvm_dirty_log { |
237 | __u32 slot; | 226 | __u32 slot; |
@@ -292,6 +281,17 @@ struct kvm_s390_interrupt { | |||
292 | __u64 parm64; | 281 | __u64 parm64; |
293 | }; | 282 | }; |
294 | 283 | ||
284 | /* for KVM_SET_GUEST_DEBUG */ | ||
285 | |||
286 | #define KVM_GUESTDBG_ENABLE 0x00000001 | ||
287 | #define KVM_GUESTDBG_SINGLESTEP 0x00000002 | ||
288 | |||
289 | struct kvm_guest_debug { | ||
290 | __u32 control; | ||
291 | __u32 pad; | ||
292 | struct kvm_guest_debug_arch arch; | ||
293 | }; | ||
294 | |||
295 | #define KVM_TRC_SHIFT 16 | 295 | #define KVM_TRC_SHIFT 16 |
296 | /* | 296 | /* |
297 | * kvm trace categories | 297 | * kvm trace categories |
@@ -396,6 +396,59 @@ struct kvm_trace_rec { | |||
396 | #ifdef __KVM_HAVE_USER_NMI | 396 | #ifdef __KVM_HAVE_USER_NMI |
397 | #define KVM_CAP_USER_NMI 22 | 397 | #define KVM_CAP_USER_NMI 22 |
398 | #endif | 398 | #endif |
399 | #ifdef __KVM_HAVE_GUEST_DEBUG | ||
400 | #define KVM_CAP_SET_GUEST_DEBUG 23 | ||
401 | #endif | ||
402 | #ifdef __KVM_HAVE_PIT | ||
403 | #define KVM_CAP_REINJECT_CONTROL 24 | ||
404 | #endif | ||
405 | #ifdef __KVM_HAVE_IOAPIC | ||
406 | #define KVM_CAP_IRQ_ROUTING 25 | ||
407 | #endif | ||
408 | #define KVM_CAP_IRQ_INJECT_STATUS 26 | ||
409 | #ifdef __KVM_HAVE_DEVICE_ASSIGNMENT | ||
410 | #define KVM_CAP_DEVICE_DEASSIGNMENT 27 | ||
411 | #endif | ||
412 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ | ||
413 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 | ||
414 | |||
415 | #ifdef KVM_CAP_IRQ_ROUTING | ||
416 | |||
417 | struct kvm_irq_routing_irqchip { | ||
418 | __u32 irqchip; | ||
419 | __u32 pin; | ||
420 | }; | ||
421 | |||
422 | struct kvm_irq_routing_msi { | ||
423 | __u32 address_lo; | ||
424 | __u32 address_hi; | ||
425 | __u32 data; | ||
426 | __u32 pad; | ||
427 | }; | ||
428 | |||
429 | /* gsi routing entry types */ | ||
430 | #define KVM_IRQ_ROUTING_IRQCHIP 1 | ||
431 | #define KVM_IRQ_ROUTING_MSI 2 | ||
432 | |||
433 | struct kvm_irq_routing_entry { | ||
434 | __u32 gsi; | ||
435 | __u32 type; | ||
436 | __u32 flags; | ||
437 | __u32 pad; | ||
438 | union { | ||
439 | struct kvm_irq_routing_irqchip irqchip; | ||
440 | struct kvm_irq_routing_msi msi; | ||
441 | __u32 pad[8]; | ||
442 | } u; | ||
443 | }; | ||
444 | |||
445 | struct kvm_irq_routing { | ||
446 | __u32 nr; | ||
447 | __u32 flags; | ||
448 | struct kvm_irq_routing_entry entries[0]; | ||
449 | }; | ||
450 | |||
451 | #endif | ||
399 | 452 | ||
400 | /* | 453 | /* |
401 | * ioctls for VM fds | 454 | * ioctls for VM fds |
@@ -421,14 +474,19 @@ struct kvm_trace_rec { | |||
421 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) | 474 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) |
422 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) | 475 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) |
423 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) | 476 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) |
477 | #define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) | ||
424 | #define KVM_REGISTER_COALESCED_MMIO \ | 478 | #define KVM_REGISTER_COALESCED_MMIO \ |
425 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | 479 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
426 | #define KVM_UNREGISTER_COALESCED_MMIO \ | 480 | #define KVM_UNREGISTER_COALESCED_MMIO \ |
427 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | 481 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
428 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | 482 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ |
429 | struct kvm_assigned_pci_dev) | 483 | struct kvm_assigned_pci_dev) |
484 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) | ||
430 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | 485 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ |
431 | struct kvm_assigned_irq) | 486 | struct kvm_assigned_irq) |
487 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) | ||
488 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ | ||
489 | struct kvm_assigned_pci_dev) | ||
432 | 490 | ||
433 | /* | 491 | /* |
434 | * ioctls for vcpu fds | 492 | * ioctls for vcpu fds |
@@ -440,7 +498,8 @@ struct kvm_trace_rec { | |||
440 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) | 498 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) |
441 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) | 499 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) |
442 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) | 500 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) |
443 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) | 501 | /* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ |
502 | #define KVM_DEBUG_GUEST __KVM_DEPRECATED_DEBUG_GUEST | ||
444 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) | 503 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) |
445 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) | 504 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) |
446 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) | 505 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) |
@@ -469,6 +528,29 @@ struct kvm_trace_rec { | |||
469 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 528 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
470 | /* Available with KVM_CAP_NMI */ | 529 | /* Available with KVM_CAP_NMI */ |
471 | #define KVM_NMI _IO(KVMIO, 0x9a) | 530 | #define KVM_NMI _IO(KVMIO, 0x9a) |
531 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ | ||
532 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) | ||
533 | |||
534 | /* | ||
535 | * Deprecated interfaces | ||
536 | */ | ||
537 | struct kvm_breakpoint { | ||
538 | __u32 enabled; | ||
539 | __u32 padding; | ||
540 | __u64 address; | ||
541 | }; | ||
542 | |||
543 | struct kvm_debug_guest { | ||
544 | __u32 enabled; | ||
545 | __u32 pad; | ||
546 | struct kvm_breakpoint breakpoints[4]; | ||
547 | __u32 singlestep; | ||
548 | }; | ||
549 | |||
550 | #define __KVM_DEPRECATED_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) | ||
551 | |||
552 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) | ||
553 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) | ||
472 | 554 | ||
473 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 555 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
474 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 556 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
@@ -522,6 +604,7 @@ struct kvm_assigned_irq { | |||
522 | 604 | ||
523 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 605 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
524 | 606 | ||
607 | #define KVM_DEV_IRQ_ASSIGN_MSI_ACTION KVM_DEV_IRQ_ASSIGN_ENABLE_MSI | ||
525 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) | 608 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) |
526 | 609 | ||
527 | #endif | 610 | #endif |