public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: x86: keep srcu writer side operation mutually exclusive
@ 2022-10-07 16:00 Hao Peng
  2022-10-07 17:12 ` Sean Christopherson
  0 siblings, 1 reply; 5+ messages in thread
From: Hao Peng @ 2022-10-07 16:00 UTC (permalink / raw)
  To: pbonzini; +Cc: kvm, linux-kernel

From: Peng Hao <flyingpeng@tencent.com>

Synchronization operations on the writer side of SRCU should be
invoked within the mutex.

Signed-off-by: Peng Hao <flyingpeng@tencent.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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-24  3:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-07 16:00 [PATCH] kvm: x86: keep srcu writer side operation mutually exclusive Hao Peng
2022-10-07 17:12 ` Sean Christopherson
2022-10-09 11:45   ` Hao Peng
2022-10-10 17:38     ` Sean Christopherson
2022-10-24  3:27       ` Hao Peng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox