Message ID | CAPm50aJPpzWz1nnBu6vhcac2kwKq29h-oq7jZtKz23XJ46LW0g@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RESEND,v2] kvm: x86: Keep the lock order consistent | expand |
Nit, capitalize KVM in the shortlog, i.e. "KVM: x86:". On Mon, Oct 31, 2022, Hao Peng wrote: > From: Peng Hao <flyingpeng@tencent.com> > > 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. Extra whitespace at the beginning of each line should be deleted. > Thanks Sean Christopherson for the comment. > > Signed-off-by: Peng Hao <flyingpeng@tencent.com> > --- Nits aside, Reviewed-by: Sean Christopherson <seanjc@google.com>
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 2dae413bd62a..766e8a4ca3ea 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -964,8 +964,8 @@ static bool wait_pending_event(struct kvm_vcpu *vcpu, int nr_ports, bool ret = true; int idx, i; - read_lock_irqsave(&gpc->lock, flags); idx = srcu_read_lock(&kvm->srcu); + read_lock_irqsave(&gpc->lock, flags); if (!kvm_gfn_to_pfn_cache_check(kvm, gpc, gpc->gpa, PAGE_SIZE)) goto out_rcu;