Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2174797ybh; Fri, 17 Jul 2020 11:04:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCRrewv//SfL82GgOYFnr7thceU//W+WXqd2+AlhivFmjfZ9ozSPm1GfnGiLf2+gzCfvad X-Received: by 2002:a17:906:410c:: with SMTP id j12mr9564391ejk.284.1595009080418; Fri, 17 Jul 2020 11:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595009080; cv=none; d=google.com; s=arc-20160816; b=MVv+Gs/zpdTZ0JedQPuPdgHx92URnDEmzbqrbjs+BxbJ4pxRxReBC4z7B2GnzDJA7i TyQnvqY4mMktJkR3iUhx0udlIs33HuK4CBu9th7HCSgyQ5lEsmrMtsRr519wPD6d4zRj 0vzB0WSuWf+v1KFf3gZpcc+2OqvQbTPL37ci1DIiGFFHWSyh52L4Jl5j7JwcnzwXecZr r3GooM6z1+ts1qLjTCMvRD9FbBm43o/KmwBZ1Um+wdxzCyLHkqpVSzXtTe9wy4a4pv0k xAGWQzSyrzT5P+rulbcvDxHQGosfu0wH/cp6o6Dtve/bghTFWztrnpG5RsbYmw8DU9tI 5bOw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=luRf2VFyr0NmiSmannOi4zh0OF91VllQcnlKgm+zo4g=; b=aqd5aZOLeBr/mqk5HYY/s/gaULtmB4rmAqV4TO/w3E2ZHHlY5ltTTjYW1S+X1LHjO6 Nr3evWH9GWgETKixwQN6dPC8QhEl/QxAkFAyEWJFlZ9HS1MoB2pXAqWVQpnfASiifGaL lMDzMH94qAOgfqIyQZmDquFqjB0oEemLmnOawdeuv2eI2vhsEQk45qu8jK5Sp6ztNDhk 7Q/9cYdaT1fWX264zK5ILl9sIVZI6SaiwcGvWe+XPGriAa45GrWHyozxkYMqEbYVw4Hm VJ8FYOMlSe66GqrjERikZ6r3LlMPLFH2f98gWpNAyreLv2gK6SJxVsMw3w+KyHAPyUUY k1DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jjIz257p; 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 re20si5702462ejb.31.2020.07.17.11.04.16; Fri, 17 Jul 2020 11:04:40 -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=jjIz257p; 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 S1728202AbgGQSDX (ORCPT + 99 others); Fri, 17 Jul 2020 14:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727940AbgGQSDV (ORCPT ); Fri, 17 Jul 2020 14:03:21 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25987C0619D2 for ; Fri, 17 Jul 2020 11:03:21 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id g37so7477842otb.9 for ; Fri, 17 Jul 2020 11:03:21 -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:content-transfer-encoding; bh=luRf2VFyr0NmiSmannOi4zh0OF91VllQcnlKgm+zo4g=; b=jjIz257pmSzixZ6M59Q5Resoy9nbHEMelsdZf823TfLrgjwGDb7vB5NY4nFO+Jy0GX L/x5uyqhNZY/xrevkQ6Gi8Z6wemYY3u5ZFBpwds2VtBQZSWHsnKaVSJeQfX+OGdLmd2b ntkea8vhu6+W/wmUWNX6dfLyrhyA0OQedD8hpSVScQeXDHo3hVJBaLXxdEu1Aa41gDMd kbGlLUz00fIq5s4/8MFgPge87CaG9rGYOIrJhMRvj4NMC8XZkf3ggWEjG9GOTAETPl8y ZP3uCrL8eS5qlr416OZtRCscFNc2MOlHNbsYmK+wCGPl2rpG6y9Bgi7ZIm0tLylbrIp5 GoqQ== 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:content-transfer-encoding; bh=luRf2VFyr0NmiSmannOi4zh0OF91VllQcnlKgm+zo4g=; b=VfXY5kwPCp6R3UW6nVWl/wZTkZWxbVZEGkW0Dw/9uEVazTcIHADaWsan8lMhyLWYF3 qFZW87NBUXJfsc86a1Mwjqx0+hdpXQEdAwyoo1F0pNoKX8223Y/rS/E+N+e4YaWLCfAa RBYwEM0lKfhQ74siSA1jXPYHEhNCcg0++dBibq6cX/rMECYrLwq/Gt9tHCPyan22D4Zl 5fX5000Y4+IyRgGUKLEAiMcHuVEZZ/aNC5PpH4ArDHyDkWhlgOihss+LDcuANvUjOaNO wX+XqHpdVo5htP/NzobI5wZ5VeB/Tmyx8cYOgxGZivB/NJxC4JjPpj7wGpJ4lR4QS6Wq Tv1Q== X-Gm-Message-State: AOAM530m8OSNg0sDS6Q3YumbI+AvIT4Ap1IHou4/vEcmo4UfGtYgf0S2 7yj73fFtnQMCCdb1sESi3zX2ZfHYffErq6L+2GJ/tg== X-Received: by 2002:a9d:6a11:: with SMTP id g17mr10315659otn.50.1595009000242; Fri, 17 Jul 2020 11:03:20 -0700 (PDT) MIME-Version: 1.0 References: <20200712131003.23271-1-madhuparnabhowmik10@gmail.com> <20200712131003.23271-2-madhuparnabhowmik10@gmail.com> <20200712160856.GW9247@paulmck-ThinkPad-P72> <20200717170747.GW9247@paulmck-ThinkPad-P72> In-Reply-To: <20200717170747.GW9247@paulmck-ThinkPad-P72> From: =?UTF-8?B?RGFuaWVsIETDrWF6?= Date: Fri, 17 Jul 2020 13:03:09 -0500 Message-ID: Subject: Re: [PATCH 2/2] kvm: mmu: page_track: Fix RCU list API usage To: "Paul E. McKenney" Cc: Dexuan-Linux Cui , Naresh Kamboju , madhuparnabhowmik10@gmail.com, Josh Triplett , Joel Fernandes , Paolo Bonzini , rcu@vger.kernel.org, open list , X86 ML , kvm list , frextrite@gmail.com, lkft-triage@lists.linaro.org, Dexuan Cui , juhlee@microsoft.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On Fri, 17 Jul 2020 at 12:07, Paul E. McKenney wrote: > > On Thu, Jul 16, 2020 at 05:19:52PM -0700, Dexuan-Linux Cui wrote: > > On Thu, Jul 16, 2020 at 7:47 AM Naresh Kamboju > > wrote: > > > > > > On Sun, 12 Jul 2020 at 21:39, Paul E. McKenney w= rote: > > > > > > > > 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_r= cu() > > > > > as it also checkes if the right lock is held. > > > > > Using hlist_for_each_entry_rcu() with a condition argument will n= ot > > > > > 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/pag= e_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 *vc= pu, gpa_t gpa, const u8 *new, > > > > > return; > > > > > > > > > > idx =3D srcu_read_lock(&head->track_srcu); > > > > > - hlist_for_each_entry_rcu(n, &head->track_notifier_list, nod= e) > > > > > + hlist_for_each_entry_srcu(n, &head->track_notifier_list, no= de, > > > > > + srcu_read_lock_held(&head->track_sr= cu)) > > > > > > 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=3Dunused-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=3Dunused-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/DIST= RO=3Dlkft,MACHINE=3Dintel-corei7-64,label=3Ddocker-lkft/815/consoleText > > > > > > > Hi, we're seeing the same building failure with the latest linux-next t= ree. > > I am not seeing this here. Could you please let us know what compiler > and command-line options you are using to generate this? It fails with gcc-8 and gcc-9, but it builds with gcc-10. Quick way to reproduce: [host] docker run --rm -it -v /linux:/linux -w /linux tuxbuild/build-gcc-9_mips [docker] make ARCH=3Dmips CROSS_COMPILE=3Dmips-linux-gnu- defconfig [docker] make ARCH=3Dmips CROSS_COMPILE=3Dmips-linux-gnu- mm You can use these other Docker containers: tuxbuild/build-gcc-8_mips and tuxbuild/build-gcc-10_mips. Logs for those builds (and allnoconfig, tinyconfig, with gcc-8, gcc-9 and gcc-10) can also be found here: https://gitlab.com/Linaro/lkft/kernel-runs/-/jobs/643978135 Greetings! Daniel D=C3=ADaz daniel.diaz@linaro.org