diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-24 16:07:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-24 16:07:18 -0500 |
commit | 89f883372fa60f604d136924baf3e89ff1870e9e (patch) | |
tree | cb69b0a14957945ba00d3d392bf9ccbbef56f3b8 /include | |
parent | 9e2d59ad580d590134285f361a0e80f0e98c0207 (diff) | |
parent | 6b73a96065e89dc9fa75ba4f78b1aa3a3bbd0470 (diff) |
Merge tag 'kvm-3.9-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM updates from Marcelo Tosatti:
"KVM updates for the 3.9 merge window, including x86 real mode
emulation fixes, stronger memory slot interface restrictions, mmu_lock
spinlock hold time reduction, improved handling of large page faults
on shadow, initial APICv HW acceleration support, s390 channel IO
based virtio, amongst others"
* tag 'kvm-3.9-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (143 commits)
Revert "KVM: MMU: lazily drop large spte"
x86: pvclock kvm: align allocation size to page size
KVM: nVMX: Remove redundant get_vmcs12 from nested_vmx_exit_handled_msr
x86 emulator: fix parity calculation for AAD instruction
KVM: PPC: BookE: Handle alignment interrupts
booke: Added DBCR4 SPR number
KVM: PPC: booke: Allow multiple exception types
KVM: PPC: booke: use vcpu reference from thread_struct
KVM: Remove user_alloc from struct kvm_memory_slot
KVM: VMX: disable apicv by default
KVM: s390: Fix handling of iscs.
KVM: MMU: cleanup __direct_map
KVM: MMU: remove pt_access in mmu_set_spte
KVM: MMU: cleanup mapping-level
KVM: MMU: lazily drop large spte
KVM: VMX: cleanup vmx_set_cr0().
KVM: VMX: add missing exit names to VMX_EXIT_REASONS array
KVM: VMX: disable SMEP feature when guest is in non-paging mode
KVM: Remove duplicate text in api.txt
Revert "KVM: MMU: split kvm_mmu_free_page"
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 30 | ||||
-rw-r--r-- | include/trace/events/kvm.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/kvm.h | 27 |
3 files changed, 47 insertions, 12 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) | |||
267 | struct kvm_memory_slot { | 269 | struct 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 | ||
278 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | 279 | static 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 | ||
333 | struct kvm { | 338 | struct kvm { |
@@ -425,7 +430,8 @@ void kvm_exit(void); | |||
425 | 430 | ||
426 | void kvm_get_kvm(struct kvm *kvm); | 431 | void kvm_get_kvm(struct kvm *kvm); |
427 | void kvm_put_kvm(struct kvm *kvm); | 432 | void kvm_put_kvm(struct kvm *kvm); |
428 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new); | 433 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new, |
434 | u64 last_generation); | ||
429 | 435 | ||
430 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 436 | static 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 | ||
449 | int kvm_set_memory_region(struct kvm *kvm, | 455 | int 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); |
452 | int __kvm_set_memory_region(struct kvm *kvm, | 458 | int __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); |
455 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | 461 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, |
456 | struct kvm_memory_slot *dont); | 462 | struct kvm_memory_slot *dont); |
457 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | 463 | int 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); |
463 | void kvm_arch_commit_memory_region(struct kvm *kvm, | 469 | void 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); |
467 | bool kvm_largepages_enabled(void); | 473 | bool kvm_largepages_enabled(void); |
468 | void kvm_disable_largepages(void); | 474 | void 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); | |||
533 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 539 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
534 | void kvm_reload_remote_mmus(struct kvm *kvm); | 540 | void kvm_reload_remote_mmus(struct kvm *kvm); |
535 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); | 541 | void kvm_make_mclock_inprogress_request(struct kvm *kvm); |
542 | void kvm_make_update_eoibitmap_request(struct kvm *kvm); | ||
536 | 543 | ||
537 | long kvm_arch_dev_ioctl(struct file *filp, | 544 | long 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, | |||
550 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | 557 | int 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); |
554 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); | 561 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level); |
555 | long kvm_arch_vm_ioctl(struct file *filp, | 562 | long 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); | |||
686 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 693 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
687 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | 694 | int 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); |
696 | bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); | ||
689 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 697 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
690 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 698 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
691 | struct kvm_irq_ack_notifier *kian); | 699 | struct kvm_irq_ack_notifier *kian); |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 7ef9e759f499..19911dddaeb7 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -14,7 +14,7 @@ | |||
14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ |
15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ |
16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ | 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ |
17 | ERSN(S390_UCONTROL) | 17 | ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH) |
18 | 18 | ||
19 | TRACE_EVENT(kvm_userspace_exit, | 19 | TRACE_EVENT(kvm_userspace_exit, |
20 | TP_PROTO(__u32 reason, int errno), | 20 | TP_PROTO(__u32 reason, int errno), |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index c70577cf67bc..3c56ba3d80c1 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -169,6 +169,8 @@ struct kvm_pit_config { | |||
169 | #define KVM_EXIT_PAPR_HCALL 19 | 169 | #define KVM_EXIT_PAPR_HCALL 19 |
170 | #define KVM_EXIT_S390_UCONTROL 20 | 170 | #define KVM_EXIT_S390_UCONTROL 20 |
171 | #define KVM_EXIT_WATCHDOG 21 | 171 | #define KVM_EXIT_WATCHDOG 21 |
172 | #define KVM_EXIT_S390_TSCH 22 | ||
173 | #define KVM_EXIT_EPR 23 | ||
172 | 174 | ||
173 | /* For KVM_EXIT_INTERNAL_ERROR */ | 175 | /* For KVM_EXIT_INTERNAL_ERROR */ |
174 | /* Emulate instruction failed. */ | 176 | /* Emulate instruction failed. */ |
@@ -286,6 +288,19 @@ struct kvm_run { | |||
286 | __u64 ret; | 288 | __u64 ret; |
287 | __u64 args[9]; | 289 | __u64 args[9]; |
288 | } papr_hcall; | 290 | } papr_hcall; |
291 | /* KVM_EXIT_S390_TSCH */ | ||
292 | struct { | ||
293 | __u16 subchannel_id; | ||
294 | __u16 subchannel_nr; | ||
295 | __u32 io_int_parm; | ||
296 | __u32 io_int_word; | ||
297 | __u32 ipb; | ||
298 | __u8 dequeued; | ||
299 | } s390_tsch; | ||
300 | /* KVM_EXIT_EPR */ | ||
301 | struct { | ||
302 | __u32 epr; | ||
303 | } epr; | ||
289 | /* Fix the size of the union. */ | 304 | /* Fix the size of the union. */ |
290 | char padding[256]; | 305 | char padding[256]; |
291 | }; | 306 | }; |
@@ -398,10 +413,20 @@ struct kvm_s390_psw { | |||
398 | #define KVM_S390_PROGRAM_INT 0xfffe0001u | 413 | #define KVM_S390_PROGRAM_INT 0xfffe0001u |
399 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u | 414 | #define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u |
400 | #define KVM_S390_RESTART 0xfffe0003u | 415 | #define KVM_S390_RESTART 0xfffe0003u |
416 | #define KVM_S390_MCHK 0xfffe1000u | ||
401 | #define KVM_S390_INT_VIRTIO 0xffff2603u | 417 | #define KVM_S390_INT_VIRTIO 0xffff2603u |
402 | #define KVM_S390_INT_SERVICE 0xffff2401u | 418 | #define KVM_S390_INT_SERVICE 0xffff2401u |
403 | #define KVM_S390_INT_EMERGENCY 0xffff1201u | 419 | #define KVM_S390_INT_EMERGENCY 0xffff1201u |
404 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u | 420 | #define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u |
421 | /* Anything below 0xfffe0000u is taken by INT_IO */ | ||
422 | #define KVM_S390_INT_IO(ai,cssid,ssid,schid) \ | ||
423 | (((schid)) | \ | ||
424 | ((ssid) << 16) | \ | ||
425 | ((cssid) << 18) | \ | ||
426 | ((ai) << 26)) | ||
427 | #define KVM_S390_INT_IO_MIN 0x00000000u | ||
428 | #define KVM_S390_INT_IO_MAX 0xfffdffffu | ||
429 | |||
405 | 430 | ||
406 | struct kvm_s390_interrupt { | 431 | struct kvm_s390_interrupt { |
407 | __u32 type; | 432 | __u32 type; |
@@ -636,6 +661,8 @@ struct kvm_ppc_smmu_info { | |||
636 | #define KVM_CAP_IRQFD_RESAMPLE 82 | 661 | #define KVM_CAP_IRQFD_RESAMPLE 82 |
637 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 | 662 | #define KVM_CAP_PPC_BOOKE_WATCHDOG 83 |
638 | #define KVM_CAP_PPC_HTAB_FD 84 | 663 | #define KVM_CAP_PPC_HTAB_FD 84 |
664 | #define KVM_CAP_S390_CSS_SUPPORT 85 | ||
665 | #define KVM_CAP_PPC_EPR 86 | ||
639 | #define KVM_CAP_ARM_PSCI 87 | 666 | #define KVM_CAP_ARM_PSCI 87 |
640 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 | 667 | #define KVM_CAP_ARM_SET_DEVICE_ADDR 88 |
641 | 668 | ||