summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorPeng Hao <flyingpeng@tencent.com>2022-11-08 11:50:54 +0800
committerSean Christopherson <seanjc@google.com>2022-11-30 16:00:02 -0800
commit4265df667bbdc71c640e43c905bd9aeeead92365 (patch)
treeba2beb9e7e3c566280e874252b54f33f695b5a79 /arch/x86/kvm/x86.c
parenteb3992e833d3a17f9b0a3e0371d0b1d3d566f740 (diff)
downloadlinux-4265df667bbdc71c640e43c905bd9aeeead92365.tar.bz2
KVM: x86: Keep the lock order consistent between SRCU and gpc spinlock
Acquire SRCU before taking the gpc spinlock in wait_pending_event() so as to be consistent with all other functions that acquire both locks. It's not illegal to acquire SRCU inside a spinlock, nor is there deadlock potential, but in general it's preferable to order locks from least restrictive to most restrictive, e.g. if wait_pending_event() needed to sleep for whatever reason, it could do so while holding SRCU, but would need to drop the spinlock. Signed-off-by: Peng Hao <flyingpeng@tencent.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/CAPm50a++Cb=QfnjMZ2EnCj-Sb9Y4UM-=uOEtHAcjnNLCAAf-dQ@mail.gmail.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
0 files changed, 0 insertions, 0 deletions