Pull more KVM updates from Radim Krčmář: "Second batch of KVM updates for v4.13 Common: - add uevents for VM creation/destruction - annotate and properly access RCU-protected objects s390: - rename IOCTL added in the first v4.13 merge x86: - emulate VMLOAD VMSAVE feature in SVM - support paravirtual asynchronous page fault while nested - add Hyper-V userspace interfaces for better migration - improve master clock corner cases - extend internal error reporting after EPT misconfig - correct single-stepping of emulated instructions in SVM - handle MCE during VM entry - fix nVMX VM entry checks and nVMX VMCS shadowing" * tag 'kvm-4.13-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits) kvm: x86: hyperv: make VP_INDEX managed by userspace KVM: async_pf: Let guest support delivery of async_pf from guest mode KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf KVM: async_pf: Add L1 guest async_pf #PF vmexit handler KVM: x86: Simplify kvm_x86_ops->queue_exception parameter list kvm: x86: hyperv: add KVM_CAP_HYPERV_SYNIC2 KVM: x86: make backwards_tsc_observed a per-VM variable KVM: trigger uevents when creating or destroying a VM KVM: SVM: Enable Virtual VMLOAD VMSAVE feature KVM: SVM: Add Virtual VMLOAD VMSAVE feature definition KVM: SVM: Rename lbr_ctl field in the vmcb control area KVM: SVM: Prepare for new bit definition in lbr_ctl KVM: SVM: handle singlestep exception when skipping emulated instructions KVM: x86: take slots_lock in kvm_free_pit KVM: s390: Fix KVM_S390_GET_CMMA_BITS ioctl definition kvm: vmx: Properly handle machine check during VM-entry KVM: x86: update master clock before computing kvmclock_offset kvm: nVMX: Shadow "high" parts of shadowed 64-bit VMCS fields kvm: nVMX: Fix nested_vmx_check_msr_bitmap_controls kvm: nVMX: Validate the I/O bitmaps on nested VM-entry ...
Showing the changes to include/linux (1 of 21 files). Show all
Unified · Split
| @@ -234,7 +234,7 @@ struct kvm_vcpu { · 233 unmodified lines | ||
| 234 | 234 | |
| 235 | 235 | int guest_fpu_loaded, guest_xcr0_loaded; |
| 236 | 236 | struct swait_queue_head wq; |
| 237 | − struct pid *pid; | |
| 237 | + struct pid __rcu *pid; | |
| 238 | 238 | int sigset_active; |
| 239 | 239 | sigset_t sigset; |
| 240 | 240 | struct kvm_vcpu_stat stat; |
| @@ -390,7 +390,7 @@ struct kvm { · 149 unmodified lines | ||
| 390 | 390 | spinlock_t mmu_lock; |
| 391 | 391 | struct mutex slots_lock; |
| 392 | 392 | struct mm_struct *mm; /* userspace tied to this vm */ |
| 393 | − struct kvm_memslots *memslots[KVM_ADDRESS_SPACE_NUM]; | |
| 393 | + struct kvm_memslots __rcu *memslots[KVM_ADDRESS_SPACE_NUM]; | |
| 394 | 394 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
| 395 | 395 | |
| 396 | 396 | /* |
| @@ -404,7 +404,7 @@ struct kvm { · 7 unmodified lines | ||
| 404 | 404 | int last_boosted_vcpu; |
| 405 | 405 | struct list_head vm_list; |
| 406 | 406 | struct mutex lock; |
| 407 | − struct kvm_io_bus *buses[KVM_NR_BUSES]; | |
| 407 | + struct kvm_io_bus __rcu *buses[KVM_NR_BUSES]; | |
| 408 | 408 | #ifdef CONFIG_HAVE_KVM_EVENTFD |
| 409 | 409 | struct { |
| 410 | 410 | spinlock_t lock; |
| @@ -473,6 +473,12 @@ struct kvm { · 62 unmodified lines | ||
| 473 | 473 | #define vcpu_err(vcpu, fmt, ...) \ |
| 474 | 474 | kvm_err("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) |
| 475 | 475 | |
| 476 | +static inline struct kvm_io_bus *kvm_get_bus(struct kvm *kvm, enum kvm_bus idx) | |
| 477 | +{ | |
| 478 | + return srcu_dereference_check(kvm->buses[idx], &kvm->srcu, | |
| 479 | + lockdep_is_held(&kvm->slots_lock)); | |
| 480 | +} | |
| 481 | + | |
| 476 | 482 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) |
| 477 | 483 | { |
| 478 | 484 | /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case |
| @@ -562,9 +568,8 @@ void kvm_put_kvm(struct kvm *kvm); · 83 unmodified lines | ||
| 562 | 568 | |
| 563 | 569 | static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) |
| 564 | 570 | { |
| 565 | − return rcu_dereference_check(kvm->memslots[as_id], | |
| 566 | − srcu_read_lock_held(&kvm->srcu) | |
| 567 | − || lockdep_is_held(&kvm->slots_lock)); | |
| 571 | + return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu, | |
| 572 | + lockdep_is_held(&kvm->slots_lock)); | |
| 568 | 573 | } |
| 569 | 574 | |
| 570 | 575 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |