Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1272147ybh; Thu, 16 Jul 2020 07:45:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvt3IQN/uTnfo5J67ibVs3A8i2nxZbfPAYmYB4X62mXFn2m7eD4JQxQzU7pQfa4oNVqdDl X-Received: by 2002:a17:906:3b01:: with SMTP id g1mr4278376ejf.353.1594910752799; Thu, 16 Jul 2020 07:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594910752; cv=none; d=google.com; s=arc-20160816; b=Lqgaxg0D05lODDmQeC50YN9kO/cQrjzxIh6hrVYTG3/w+8XWwv9NUhqQYlf9EFT4mM T4dkIsa/wqSJwzqeK8PGd7nfDP8Ksg2gQaI1H/+bRo634bz3qLsJEKynIvrBq4zskQ64 G+gQzBh5Z1fi6KnKxwdn9lcTBaI9xzOj+fJB5WjiKUR3q4zydbKV05LiJNxZSPQ/zuam Gq2FpkhrdGnSt+kBnaqG9FSZaOiqBSPjV55wH0mvwnjSq+fcJMMf1H5CBMsdg8/fpN6S D4eQU35TQ6pPMpKOF1XwuCqcaSD8ZX+iLdGWqS6kDHMCk+iQlzLYr6z+ZoHg4xnQ4862 b7HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KEqbgXg5bolFCkaEREfRLUaB6wjIdNl0kMgYuxyNxpI=; b=oaJ2hwhK3rzvwTGetrR7PgWEHaU0GkL4QiOgYVZCBHFX4KzyObow+ckoGBxXMCPfkF Gw6JhmZV1HQow7ZLV19zjfk41dJRiA0b9ni7xFv4ZGho9JpDigM/V0x43f1SYUPbRW3j ZNg+N0vaEvEMF9SwjlRxM9Fw3LqC50LRQ/drapprP1WBMy8t4TiTWl+35dAs8gLx56/Z b4s1xc3ekG8Pv+JOXyKBtD9c45LGutDbO3j/1ejCR5El4CifJal0I1tYnc2EW6pWxri9 LPmOMqex4w/9J4JjYaUFnjZhPqVGL4s8VHoBQPgLBizIYg8LzpBC0q6mrJukUumRp9A7 /S4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GEjIqLiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si3306499edy.575.2020.07.16.07.45.29; Thu, 16 Jul 2020 07:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GEjIqLiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728237AbgGPOpL (ORCPT + 99 others); Thu, 16 Jul 2020 10:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbgGPOpI (ORCPT ); Thu, 16 Jul 2020 10:45:08 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B47DC061755 for ; Thu, 16 Jul 2020 07:45:08 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id s9so7412194ljm.11 for ; Thu, 16 Jul 2020 07:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KEqbgXg5bolFCkaEREfRLUaB6wjIdNl0kMgYuxyNxpI=; b=GEjIqLiPxGWf30Xto3dr/VRzc+jve2MqdPGTM9sUQj6SX8bHj0uzqXyVE5K8msut3n LcgTNQNJqtw7IemIFS+OMy8vmAQJCY2yQD7IgTshitTlPFcWnVmsuYJ0Z2hDwfzIKbUJ cKheZtsoJichKATZ899iNX3ePelWfAebfy3ARo5wiIs/R4Ud+5wEUK8+rmEAaUYXT4EQ dVl7m668gegN7uHOzqeusAgXDr24DBP48h/z5g7LjaM5rNfYR1pD6vD7nw/+P7k2Db7a 4tu57r9py1rEFDd2fujZs9B4aNhKOTlR4jVM85AT7LS+H2TzMmskAYFNea1MPtilOpHP uxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KEqbgXg5bolFCkaEREfRLUaB6wjIdNl0kMgYuxyNxpI=; b=VQcYYnWstCY56BCYEVylgwXBuTrlSh4mPR7kM/+jvlGw2mrdH1ormllGgtX/6BN9YV vme7ztFPh4Is3t+Yhv88mXhGgddFhnNBhDuepmTMgXyMrCO1zm/vor1H1Lj9b8/YefGn ko+B/gyJslsvXr8+nNV45Yon7p0FI3cN1TaOqTpq9JUy8S6UC1at3PpDZQQmTDWyTWpN o1INHK6eHS/ZTsHxaJb+20txb10Tc011gnAzOzC/zDvJxip1ORj8nUzx9znOLoq/+sAX vcXxkgC0yr/re83zjAcFn1Uy2xNNGt2jVIZXpXkgHETS0ds5COA+1clMFxTF8Ei7p+be 2J9Q== X-Gm-Message-State: AOAM530RDsDKDWQLsNkkY111hgr9piwrW75f/meIFVhWTTP5kmTitsCy IGaxf65zampNciMtLiY/4lrH0ePS0yslj5BfShiUTRJwfse7Sw== X-Received: by 2002:a2e:b054:: with SMTP id d20mr2073091ljl.55.1594910706505; Thu, 16 Jul 2020 07:45:06 -0700 (PDT) MIME-Version: 1.0 References: <20200712131003.23271-1-madhuparnabhowmik10@gmail.com> <20200712131003.23271-2-madhuparnabhowmik10@gmail.com> <20200712160856.GW9247@paulmck-ThinkPad-P72> In-Reply-To: <20200712160856.GW9247@paulmck-ThinkPad-P72> From: Naresh Kamboju Date: Thu, 16 Jul 2020 20:14:54 +0530 Message-ID: Subject: Re: [PATCH 2/2] kvm: mmu: page_track: Fix RCU list API usage To: madhuparnabhowmik10@gmail.com, "Paul E. McKenney" Cc: josh@joshtriplett.org, Joel Fernandes , Paolo Bonzini , rcu@vger.kernel.org, open list , X86 ML , kvm list , frextrite@gmail.com, lkft-triage@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Jul 2020 at 21:39, Paul E. McKenney wrote: > > On Sun, Jul 12, 2020 at 06:40:03PM +0530, madhuparnabhowmik10@gmail.com wrote: > > From: Madhuparna Bhowmik > > > > Use hlist_for_each_entry_srcu() instead of hlist_for_each_entry_rcu() > > as it also checkes if the right lock is held. > > Using hlist_for_each_entry_rcu() with a condition argument will not > > report the cases where a SRCU protected list is traversed using > > rcu_read_lock(). Hence, use hlist_for_each_entry_srcu(). > > > > Signed-off-by: Madhuparna Bhowmik > > I queued both for testing and review, thank you! > > In particular, this one needs an ack by the maintainer. > > Thanx, Paul > > > arch/x86/kvm/mmu/page_track.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c > > index a7bcde34d1f2..a9cd17625950 100644 > > --- a/arch/x86/kvm/mmu/page_track.c > > +++ b/arch/x86/kvm/mmu/page_track.c > > @@ -229,7 +229,8 @@ void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, > > return; > > > > idx = srcu_read_lock(&head->track_srcu); > > - hlist_for_each_entry_rcu(n, &head->track_notifier_list, node) > > + hlist_for_each_entry_srcu(n, &head->track_notifier_list, node, > > + srcu_read_lock_held(&head->track_srcu)) x86 build failed on linux -next 20200716. arch/x86/kvm/mmu/page_track.c: In function 'kvm_page_track_write': include/linux/rculist.h:727:30: error: left-hand operand of comma expression has no effect [-Werror=unused-value] for (__list_check_srcu(cond), \ ^ arch/x86/kvm/mmu/page_track.c:232:2: note: in expansion of macro 'hlist_for_each_entry_srcu' hlist_for_each_entry_srcu(n, &head->track_notifier_list, node, ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/kvm/mmu/page_track.c: In function 'kvm_page_track_flush_slot': include/linux/rculist.h:727:30: error: left-hand operand of comma expression has no effect [-Werror=unused-value] for (__list_check_srcu(cond), \ ^ arch/x86/kvm/mmu/page_track.c:258:2: note: in expansion of macro 'hlist_for_each_entry_srcu' hlist_for_each_entry_srcu(n, &head->track_notifier_list, node, ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[3]: *** [arch/x86/kvm/mmu/page_track.o] Error 1 build link, https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-next/DISTRO=lkft,MACHINE=intel-corei7-64,label=docker-lkft/815/consoleText -- Linaro LKFT https://lkft.linaro.org