Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1125251lqt; Fri, 7 Jun 2024 08:39:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWs5ZqledpTJ65V2kKwwhKjVhlXlS8SJlvHzYClj9ZW+j9Uxz1K85AsjM/dcnaeiGSjHUq87gv1QVKmiRbALkXaOcN+ZMOmXmQLCN6pcA== X-Google-Smtp-Source: AGHT+IEoekWGn29NCrroTirWILSu1E+TBVPocDmCA08f+PVz6s6OsIbaLGeOorZY4YOA6fk1WwmP X-Received: by 2002:a17:906:284e:b0:a63:4bc:704d with SMTP id a640c23a62f3a-a6c75f8ed69mr441705366b.1.1717774771759; Fri, 07 Jun 2024 08:39:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717774771; cv=pass; d=google.com; s=arc-20160816; b=bXfGqjPxTaC+1ETUj+JS4da8FAYL2tD20uJNukR407mG+vwDZfa0nWL3OSWa3XPAVG uvxit80AbwWR+jTzdyFcZDhg4/x8dlzVX/ubXBCIBAhBkAhpbbf0Ef0eLeiVNYq8hvIw s0+m3bkmaoWMvs3MhDXPGgNrlDVGEbOuHnk71BGS+WFxiKeEwOTmRgLs1k+w0xM5cqe3 M16QaHSLIkGz0Sj77tdWZmJ2jtDtP1aN0JYn1i6tvQ9t/oWBuoQdlo+w+chuXfmhB75H Q/yljB/6tN7rdtvF9saj0sIWCmu7vG9g1ZFAjGys3ATm1h3mYoUPnb5vLXi2EaHTZ8DL lYaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=iTAhw+Q5YeNb2p7ass625AItln8DQ72VIHISGL0liJk=; fh=UIgIcEyKpHeKZDavfhkVg8VEzjx1/QQfBnQYVt2NXQg=; b=OrkcDfrkVgBfRl21mROdspBh6kiqETCFhgaoP2OeIHi0BNXPpHnvPNOtV2YZksnQPr uXeqLzIXHoyv5w1rIpZBCom+MMV+bSJ1tNJ7gawaGFDpZqwaGpeianeKybiTWxQfF2zK rcbABOTxM+E7H4ENkVtkogG2fePXqeOzOwj8W2Ml43DhLz7tmsnwUhvfwtGaZp/1DMh5 MxDitNLTYqNZ09sNINiKNr6tC9RMqNClbFFBGrr1QVPie5+31rzM7rMLa8JZ4hU5ZypY WOWKqjXovjefzJsYIk3XWDKnbORrjR6Qn/dj6Yjquv5kduXbt3jMWMeONyZIp1dRUhRm lS0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206414-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80728bd2si196731766b.846.2024.06.07.08.39.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 08:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206414-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206414-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 79F931F2224F for ; Fri, 7 Jun 2024 15:39:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51FB9199E8D; Fri, 7 Jun 2024 15:39:10 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C173C171BB; Fri, 7 Jun 2024 15:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717774749; cv=none; b=lMFVMVH/sEhW1Hjf0re0sFCrz9Z0aWRJJXifAzNRnw9lv+wDBTDU4M8igQdrjfV/jkKa1rsq4GvdadwgYdNZvTo4VUPDTvyAR6mY90ZgcF8bCC49U5WhS7YhK53qYnEAhfyC/AFm/sp4bYdXBgq/tBT7pK2Jz7Hmej2GdVf9wIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717774749; c=relaxed/simple; bh=9YBVZftsl8VdYDDyZb7AS5ArgPy58OPMzPr+bbA826A=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K5Y0+mj+1a/pnRX49KTw08GmBpv+8Dhsjk8XZfavUI/5SOTv++EKsHg0jVoIH857uJoYY2D2GvV3kMIpTEVMy7TnNue/5K3BZhWOgo8Fme5AVyT25fS9d2HgoWXKCS9R0O51GAY3oEnmtT9lCXwuHyZwfvlPPWr3VAObIRTU7Lw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF982C2BBFC; Fri, 7 Jun 2024 15:39:07 +0000 (UTC) Date: Fri, 7 Jun 2024 11:39:22 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Zheng Yejian , mcgrof@kernel.org, mhiramat@kernel.org, mark.rutland@arm.com, mathieu.desnoyers@efficios.com, jpoimboe@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [RFC PATCH] ftrace: Skip __fentry__ location of overridden weak functions Message-ID: <20240607113922.17a62f86@rorschach.local.home> In-Reply-To: <20240607150228.GR8774@noisy.programming.kicks-ass.net> References: <20240607115211.734845-1-zhengyejian1@huawei.com> <20240607150228.GR8774@noisy.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 7 Jun 2024 17:02:28 +0200 Peter Zijlstra wrote: > > There may be following resolutions: > > Oh gawd, sodding weak functions again. > > I would suggest changing scipts/kallsyms.c to emit readily identifiable > symbol names for all the weak junk, eg: > > __weak_junk_NNNNN > > That instantly fixes the immediate problem and Steve's horrid hack can > go away. Right. And when I wrote that hack, I specifically said this should be fixed in kallsyms, and preferably at build time, as that's when the weak functions should all be resolved. -- Steve > > Additionally, I would add a boot up pass that would INT3 fill all such > functions and remove/invalidate all > static_call/static_jump/fentry/alternative entry that is inside of them.