Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp265338lqb; Thu, 23 May 2024 18:38:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuDfS0i4SMjjehqTnxjKuyvkUUGXvGco4ZcWwoMd9huMjKoxdaY8Vgpfjh0upYabPURJZQDGMMF+f7m/4xlhNJb+I8LgQZOOzerLA+aw== X-Google-Smtp-Source: AGHT+IH9GYQm5G2rDYA564xaEFfHUMqkXbIugHDETknxf7bLTbfxNLqlPcEH4vzdi77UiXqIrmJz X-Received: by 2002:a05:6358:1286:b0:17e:53f9:6985 with SMTP id e5c5f4694b2df-197e50f2ef7mr152095455d.14.1716514690646; Thu, 23 May 2024 18:38:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716514690; cv=pass; d=google.com; s=arc-20160816; b=CzX00slgbGdHRE6PUBpmEGikD1wgOqUdATPjPPYfn7TXpbb0R7yAT7WRs+Tiz5eT6H FPPffRG0822r0mzYVV4CHLAnNstj9s0sfMB7i4gqEbJGsutjFKtS8OWPqX+wUHHwxf1N NTh69aC7AajIcJPpDMnlt6wDo7fQJ/5FgYMfV9iaNt/lq9vd9Q61XvlFH0N5k3isYVnT slexZ/BPIC8ISSyc+yez9rbm80ETM2epMgSlxmBdeepD9UnoUppydWjpYkdhctxhLXYy KCJGb5Sar3hY6/L/0RwOMLyGiecUn0snuBCQUMG2f9d1+SMhRujUHj4huzkM1axEXxfL 9isQ== 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:dkim-signature; bh=Nfif35gG/gKmcneW8HtvN4bSDBclqhnKbnQ0uHwWD1s=; fh=Ub95fBsiseQVLo56fdyDA2zH9Ec5p8qFryhFaIE+jLo=; b=nc/64h6Jeo/jhmJt+bb1YDEQptypRUtNzLPO5GwttEI6TEGAx47DMgBrHvmeV1acr+ X9Fl/q9S5kyPd4xj6HsOk955DTravVaFzqlzo6PBCt0o7tNG3zQGQhvJrC3kSRrlDxLq NU2zkEUlyCtBMDnBlUu/jVe5/WRIZbphrBfYgiX9pf+1tN02FFfxieuVCxnV+/Iga8Z6 yAUrxhb/0bUbe2zkdMlktWLcBZuXFLmoad0MSupL7GSO9XyjjGL0xuaLyVBYmqicbt7h KYyIvV7v7PrrfcCuo8tOL1G3xW2syztngPd9CmcZs91tpSRA6DXqILt3wApRFC/xO3jn PA+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovhcodTh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188209-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6822779bf6csi338982a12.302.2024.05.23.18.38.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 18:38:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188209-linux.lists.archive=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=ovhcodTh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188209-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188209-linux.lists.archive=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 38B8B2831B7 for ; Fri, 24 May 2024 01:38:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7CB1D52C; Fri, 24 May 2024 01:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ovhcodTh" 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 4A5BE2C9A; Fri, 24 May 2024 01:38:01 +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=1716514682; cv=none; b=OekxhGZDPUmFXdXbUtAeUd0X/CtpMm9c4td0tOCrJ75TFnTTaL7NHUrvxjsADYkJ7rPbUMQucvHNeYJQ5hZRB7JSJl2GhOwkfT7RNjYhI2JQvxlKebNyj+yVE2qNSoKzFKpwsPav4h2bBaaxVRguJC5ZtGgZu5zmk76CYX+F19Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716514682; c=relaxed/simple; bh=ERTEB/rrvFFUiItZl/zrUe64/CzxlWTyD7+e4trZpKE=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=l923e2EHy1TmxlMCi6X7C2ighEVrH1DmPz/8ea9h5A2cB+g354pUfInb4u9morjHL8mvqDglmG1VPkebW4e3b67ifBFEtS0NIIb7N/MIAEToC4wEAY2uKHx/hBdsMglSInPyrjXZHe581OEUGUAnnghw8MIIvvuLe05Pvqlw350= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ovhcodTh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15B4C2BD10; Fri, 24 May 2024 01:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716514681; bh=ERTEB/rrvFFUiItZl/zrUe64/CzxlWTyD7+e4trZpKE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ovhcodThVewrSpfrV9VkdW+LIyXHL6Q2eJf56rE0PCaSpfF+0XoQSs5O1nZ7xs4eP 0UDDForbp8uQDuC7Udc/xKn4Goz7aNHoIH/GxGejJCAxNh8oedzYzCWk8WB+YKwfdy xF3am6hLfYVXJr848LTH1gAKQYWPxL560khUp9DOlCR89KpMkkfgUltCXQTVD04jnF 1pXmZFYS8LdGVydogbh36SAEGHMr9zkh1OC7Zp0gLWoZdSiKxNppit/jowiMNJWq4d 3fruZG/0dGtxEf0GQ9KSWS7Rd7ygs0Qi9F8apaZvyqtgP4tYQs2Aei1MsvmrizZSrB dVI3rh21vfsxw== Date: Fri, 24 May 2024 10:37:54 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: Alexei Starovoitov , Florent Revest , 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: Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in the header Message-Id: <20240524103754.1df43a670eeb15bca9df48c7@kernel.org> In-Reply-To: <20240523191459.3858aecf@gandalf.local.home> References: <171509088006.162236.7227326999861366050.stgit@devnote2> <171509091569.162236.17928081833857878443.stgit@devnote2> <20240523191459.3858aecf@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (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 Thu, 23 May 2024 19:14:59 -0400 Steven Rostedt wrote: > On Tue, 7 May 2024 23:08:35 +0900 > "Masami Hiramatsu (Google)" wrote: > > > 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. > > Should add a comment that if fregs->regs.cs is set, then all of the pt_regs > is valid. But what about rbx and r1*? Only regs->cs should be care for pt_regs? Or, did you mean "the ftrace_regs is valid"? > And x86_32 does support ftrace_regs, it just doesn't support > having a subset of it. Oh, thanks. I'll update the comment about x86_32. Thank you, > > -- Steve > > > > + */ > > struct pt_regs regs; > > }; > > > > -- Masami Hiramatsu (Google)