diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-12-12 12:12:53 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-12-16 19:53:38 +0300 |
commit | 3f5ad8be3713572f3946b69eb376206153d0ea2d (patch) | |
tree | 90ca8a72bf9fd7fc79652a8c772f00ae32574606 /arch/x86/include/asm/kvm_host.h | |
parent | 83781d180b219bd079ae72b341ee3f21fb236e97 (diff) | |
download | linux-3f5ad8be3713572f3946b69eb376206153d0ea2d.tar.xz |
KVM: hyperv: fix locking of struct kvm_hv fields
Introduce a new mutex to avoid an AB-BA deadlock between kvm->lock and
vcpu->mutex. Protect accesses in kvm_hv_setup_tsc_page too, as suggested
by Roman.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 7892530cbacf..2e25038dbd93 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -704,6 +704,7 @@ struct kvm_apic_map { /* Hyper-V emulation context */ struct kvm_hv { + struct mutex hv_lock; u64 hv_guest_os_id; u64 hv_hypercall; u64 hv_tsc_page; |