diff options
author | 2021-05-25 10:41:16 -0300 | |
---|---|---|
committer | 2021-05-27 07:50:13 -0400 | |
commit | 57ab87947abfc4e0b0b9864dc4717326a1c28a39 (patch) | |
tree | 31493f901bf959cfec6d22c807e9e2c05bfcd6b9 /arch/x86/kvm/x86.c | |
parent | KVM: LAPIC: Narrow the timer latency between wait_lapic_expire and world switch (diff) | |
download | wireguard-linux-57ab87947abfc4e0b0b9864dc4717326a1c28a39.tar.xz wireguard-linux-57ab87947abfc4e0b0b9864dc4717326a1c28a39.zip |
KVM: x86: add start_assignment hook to kvm_x86_ops
Add a start_assignment hook to kvm_x86_ops, which is called when
kvm_arch_start_assignment is done.
The hook is required to update the wakeup vector of a sleeping vCPU
when a device is assigned to the guest.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Message-Id: <20210525134321.254128742@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bed7b5348c0e..98538b1cb453 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -11504,7 +11504,8 @@ bool kvm_arch_can_dequeue_async_page_present(struct kvm_vcpu *vcpu) void kvm_arch_start_assignment(struct kvm *kvm) { - atomic_inc(&kvm->arch.assigned_device_count); + if (atomic_inc_return(&kvm->arch.assigned_device_count) == 1) + static_call_cond(kvm_x86_start_assignment)(kvm); } EXPORT_SYMBOL_GPL(kvm_arch_start_assignment); |