From patchwork Mon Dec 18 13:11:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 180391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1233980dyi; Mon, 18 Dec 2023 05:21:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWZa2Dnye1J0UEgFVuN6yJovJ9HEMq/wbiwj9Nwqo304wifqth+FC+9AAP1BnpqvzlT3nS X-Received: by 2002:a50:f614:0:b0:553:7a4f:111b with SMTP id c20-20020a50f614000000b005537a4f111bmr141322edn.59.1702905668234; Mon, 18 Dec 2023 05:21:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702905668; cv=none; d=google.com; s=arc-20160816; b=nZcN+KHTrsuiimczw6dltAZiUckILOidSMEiVsLqWZ6PpqAkQFx+GdRJHpX16fWpG/ yxcRUXycFkUalH5zGlUqzzuWkA0y9g9+yvWL/UnAcYblDzM5XN+8CWl36Wdk222DHIb6 0CmKIZgkMIpUA+BmGd4kHjtYOR6K2oryH8/FKNESM4Rbktp7yxIXu5dmY87oGpoVS8NS gnrxaTKnlbRy8Z7LG0rdo5Jevzaab3Wel5XNj9Gtt6lYwvnkctBm7QuNyIc7YzoYKFsH 3+TtIIuNbH6xfZE6i8/1bZXNWcXAGg6rMRXVBw4vdbKJS6LbjMKC7cbOoojAr2bmpKfG ED7Q== ARC-Message-Signature: i=1; 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:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=6u8M/yEtWeoJVCEoLcNsgpoGnmlGQaiNnoviOD6fD5k=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=o0/TvetUShJXzr3UEu0yNPqnIwC0HtzL2T91XpBlDg+H9gUCld5TEF7mWDUYlZDZOY 3QAJgCGgZ0PE3PDjoS5IfazTVwfVlDMXqrOqps60KoUdqJ4PIulxfZHf+ZxUbawLet0L dEFXlgj+RBX3volqAJfVi+VSY2agGj1uYTKaDbKo8d6KBcpSomToXDf5V3bx6P+eYwTV QI2XlkNo3D9tvw4WOdvldYCJBApI+YVe6t1gt3ULzzgMAVr6ch/dYlwCxg0XcdTQEuD+ yl66iv0KnQQ8SnLjn0YcMLZGd09usbL7J1OE+4F8ouAZZcAI3OmLw6MNsJLhqzU52JId vpNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wv7hkwnN; spf=pass (google.com: domain of linux-kernel+bounces-3705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3705-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c39-20020a509faa000000b005530123b2f2si2077074edf.624.2023.12.18.05.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:21:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wv7hkwnN; spf=pass (google.com: domain of linux-kernel+bounces-3705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3705-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 F24B41F24D17 for ; Mon, 18 Dec 2023 13:15:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1155B4238F; Mon, 18 Dec 2023 13:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wv7hkwnN" X-Original-To: linux-kernel@vger.kernel.org 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 6C82242377; Mon, 18 Dec 2023 13:12:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32AFCC433C7; Mon, 18 Dec 2023 13:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702905122; bh=dL9JJoim7F8avDTUtPFPrZxdt2I1oZt3h3FTr1Er5xQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wv7hkwnNl3tILFI8jue5j9YrMdF3Z1ysJuAYY8ULBNMZcy1PgaTZ1maJGQT9rL3Kg CJ+ntPlzHKj8cEA3wSrKhYPOrjvNJy+Zd5QP9LIoHZymR2kJkbaBoabP8nJXGaPKcA CX4dIdSsvp7JjvVKFZTTshYEVNrg61IYwxzBGR7lZLGcgoszkep8nosW7ON2l5y0wO ntN37XdyiUkCusK+gD6W1QLixmj08tumlT0D16cNqJIZHE0148alFuGWyJFF1Z+ePN Geuyopvv0NHP6L8MfnnNJpcOKgRJz/oK6eQcj1UZHHPmUVj408dR9HP1+XeK7AXOzA +xG38PbrPxX/g== From: "Masami Hiramatsu (Google)" To: Alexei Starovoitov , Steven Rostedt , Florent Revest Cc: linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: [PATCH v5 02/34] x86: tracing: Add ftrace_regs definition in the header Date: Mon, 18 Dec 2023 22:11:56 +0900 Message-Id: <170290511615.220107.15482324998645275244.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170290509018.220107.1347127510564358608.stgit@devnote2> References: <170290509018.220107.1347127510564358608.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785626013850935893 X-GMAIL-MSGID: 1785626013850935893 From: Masami Hiramatsu (Google) Add ftrace_regs definition for x86_64 in the ftrace header to clarify what register will be accessible from ftrace_regs. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v3: - Add rip to be saved. Changes in v2: - Newly added. --- arch/x86/include/asm/ftrace.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index 897cf02c20b1..415cf7a2ec2c 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h @@ -36,6 +36,12 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS struct ftrace_regs { + /* + * On the x86_64, the ftrace_regs saves; + * rax, rcx, rdx, rdi, rsi, r8, r9, rbp, rip and rsp. + * Also orig_ax is used for passing direct trampoline address. + * x86_32 doesn't support ftrace_regs. + */ struct pt_regs regs; };