Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1996134pxp; Thu, 10 Mar 2022 17:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJx811yV7+ZiXxEK0jLCnzu/4cNi0Dnfa39R7Mbafgee+Sivt3kQu2I91FGzAk6fhGtFqwi8 X-Received: by 2002:a17:907:3f10:b0:6da:818d:4525 with SMTP id hq16-20020a1709073f1000b006da818d4525mr6408002ejc.47.1646960586964; Thu, 10 Mar 2022 17:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646960586; cv=none; d=google.com; s=arc-20160816; b=tM3J65G13PAxV/9dXA13peqZcD7iFE3K2IiJlHwONX8adT40jJ0ArNNypvsKf7XXDo qPQ+ThXqGpwk0OCEZnOGPKgX6MJyfCK8Ad8ygC9dkbVq7F0UI4bKHBbf3nUZYGTB0jGO f1EzzMCbphNKfU52dW5KgxGCQMFmVoXe57xBrwVytKfNv792GwhpmVKeaHOve6tyzeUW 14Eaz1NagXZbJaHBG4iB5QXcgvtO3AQT99CZ8m0th8/bIHVJS1ERkez2+FGr6FTv2+hk pHleaUqMQbbRqksNx1K/LuEWKDVcEIeEmPG10nUdML0S3UFAMUAJzywJh5oL5xaOaXpE rnOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=OPwjEOVfSKMg03wh8hgpRipjhrtGILbbTNqy0u/NRmI=; b=D9twA5qNdVtFmhlavl75aFEswctScMJOw89qvxyZgJ0aR73GiQOU19iedz7K4ICc8a vS/UFixEpoNXHt/VgAlYHcg5YX7hRLd1Y/7uLeP324dhReGG12mGihqGwVyDOQOZfZEB NbiwPu34hPJhYL61Bs6XgkJTbYPP39fZtza6HyrmsVzWZUp+T0YEx8k266hr6W8jWaWW TuDJDrOj+auuXm3awVPS5P+EwXQbBIbFKCn1fkaDdCcrQhBAeNahTS0QiDwdUg3e4McS nSQwlClxoRxmIdtdQwor3JM7M4GuAIowYgAr4l4qgqvrujKXbfKz7Wb8RfEPLVN2Kbsr K/Zw== ARC-Authentication-Results: i=1; mx.google.com; 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 qw35-20020a1709066a2300b006cf65c4495bsi3984599ejc.57.2022.03.10.17.02.44; Thu, 10 Mar 2022 17:03:06 -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; 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 S245290AbiCJOjZ (ORCPT + 99 others); Thu, 10 Mar 2022 09:39:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343875AbiCJOb0 (ORCPT ); Thu, 10 Mar 2022 09:31:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B501C9A3C for ; Thu, 10 Mar 2022 06:27:45 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EF72061CF0 for ; Thu, 10 Mar 2022 14:27:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94C99C340EB; Thu, 10 Mar 2022 14:27:43 +0000 (UTC) Date: Thu, 10 Mar 2022 09:27:42 -0500 From: Steven Rostedt To: Changbin Du Cc: Paul Walmsley , Ingo Molnar , Albert Ou , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: ftrace: no need to acquire text_mutex when executed in stop_machine Message-ID: <20220310092742.4fcc7131@gandalf.local.home> In-Reply-To: <20220310045454.672097-1-changbin.du@gmail.com> References: <20220310045454.672097-1-changbin.du@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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, 10 Mar 2022 12:54:54 +0800 Changbin Du wrote: > It's safe to patch text segment in stop_machine. No race is possible here. > Besides, there is a false positive for the lock assertion in > patch_insn_write() since the lock is not held by cpu migration thread. > > So we actually don't need our ftrace_arch_code_modify_prepare/post(). And > the lock assertion in patch_insn_write() should be removed to avoid > producing lots of false positive warnings. > > Signed-off-by: Changbin Du Ideally, RISC-V should try to get off of the stop_machine approach, and move to the breakpoint modification. -- Steve