diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 50 | ||||
-rw-r--r-- | include/uapi/linux/kvm.h | 3 |
2 files changed, 42 insertions, 11 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a9428635c9fd..1c0be23f874d 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -151,6 +151,7 @@ struct kvm_io_bus { | |||
151 | enum kvm_bus { | 151 | enum kvm_bus { |
152 | KVM_MMIO_BUS, | 152 | KVM_MMIO_BUS, |
153 | KVM_PIO_BUS, | 153 | KVM_PIO_BUS, |
154 | KVM_VIRTIO_CCW_NOTIFY_BUS, | ||
154 | KVM_NR_BUSES | 155 | KVM_NR_BUSES |
155 | }; | 156 | }; |
156 | 157 | ||
@@ -254,6 +255,7 @@ struct kvm_vcpu { | |||
254 | bool dy_eligible; | 255 | bool dy_eligible; |
255 | } spin_loop; | 256 | } spin_loop; |
256 | #endif | 257 | #endif |
258 | bool preempted; | ||
257 | struct kvm_vcpu_arch arch; | 259 | struct kvm_vcpu_arch arch; |
258 | }; | 260 | }; |
259 | 261 | ||
@@ -426,6 +428,19 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | |||
426 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); | 428 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); |
427 | void vcpu_put(struct kvm_vcpu *vcpu); | 429 | void vcpu_put(struct kvm_vcpu *vcpu); |
428 | 430 | ||
431 | #ifdef __KVM_HAVE_IOAPIC | ||
432 | int kvm_irqfd_init(void); | ||
433 | void kvm_irqfd_exit(void); | ||
434 | #else | ||
435 | static inline int kvm_irqfd_init(void) | ||
436 | { | ||
437 | return 0; | ||
438 | } | ||
439 | |||
440 | static inline void kvm_irqfd_exit(void) | ||
441 | { | ||
442 | } | ||
443 | #endif | ||
429 | int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, | 444 | int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, |
430 | struct module *module); | 445 | struct module *module); |
431 | void kvm_exit(void); | 446 | void kvm_exit(void); |
@@ -454,24 +469,39 @@ id_to_memslot(struct kvm_memslots *slots, int id) | |||
454 | return slot; | 469 | return slot; |
455 | } | 470 | } |
456 | 471 | ||
472 | /* | ||
473 | * KVM_SET_USER_MEMORY_REGION ioctl allows the following operations: | ||
474 | * - create a new memory slot | ||
475 | * - delete an existing memory slot | ||
476 | * - modify an existing memory slot | ||
477 | * -- move it in the guest physical memory space | ||
478 | * -- just change its flags | ||
479 | * | ||
480 | * Since flags can be changed by some of these operations, the following | ||
481 | * differentiation is the best we can do for __kvm_set_memory_region(): | ||
482 | */ | ||
483 | enum kvm_mr_change { | ||
484 | KVM_MR_CREATE, | ||
485 | KVM_MR_DELETE, | ||
486 | KVM_MR_MOVE, | ||
487 | KVM_MR_FLAGS_ONLY, | ||
488 | }; | ||
489 | |||
457 | int kvm_set_memory_region(struct kvm *kvm, | 490 | int kvm_set_memory_region(struct kvm *kvm, |
458 | struct kvm_userspace_memory_region *mem, | 491 | struct kvm_userspace_memory_region *mem); |
459 | bool user_alloc); | ||
460 | int __kvm_set_memory_region(struct kvm *kvm, | 492 | int __kvm_set_memory_region(struct kvm *kvm, |
461 | struct kvm_userspace_memory_region *mem, | 493 | struct kvm_userspace_memory_region *mem); |
462 | bool user_alloc); | ||
463 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | 494 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, |
464 | struct kvm_memory_slot *dont); | 495 | struct kvm_memory_slot *dont); |
465 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | 496 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); |
466 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 497 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
467 | struct kvm_memory_slot *memslot, | 498 | struct kvm_memory_slot *memslot, |
468 | struct kvm_memory_slot old, | ||
469 | struct kvm_userspace_memory_region *mem, | 499 | struct kvm_userspace_memory_region *mem, |
470 | bool user_alloc); | 500 | enum kvm_mr_change change); |
471 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 501 | void kvm_arch_commit_memory_region(struct kvm *kvm, |
472 | struct kvm_userspace_memory_region *mem, | 502 | struct kvm_userspace_memory_region *mem, |
473 | struct kvm_memory_slot old, | 503 | const struct kvm_memory_slot *old, |
474 | bool user_alloc); | 504 | enum kvm_mr_change change); |
475 | bool kvm_largepages_enabled(void); | 505 | bool kvm_largepages_enabled(void); |
476 | void kvm_disable_largepages(void); | 506 | void kvm_disable_largepages(void); |
477 | /* flush all memory translations */ | 507 | /* flush all memory translations */ |
@@ -557,9 +587,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | |||
557 | struct kvm_dirty_log *log); | 587 | struct kvm_dirty_log *log); |
558 | 588 | ||
559 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | 589 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, |
560 | struct | 590 | struct kvm_userspace_memory_region *mem); |
561 | kvm_userspace_memory_region *mem, | ||
562 | bool user_alloc); | ||
563 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); | 591 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); |
564 | long kvm_arch_vm_ioctl(struct file *filp, | 592 | long kvm_arch_vm_ioctl(struct file *filp, |
565 | unsigned int ioctl, unsigned long arg); | 593 | unsigned int ioctl, unsigned long arg); |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 3c56ba3d80c1..74d0ff3dfd66 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -449,12 +449,15 @@ enum { | |||
449 | kvm_ioeventfd_flag_nr_datamatch, | 449 | kvm_ioeventfd_flag_nr_datamatch, |
450 | kvm_ioeventfd_flag_nr_pio, | 450 | kvm_ioeventfd_flag_nr_pio, |
451 | kvm_ioeventfd_flag_nr_deassign, | 451 | kvm_ioeventfd_flag_nr_deassign, |
452 | kvm_ioeventfd_flag_nr_virtio_ccw_notify, | ||
452 | kvm_ioeventfd_flag_nr_max, | 453 | kvm_ioeventfd_flag_nr_max, |
453 | }; | 454 | }; |
454 | 455 | ||
455 | #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) | 456 | #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) |
456 | #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) | 457 | #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) |
457 | #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) | 458 | #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) |
459 | #define KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY \ | ||
460 | (1 << kvm_ioeventfd_flag_nr_virtio_ccw_notify) | ||
458 | 461 | ||
459 | #define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1) | 462 | #define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1) |
460 | 463 | ||