From patchwork Fri Jan 12 10:11:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 187666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp75533dyc; Fri, 12 Jan 2024 02:13:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEM68XugTKlNF7mFgBSe8uOt0QlKeDi2huPO3wNJran7z4IbJPeWrBajXayih8fYeolnbD2 X-Received: by 2002:a05:6870:648f:b0:203:b1d9:35d5 with SMTP id cz15-20020a056870648f00b00203b1d935d5mr1150303oab.83.1705054386069; Fri, 12 Jan 2024 02:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705054386; cv=none; d=google.com; s=arc-20160816; b=SJa2Ce9E1rdDjfaJetnM+oHXod0puqs6DzIxVr25QO2lzVuNG0gUhTysPye6/jnhtX OnwTDQSfzP7jCXYxiRmwj3gEQq2XE8cU8Th7OacqLF9gxHZesHDDq/SkanU53c76W5T0 DY5fmmpHUQ8fRMXamCOoAzcn7zZrLQrWAoRiJf5zI9IvnNGQBLSHQ22sd55fGH+Er33d 33mImCAn638D19h223bxZE+cwc5vPgi3cQxllGv2p8/0eAcbUOARMDGQBJbJjBhDQI1P ngtMl9RIbtRHfttKk4jVshQAyG6pK83W6lIBlsu/DpHKQ7qtUbN1cYi2YULgypK0Axjl yKnQ== 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=6UWyW+HZQB9PkPidfS9kyGvOgCmjAVd9N756+zbkz8k=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=TAC8/aKBtprVi5A6NPY4Vgye9J5tOlBjalNkp4KQtOsNqZvwyl9bOXnkwLlBnFzzg8 BE6ETNpGhxy7obv+NJzOoa4hv5tq57ih7CLUwHsX3nms8TTrwlEJaGM5YNt2jKNMS1Ft +F9M5TaixF0hueBqAerz4CTUeQCaOCjNspgu0W7bTH4U5d8kJdbNUVt4hKJ3TazQDgfj cX23wBLMlVe7WksT0tLMyaaIe2qyCQOFIBoI66kX2Lby32adKdGp6G78WC3blaOAkaNX cTzhDSFxVl5tsb0MpqarBMasc0UMB/uqChW+mI+HJD8R7gPLSyOagFUJ7S6lwqzzBUa1 6jhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HF2671RH; spf=pass (google.com: domain of linux-kernel+bounces-24550-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24550-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q15-20020a65684f000000b005ce030e060esi2884864pgt.859.2024.01.12.02.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 02:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24550-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HF2671RH; spf=pass (google.com: domain of linux-kernel+bounces-24550-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24550-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D0852288741 for ; Fri, 12 Jan 2024 10:13:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC13C5FF05; Fri, 12 Jan 2024 10:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HF2671RH" 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 14E1C5D8FD; Fri, 12 Jan 2024 10:11:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54C4C433F1; Fri, 12 Jan 2024 10:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705054304; bh=Ky/M8O0rm7AMIWcFwVKGUXTVtEFqfb+EU9Ru8C9PH5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HF2671RHXzBZjyIFr2oK37ExQQxAEIZbEA5QLEKMwoqaAhZUDEKsZrW9jflnrSt15 YrKNbHKfN6wdUjafevCtXNHRY4CrjzEWLNhhnKpB3OIJJUMM7GluVvzSgjVojlcaXW kjW2HiyyV6sbtY1xyhMExWNpxeljWKg3Ld7gZ3uHDj1RG5kH9N1F4zMJBllj5p9EFl c3++IvgbbqG5KOozgPjd3mqMd3c3JEvdN9l9E6lLUf28i2QAnK1IHixw1+2ETD6vAP QdhZVIkOln/M4TcFpYe7lnbeYuhQkuu747zDUqt3v/BYzaQ0JHzl/H02+czPVwQbmG 2hvWBVAKnE41w== 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 v6 04/36] x86: tracing: Add ftrace_regs definition in the header Date: Fri, 12 Jan 2024 19:11:38 +0900 Message-Id: <170505429822.459169.14866081576830532227.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170505424954.459169.10630626365737237288.stgit@devnote2> References: <170505424954.459169.10630626365737237288.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: 1787879107666171341 X-GMAIL-MSGID: 1787879107666171341 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 cf88cc8cc74d..c88bf47f46da 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; };