[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPm50a+aygp3T1mNjzGXtL2nyNm-mHFZ3YO8F7eO0gCxZDuQsA@mail.gmail.com>
Date: Sat, 8 Oct 2022 00:00:41 +0800
From: Hao Peng <flyingpenghao@...il.com>
To: pbonzini@...hat.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] kvm: x86: keep srcu writer side operation mutually exclusive
From: Peng Hao <flyingpeng@...cent.com>
Synchronization operations on the writer side of SRCU should be
invoked within the mutex.
Signed-off-by: Peng Hao <flyingpeng@...cent.com>
---
arch/x86/kvm/pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index 8a7dbe2c469a..619151849980 100644
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -602,9 +602,9 @@ int kvm_vm_ioctl_set_pmu_event_filter(struct kvm
*kvm, void __user *argp)
mutex_lock(&kvm->lock);
filter = rcu_replace_pointer(kvm->arch.pmu_event_filter, filter, 1);
+ synchronize_srcu_expedited(&kvm->srcu);
mutex_unlock(&kvm->lock);
- synchronize_srcu_expedited(&kvm->srcu);
r = 0;
cleanup:
kfree(filter);
--
2.27.0
Powered by blists - more mailing lists