diff options
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r-- | include/linux/kvm.h | 115 |
1 files changed, 98 insertions, 17 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 0424326f1679..311a073afe8a 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,57 @@ 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 | |||
413 | #ifdef KVM_CAP_IRQ_ROUTING | ||
414 | |||
415 | struct kvm_irq_routing_irqchip { | ||
416 | __u32 irqchip; | ||
417 | __u32 pin; | ||
418 | }; | ||
419 | |||
420 | struct kvm_irq_routing_msi { | ||
421 | __u32 address_lo; | ||
422 | __u32 address_hi; | ||
423 | __u32 data; | ||
424 | __u32 pad; | ||
425 | }; | ||
426 | |||
427 | /* gsi routing entry types */ | ||
428 | #define KVM_IRQ_ROUTING_IRQCHIP 1 | ||
429 | #define KVM_IRQ_ROUTING_MSI 2 | ||
430 | |||
431 | struct kvm_irq_routing_entry { | ||
432 | __u32 gsi; | ||
433 | __u32 type; | ||
434 | __u32 flags; | ||
435 | __u32 pad; | ||
436 | union { | ||
437 | struct kvm_irq_routing_irqchip irqchip; | ||
438 | struct kvm_irq_routing_msi msi; | ||
439 | __u32 pad[8]; | ||
440 | } u; | ||
441 | }; | ||
442 | |||
443 | struct kvm_irq_routing { | ||
444 | __u32 nr; | ||
445 | __u32 flags; | ||
446 | struct kvm_irq_routing_entry entries[0]; | ||
447 | }; | ||
448 | |||
449 | #endif | ||
399 | 450 | ||
400 | /* | 451 | /* |
401 | * ioctls for VM fds | 452 | * ioctls for VM fds |
@@ -421,14 +472,19 @@ struct kvm_trace_rec { | |||
421 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) | 472 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) |
422 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) | 473 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) |
423 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) | 474 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) |
475 | #define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) | ||
424 | #define KVM_REGISTER_COALESCED_MMIO \ | 476 | #define KVM_REGISTER_COALESCED_MMIO \ |
425 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | 477 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
426 | #define KVM_UNREGISTER_COALESCED_MMIO \ | 478 | #define KVM_UNREGISTER_COALESCED_MMIO \ |
427 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | 479 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
428 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | 480 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ |
429 | struct kvm_assigned_pci_dev) | 481 | struct kvm_assigned_pci_dev) |
482 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) | ||
430 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | 483 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ |
431 | struct kvm_assigned_irq) | 484 | struct kvm_assigned_irq) |
485 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) | ||
486 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ | ||
487 | struct kvm_assigned_pci_dev) | ||
432 | 488 | ||
433 | /* | 489 | /* |
434 | * ioctls for vcpu fds | 490 | * ioctls for vcpu fds |
@@ -440,7 +496,8 @@ struct kvm_trace_rec { | |||
440 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) | 496 | #define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs) |
441 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) | 497 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) |
442 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) | 498 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) |
443 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) | 499 | /* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ |
500 | #define KVM_DEBUG_GUEST __KVM_DEPRECATED_DEBUG_GUEST | ||
444 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) | 501 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) |
445 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) | 502 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) |
446 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) | 503 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) |
@@ -469,6 +526,29 @@ struct kvm_trace_rec { | |||
469 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 526 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
470 | /* Available with KVM_CAP_NMI */ | 527 | /* Available with KVM_CAP_NMI */ |
471 | #define KVM_NMI _IO(KVMIO, 0x9a) | 528 | #define KVM_NMI _IO(KVMIO, 0x9a) |
529 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ | ||
530 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) | ||
531 | |||
532 | /* | ||
533 | * Deprecated interfaces | ||
534 | */ | ||
535 | struct kvm_breakpoint { | ||
536 | __u32 enabled; | ||
537 | __u32 padding; | ||
538 | __u64 address; | ||
539 | }; | ||
540 | |||
541 | struct kvm_debug_guest { | ||
542 | __u32 enabled; | ||
543 | __u32 pad; | ||
544 | struct kvm_breakpoint breakpoints[4]; | ||
545 | __u32 singlestep; | ||
546 | }; | ||
547 | |||
548 | #define __KVM_DEPRECATED_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) | ||
549 | |||
550 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) | ||
551 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) | ||
472 | 552 | ||
473 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 553 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
474 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 554 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
@@ -522,6 +602,7 @@ struct kvm_assigned_irq { | |||
522 | 602 | ||
523 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 603 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
524 | 604 | ||
605 | #define KVM_DEV_IRQ_ASSIGN_MSI_ACTION KVM_DEV_IRQ_ASSIGN_ENABLE_MSI | ||
525 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) | 606 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) |
526 | 607 | ||
527 | #endif | 608 | #endif |