Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C81DC636D4 for ; Wed, 15 Feb 2023 11:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233475AbjBOLBb (ORCPT ); Wed, 15 Feb 2023 06:01:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233345AbjBOLBY (ORCPT ); Wed, 15 Feb 2023 06:01:24 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F4F37B54 for ; Wed, 15 Feb 2023 03:01:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 311AFB8211B for ; Wed, 15 Feb 2023 11:01:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47A77C433D2; Wed, 15 Feb 2023 11:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676458880; bh=IMpmER3plSrPEyPwHBO12hKRit2F+CRHQYxnU1U6els=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=rqBMGlSiJgKY90EQOFovxSh9ADuPOUNWZE+X8gR/i0cEFSHTbrgeywn70TtcxC0UA 3ZFJXPubTVzGnIC4YT+KbY0JByUFpPwssZ3d8KmDhypEQdZlxF3VMh5ie1ZU2p7G/Z e2T4e4Hi8xjpH6KrZJhgnJvza88+U00MkKN3KX25JEtrwFobB+TZM900Qvk6jWDXGY YXV1urK78wjt8ZESoCp53dq5xuCg1z06hXDeUFHaW+6T7Ut5HGAQ16otXKyf7416lW 2Tv8aSUgE3+xdBkO84wNS9CsCo05PkTX8j4c2a6MepFonn9+aG9beW3kiyvHZ2tE0j tnYvWZcHLudBg== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Changbin Du , Guo Ren Cc: Conor Dooley , Changbin Du , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hui Wang , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Conor Dooley , Zong Li Subject: Re: [PATCH v4] riscv: patch: Fixup lockdep warning in stop_machine In-Reply-To: <20230215034532.xs726l7mp6xlnkdf@M910t> References: <20230202114116.3695793-1-changbin.du@huawei.com> <20230215034532.xs726l7mp6xlnkdf@M910t> Date: Wed, 15 Feb 2023 12:01:17 +0100 Message-ID: <87wn4j42gy.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changbin Du writes: > On Wed, Feb 15, 2023 at 09:24:33AM +0800, Guo Ren wrote: >> On Wed, Feb 15, 2023 at 8:22 AM Conor Dooley wrote: >> > >> > Hey Changbin, >> > >> > On Thu, Feb 02, 2023 at 07:41:16PM +0800, Changbin Du wrote: >> > > The task of ftrace_arch_code_modify(_post)_prepare() caller is >> > > stop_machine, whose caller and work thread are of different tasks. The >> > > lockdep checker needs the same task context, or it's wrong. That means >> > > it's a bug here to use lockdep_assert_held because we don't guarantee >> > > the same task context. >> I'm trying to delete all stop_machine in riscv, from ftrace to kprobe. >> When I have done, we needn't this patch. >> > Which approch would you use? I looked through the riscv-spec, but didn't find any > description abount concurrent modification and execution. CMODX is not specified for RISC-V yet, unfortunately. This has been discussed here [1]. Maybe we can start with stating for which implementations Guo's approach work? [1] https://lore.kernel.org/all/CAJF2gTS0s4X_uwLaEeSqKAyRmxCR2vxRuHhz7-SP2w4bBqzr+Q@mail.gmail.com/