Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4274839ivc; Tue, 3 Nov 2020 07:35:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoZ9HKn3oFcUPeOo3kqfcXFeWmKngSuP1BOGvHb+G6GH7P/zbIl/9hqMDKP9je0TWYFZ8s X-Received: by 2002:a17:906:c1d4:: with SMTP id bw20mr20178617ejb.91.1604417738928; Tue, 03 Nov 2020 07:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604417738; cv=none; d=google.com; s=arc-20160816; b=VOUKH5KIGV5OxGjDqqVAtH4mmIaVrffQCmK4h1KTCq00c9s1pH+grk6C5wbzNOyOjQ 2+7W1VbXO+jZmtfDRPAjoS9Lmnry7z8hHbQgUx6XCpxComHSsOMcmzmfWcguyk/Dw+ff jEg03ruKp+0RvApDzeznkYfctMN3odCxoldruwdzv3MgrkPlEth8vJHO+LJgg8y2aj+D lmLjjPh6UYev9m4gp9scBlvimh8+lmTdGZtNx3h3Ync2oqidus9Sc39iDjULeBBAsj9Y AOYTEN3nYjjp9oAQFqRMHlD1fyEqKY7SL1PBrV+9BUSMLvTEDActGiyuPZCESwCR6QYf J5cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vOkFShIvcUzC6IIWe+nbZVspE2Bn0Jpu0DWyaTr22tE=; b=mJDZ+z6EU/fmjC6cmdHweZL5JhksC3k34SPgHwtqXwlkMujcNdBNpbHG0Woq457Vv8 3PHGs2gyqAI6c2p5+bimvd1x6j/CAGBcp8CjqhA4tYDfGo3Eod58IcEhcdmxck7Nh/O4 t9tL5b/bHADyIr0zObR0izhf/bd4IOAYepAx0i7PhJiQ1XpBBAOv49av+XpXXvZ0exv3 bWmwA/a3nWIyGEi7/pMgb/QyBz1AXJa5L7aHo7fVFLywEnIw38vwdWB9GxwPs3cbgTuw zoud7tms0yltvIuuc3STvlSo5AECYFl0MwWRfl2skHgZrHDWKoouQGek9HDP80nllFRq +y5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=iVpnDUGA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk8si12380240ejb.729.2020.11.03.07.35.12; Tue, 03 Nov 2020 07:35:38 -0800 (PST) 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=@atishpatra.org header.s=google header.b=iVpnDUGA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728270AbgKCPdu (ORCPT + 99 others); Tue, 3 Nov 2020 10:33:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgKCPdu (ORCPT ); Tue, 3 Nov 2020 10:33:50 -0500 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEACC0613D1 for ; Tue, 3 Nov 2020 07:33:49 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id u21so8281485iol.12 for ; Tue, 03 Nov 2020 07:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vOkFShIvcUzC6IIWe+nbZVspE2Bn0Jpu0DWyaTr22tE=; b=iVpnDUGADTtM5z9B1Q4fm0j2KOKhtLqzlicMhnj6QMjWubr0WU6JCZKmwrUuLHkL+L ms6mmflECGT5Sh2YFs5yRkunpFjFnlD2q2/dVjPa+O871RG3vL9vcdq+6LIV95O5emvQ l0Sp7tRysizsxqLa3vWHxhkewEeIoLiJO1k9Q= 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=vOkFShIvcUzC6IIWe+nbZVspE2Bn0Jpu0DWyaTr22tE=; b=p7k0yQ2YteEIaEFY9kKZDDeIu4XJha72rHtFYTFT7CIYFVzfF+C3DzSDBR25ZCD8Oo 7vgydIdEa6ELWVn45zsnHj3jspNNrxGVikXqhV1MyVKvATVsrJGG1QvA2eM9S7sSFlxv 98vmOECRrwAqD/QlJ0uukf9CHJwSHB1gPi53gASjQ1BxFA9olsFYG+hegQhxvnXTOShd NbFiZwKusv6kFkOJ34rGTUBl+pVgfdW8h4vwdKWXam4wxQAYzzukO4XJXK6U/mCFGS0Q gV6/MO2Kk0W/nIUG6AB3laRc73nW7xAJ8Xzy9/BpkjgBdz90+wCr41sHqCIDgvzAMXAR oNcA== X-Gm-Message-State: AOAM532strAGVSpKwBLCSjkcHpIzOUwIH+3qAkxBk6C03RFlKnLW74a0 tUMCuKJdBmo7Z6WgbHVIwgFn19Bfp/AxCPI3M/+y X-Received: by 2002:a5d:9842:: with SMTP id p2mr14701308ios.113.1604417629220; Tue, 03 Nov 2020 07:33:49 -0800 (PST) MIME-Version: 1.0 References: <20201021073839.43935-1-zong.li@sifive.com> <20201030202818.72070cbd@oasis.local.home> In-Reply-To: From: Atish Patra Date: Tue, 3 Nov 2020 07:33:37 -0800 Message-ID: Subject: Re: [PATCH] stop_machine: Mark functions as notrace To: Guo Ren Cc: Steven Rostedt , Zong Li , Paul McKenney , josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, vincent.whitchurch@axis.com, Thomas Gleixner , Paul Walmsley , Palmer Dabbelt , Masami Hiramatsu , Greentime Hu , Colin Ian King , rcu@vger.kernel.org, Linux Kernel Mailing List , linux-riscv Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 31, 2020 at 12:42 AM Guo Ren wrote: > > On Sat, Oct 31, 2020 at 8:28 AM Steven Rostedt wrote: > > > > On Fri, 30 Oct 2020 14:47:56 -0700 > > Atish Patra wrote: > > > > > > Look at arm64, they __kprobes flag and I guess it would also prevent > > > > ftrace call site. > > > > > > > > > > Are you sure about that ? __kprobes puts the code in .kprobes.text section > > > which is under whitelist sections in recordmcount.pl & recordmcount.c. > > > > Correct, ftrace can trace functions marked with __kprobes. That said, > I guess wrong, thx for correct me. > > > the instruction you are looking at here, is in a file that is > > blacklisted from recordmcount. > > > > CFLAGS_REMOVE_insn.o = $(CC_FLAGS_FTRACE) > > > > All ftrace flags are removed from the compiling of insn.c, and every > > function in that file will not be traced. > Yes, arm64 prevents the whole file from ftrace. My patch just use > notrace flag setting on some functions. > > @Atish How do think: > CFLAGS_REMOVE_cacheflush.o = $(CC_FLAGS_FTRACE) > CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) > Looks good to me. What should be done for copy_to_kernel_nofault ? That is also in the calling path. > -- > Best Regards > Guo Ren > > ML: https://lore.kernel.org/linux-csky/ -- Regards, Atish