Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp849367rwb; Fri, 13 Jan 2023 05:04:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXsjo0aQ2isuyD5QVm/zW005sGxk870wI67i2uBZxEQXCmQrwJvsryexRGk3zq1lvYnBB/6c X-Received: by 2002:a17:902:6b89:b0:18f:6cb:1730 with SMTP id p9-20020a1709026b8900b0018f06cb1730mr77683333plk.26.1673615068357; Fri, 13 Jan 2023 05:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673615068; cv=none; d=google.com; s=arc-20160816; b=yw+vm/JwoWSxItNt4y7/pz1R7Tnp4DnYzLPuh3Pbk/XhYFQJ/VCEhC7Xm3P2crU2dK gO1Ixt6U/H1ieAtn1V5j5CNTlHINzz7gPPg4jsdGr9X7XgEiBCRfBmcdr+Z3VMTp0FF9 XJ+x6bRLwA+hD4Dcfn/WK8heo/X0TNnIHVANXCVl5Fm+IYdX97P+zyzceCZkepvLLiJN lsOXJiTW9Q5/Yqr+rbBFT5FvC7MZ/JyNUoEtJ7ErEGeXmAwsHa0qFx2b65IRvtNUl5YN GFPiHr/1uGccgTTEJDrU2vHBs9ZKo5la77dwJcArvRzzXrDaJaWQVVgjCqZWSwoc/+Jn O43A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C0qkmIIYhEbiaW9/bOLbh+d/v5T/bpSDifdQxL7LFD8=; b=p7p7EAlwQQwsoqcu7GLxsGGIxyu3JchC9LUq7NjwsRGsoTOh1w7NmRH5OVSTzHFO8I VDiqtuzEnVDbGyW5lpT334BSfOuTFklOpZ7ey9mf0P6jzKQrFIPcJ7rCbxu9L/9oaEXQ 5WW56fhuSO+wDxw/2SOxgo6XqOjBxGXviosxReZM3DF4vXaJEofroPl6Wn5kwOsT2L2u X7n+CL/0Liimi/GGPUN9t5x4PrPSeKma5DMYpzEOrcyb7wUNIGq2fz6hnfdTcAoyAFsd QyDehskfpKGzh+HN62Ne9jDlBDtimBQXv6lKPNFeZy92vudlF0d6jWaVTYKjfMlqdHwB 2M1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jX9nDGqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a170903234e00b0017a0e7aaf6bsi21768018plh.128.2023.01.13.05.04.19; Fri, 13 Jan 2023 05:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jX9nDGqf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238700AbjAMNBL (ORCPT + 51 others); Fri, 13 Jan 2023 08:01:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233153AbjAMNAZ (ORCPT ); Fri, 13 Jan 2023 08:00:25 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2144E87906; Fri, 13 Jan 2023 04:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=C0qkmIIYhEbiaW9/bOLbh+d/v5T/bpSDifdQxL7LFD8=; b=jX9nDGqf5PZ/nbe/w10V/E4iWF m0IGq/C+6Aow/l3c0NQi/iYOqr9QT18u/TzIJpjIPiXobaOVk5GJjQIIVsA5G6vBxSQUSZqXC5mWU gT+sTwOXvUmyMn9CEMnxNJlygno+m7C8tmzXsSEUgzcPcWbp+RBD+leGGqUoPJih7dSpredPYdY2N T04xhwPbrUYYmLyzzEmkOlbURgT1anPGPDe2c3eolRztUT+RfVUOzXUIsM/2mnXGNTj1/Y4HhBPr8 LXHUSY5w4DGmpZsd5quhb8rK2axOoNSyMYicRy8oRflEwXnn1MUEoyFpgwNDNm7qG8gGXu/0/KFjG 7MqhlK7A==; Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGJRy-0065y2-TV; Fri, 13 Jan 2023 12:46:27 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGJRl-0002jg-El; Fri, 13 Jan 2023 12:46:13 +0000 From: David Woodhouse To: Boqun Feng , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, kvm@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Lai Jiangshan , "Paul E . McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , David Woodhouse , Paolo Bonzini , seanjc@google.com, Joel Fernandes , Matthew Wilcox , Michal Luczaj Subject: [PATCH 0/3] KVM: Make use of SRCU deadlock detection support Date: Fri, 13 Jan 2023 12:46:03 +0000 Message-Id: <20230113124606.10221-1-dwmw2@infradead.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230113065955.815667-1-boqun.feng@gmail.com> References: <20230113065955.815667-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2023-01-12 at 22:59 -0800, Boqun Feng wrote: > This is actually a leftover of the recursive read deadlock detection > patchset: > > https://lore.kernel.org/lkml/20180411135647.21496-1-boqun.feng@gmail.com/ > > I resolve comments then and add more test cases, and hopefully this can > fulfill the request from KVM: > > https://lore.kernel.org/lkml/a14a13a690277d4cc95a4b26aa2d9a4d9b392a74.camel@infradead.org/ > > ;-) It definitely seems to work; thank you! I can revert some of the recent fixes from the KVM tree, apply your patches, and then I can trigger the lockdep warnings. To make it reliably trigger, we need to artificially call synchronize_srcu(&kvm->srcu) under kvm->lock on KVM init, because the circumstances under which that happens are a bit esoteric and don't always happen otherwise, so lockdep wouldn't notice. > The patch #3 is now WIP for two reasons: > > * It may conflicts with Paul's patchset on removing CONFIG_SRCU > > * I haven't found a proper way to "reinit" srcu_struct when > lockdep selftest runs: cleanup_srcu_struct() needs workqueue > however the tests can run before there is one. Understood. I think the KVM series which follows can stand alone and go via the KVM tree separately. As and when your series gets merged, it'll serve to protect against regressions. Thanks again! David Woodhouse (3): KVM: Show lockdep the kvm->mutex vs. kvm->srcu ordering rule KVM: selftests: Use enum for test numbers in xen_shinfo_test KVM: selftests: Add EVTCHNOP_send slow path test to xen_shinfo_test .../testing/selftests/kvm/x86_64/xen_shinfo_test.c | 165 ++++++++++++++------- virt/kvm/kvm_main.c | 10 ++ 2 files changed, 124 insertions(+), 51 deletions(-)