From patchwork Mon Nov 27 13:53:18 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: 170143 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3127166vqx; Mon, 27 Nov 2023 05:53:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjNDUFBTaj5E89N32zw1sShQDxF+ILbzyxAXvl6/FYI0eagUZNdogcAV+rkymL263WGADf X-Received: by 2002:a05:6a20:8f01:b0:18c:a983:a5f2 with SMTP id b1-20020a056a208f0100b0018ca983a5f2mr2822208pzk.29.1701093216738; Mon, 27 Nov 2023 05:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701093216; cv=none; d=google.com; s=arc-20160816; b=wfQOTdhR0qBEuX/qaJqFpGdAQL8FOHfPl5lKt0SPG/2iDIPlszcas5Gi8iMlqan1PW 9nP47+ahQvQyqUbjd4qpEc+ytQ53QZvsM7Rp34LInH7qOY4IYcYcW8gMjor7uEGDsSHC ULBdA0pmArqWNyHgjCHU2Jrj/yzyDxMZH90OVY1TlcwCnSnYrQC49ffEP8N84YBf7rxu 1y7i558C+b5sDiWAP36S4rSki+bOA2e7ujBcB0IXfiCO3lwPX50DsvYibCJG6P9a1IAC 4cJTXB6LX97uJUKgtufTghP8UuuSyt1V7+FmT0he6ktbBaZPBESXMsFl8GumuuINm0iG jEKg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6u8M/yEtWeoJVCEoLcNsgpoGnmlGQaiNnoviOD6fD5k=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=GGAHjJQzBrXf0hTyYkkdMfZYslSUR1FXJtUSyjFvZEMCf4efdTeZYvkCjlQyLZLjni YmGVpQq71ZMkiHXx81wzM0UA0gy5nCzR7yGITfeoFKg3EgKeL5SMDJUpCFtDlv76V7wc FTEK9xTdrAHviVpKH/twU/PIEmGRkhqqeov9Q45FSgYI1zuzahyojgnnDZWJ9kn9aDoM UNKmC2H9SPUCiU1yJw/5ardNYShAmP30nLOpc/HKCwVyJrcTn5Sztl5Vdrz/93UEw9iF rwt5SLqgu3qGVY1g1xpBJ5kRQKUqwMzBDtH/WjbV6SKM3dWI3OUZAkzOGoKPZcrIrxQp 4l/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Vm/jERzZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j15-20020a63e74f000000b005c2786b7e32si10214295pgk.812.2023.11.27.05.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 05:53:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Vm/jERzZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8C7D3809870F; Mon, 27 Nov 2023 05:53:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233286AbjK0NxW (ORCPT + 99 others); Mon, 27 Nov 2023 08:53:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233338AbjK0NxS (ORCPT ); Mon, 27 Nov 2023 08:53:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E07D72 for ; Mon, 27 Nov 2023 05:53:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0EBEC433C9; Mon, 27 Nov 2023 13:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701093204; bh=dL9JJoim7F8avDTUtPFPrZxdt2I1oZt3h3FTr1Er5xQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vm/jERzZ2fHzywwmEj0R+oEtJZprum1Ef+4LZK687lXtAzXVoPj/i0HSav4xiHpC/ 43HhdUl37/3LO0QaLmPk1cdYzEujLXJPP6D2PiBDOnbp8EBzPe/gfaq0aBwNg1Ttfk fgC5VT4tJ2No2tFIq7DCYvY31An+d7uQDDEXW9YEhbrj8Gr8sgEd8K7YhgWPJ3T9Tt m8dU9mof7YbNAb7z8Tj9tMxjGJF3yXZCMNWjFXJoUc2JFZTLqqRs8gZzz36fvwdUR0 Lhp0CGCQxJs++ZgqkXnddxvG7Low112u8Q3a66+uAMHVqXSKT6l1/xI2jUfQmf2VAT JTYZT9oouhJUw== 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 v3 02/33] x86: tracing: Add ftrace_regs definition in the header Date: Mon, 27 Nov 2023 22:53:18 +0900 Message-Id: <170109319767.343914.9766180271697584732.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170109317214.343914.4784420430328654397.stgit@devnote2> References: <170109317214.343914.4784420430328654397.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 05:53:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783725520600056577 X-GMAIL-MSGID: 1783725520600056577 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; };