aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b7996a768eb2..cad77fe09d77 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -123,6 +123,8 @@ static inline bool is_error_page(struct page *page)
123#define KVM_REQ_WATCHDOG 18 123#define KVM_REQ_WATCHDOG 18
124#define KVM_REQ_MASTERCLOCK_UPDATE 19 124#define KVM_REQ_MASTERCLOCK_UPDATE 19
125#define KVM_REQ_MCLOCK_INPROGRESS 20 125#define KVM_REQ_MCLOCK_INPROGRESS 20
126#define KVM_REQ_EPR_EXIT 21
127#define KVM_REQ_EOIBITMAP 22
126 128
127#define KVM_USERSPACE_IRQ_SOURCE_ID 0 129#define KVM_USERSPACE_IRQ_SOURCE_ID 0
128#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 130#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1
@@ -267,12 +269,11 @@ static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
267struct kvm_memory_slot { 269struct kvm_memory_slot {
268 gfn_t base_gfn; 270 gfn_t base_gfn;
269 unsigned long npages; 271 unsigned long npages;
270 unsigned long flags;
271 unsigned long *dirty_bitmap; 272 unsigned long *dirty_bitmap;
272 struct kvm_arch_memory_slot arch; 273 struct kvm_arch_memory_slot arch;
273 unsigned long userspace_addr; 274 unsigned long userspace_addr;
274 int user_alloc; 275 u32 flags;
275 int id; 276 short id;
276}; 277};
277 278
278static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) 279static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
@@ -314,8 +315,12 @@ struct kvm_irq_routing_table {};
314 315
315#endif 316#endif
316 317
318#ifndef KVM_PRIVATE_MEM_SLOTS
319#define KVM_PRIVATE_MEM_SLOTS 0
320#endif
321
317#ifndef KVM_MEM_SLOTS_NUM 322#ifndef KVM_MEM_SLOTS_NUM
318#define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) 323#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
319#endif 324#endif
320 325
321/* 326/*
@@ -327,7 +332,7 @@ struct kvm_memslots {
327 u64 generation; 332 u64 generation;
328 struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM]; 333 struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM];
329 /* The mapping table from slot id to the index in memslots[]. */ 334 /* The mapping table from slot id to the index in memslots[]. */
330 int id_to_index[KVM_MEM_SLOTS_NUM]; 335 short id_to_index[KVM_MEM_SLOTS_NUM];
331}; 336};
332 337
333struct kvm { 338struct kvm {
@@ -425,7 +430,8 @@ void kvm_exit(void);
425 430
426void kvm_get_kvm(struct kvm *kvm); 431void kvm_get_kvm(struct kvm *kvm);
427void kvm_put_kvm(struct kvm *kvm); 432void kvm_put_kvm(struct kvm *kvm);
428void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new); 433void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new,
434 u64 last_generation);
429 435
430static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) 436static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
431{ 437{
@@ -448,10 +454,10 @@ id_to_memslot(struct kvm_memslots *slots, int id)
448 454
449int kvm_set_memory_region(struct kvm *kvm, 455int kvm_set_memory_region(struct kvm *kvm,
450 struct kvm_userspace_memory_region *mem, 456 struct kvm_userspace_memory_region *mem,
451 int user_alloc); 457 bool user_alloc);
452int __kvm_set_memory_region(struct kvm *kvm, 458int __kvm_set_memory_region(struct kvm *kvm,
453 struct kvm_userspace_memory_region *mem, 459 struct kvm_userspace_memory_region *mem,
454 int user_alloc); 460 bool user_alloc);
455void kvm_arch_free_memslot(struct kvm_memory_slot *free, 461void kvm_arch_free_memslot(struct kvm_memory_slot *free,
456 struct kvm_memory_slot *dont); 462 struct kvm_memory_slot *dont);
457int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); 463int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages);
@@ -459,11 +465,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
459 struct kvm_memory_slot *memslot, 465 struct kvm_memory_slot *memslot,
460 struct kvm_memory_slot old, 466 struct kvm_memory_slot old,
461 struct kvm_userspace_memory_region *mem, 467 struct kvm_userspace_memory_region *mem,
462 int user_alloc); 468 bool user_alloc);
463void kvm_arch_commit_memory_region(struct kvm *kvm, 469void kvm_arch_commit_memory_region(struct kvm *kvm,
464 struct kvm_userspace_memory_region *mem, 470 struct kvm_userspace_memory_region *mem,
465 struct kvm_memory_slot old, 471 struct kvm_memory_slot old,
466 int user_alloc); 472 bool user_alloc);
467bool kvm_largepages_enabled(void); 473bool kvm_largepages_enabled(void);
468void kvm_disable_largepages(void); 474void kvm_disable_largepages(void);
469/* flush all memory translations */ 475/* flush all memory translations */
@@ -533,6 +539,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
533void kvm_flush_remote_tlbs(struct kvm *kvm); 539void kvm_flush_remote_tlbs(struct kvm *kvm);
534void kvm_reload_remote_mmus(struct kvm *kvm); 540void kvm_reload_remote_mmus(struct kvm *kvm);
535void kvm_make_mclock_inprogress_request(struct kvm *kvm); 541void kvm_make_mclock_inprogress_request(struct kvm *kvm);
542void kvm_make_update_eoibitmap_request(struct kvm *kvm);
536 543
537long kvm_arch_dev_ioctl(struct file *filp, 544long kvm_arch_dev_ioctl(struct file *filp,
538 unsigned int ioctl, unsigned long arg); 545 unsigned int ioctl, unsigned long arg);
@@ -550,7 +557,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
550int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, 557int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
551 struct 558 struct
552 kvm_userspace_memory_region *mem, 559 kvm_userspace_memory_region *mem,
553 int user_alloc); 560 bool user_alloc);
554int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); 561int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level);
555long kvm_arch_vm_ioctl(struct file *filp, 562long kvm_arch_vm_ioctl(struct file *filp,
556 unsigned int ioctl, unsigned long arg); 563 unsigned int ioctl, unsigned long arg);
@@ -686,6 +693,7 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
686int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); 693int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level);
687int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, 694int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
688 int irq_source_id, int level); 695 int irq_source_id, int level);
696bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin);
689void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 697void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
690void kvm_register_irq_ack_notifier(struct kvm *kvm, 698void kvm_register_irq_ack_notifier(struct kvm *kvm,
691 struct kvm_irq_ack_notifier *kian); 699 struct kvm_irq_ack_notifier *kian);