Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp589108lqb; Fri, 24 May 2024 07:31:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWM7Wd0vx3OSc+MjVbTwjyMcLHNRGcL5vdfeqQ1VxezeOwGvOLljiyczJL7jnjeaf47R/esZTjKLWcHNlF+2Zr+L+gFS7jLE2mNOIkOmw== X-Google-Smtp-Source: AGHT+IFwsp1BSQ1uvxrVp4C8Xm3vO0pOsLUDNahQOQKirzHsEn0OPaqP3VElBOBDOZNiC9rX58tp X-Received: by 2002:a17:906:5a70:b0:a5a:1562:5187 with SMTP id a640c23a62f3a-a626512942fmr172459466b.55.1716561070115; Fri, 24 May 2024 07:31:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716561070; cv=pass; d=google.com; s=arc-20160816; b=M01YEFaWoob+zAssyhXsy0herk48cnIw69l5IMv1XvRB9UbbMct+LEkaHthyKFqqV9 qUm2xAhYNt3TfEfzc4bDYmxO7e6iFfPUFLFW6M0Jk7/nJenPIQCYThChK5VL1q9D7YXj qrjju9Qu+yFHdxuR3WEAwJULT64maLg93ZFk/uaWyuKdtkAI7GebXK3kiL5Ng3ZBZ0nY ikso/01Lgl3iTfxRfP25RwIzYEjM4x6qSv5J7WkabCi/OqCRE0DSpgqkAHhFPMAHdNi2 quj68arDNCn+wxkVAZaZrV57kx06LQNR9JwCtyPuAvLCvHWgAxtH1AGm6rDBKx5bcr/7 mBlg== 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=Ol0oKFBhXUyjXYMjv4/u4aS0azeHDwlbuuBhWWpNJpo=; fh=VaF/w+FGpk/prTFLJfCoV+GJDmV0Sd6dt8EMZrBTbz0=; b=rAELosRp1Vc5bW8ZR4Arkc2+NBQlMp3a4EYby+x9cRcUvOjXiPN2eZ633SBHMxS7Az d8O/rm81taVSXi8QS0zxBQ7qbnySkUhHPtUWDmDexOZNOcyQ8Q1+ZmNLdnT4muwWd9D4 yrpLBOX+8bqvdGswFWtZT725Z6XmSzATUkjGjeYjVTB1ZLivKmhzYCJKoEyzFGeQA+lh F2ARwDpF21AAzKMBIrTEc3Kd/IaW7JYFYIe7acWBGDZ1gOe/g0f6Ru/62RNQiTJFOmdj Hm4S4RE6XTihUm5LE1H3FK8G/e6+Y4oqHnDvW6+diLNqFQXAEVMckIhqhAbg2uir74J/ ztWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-188792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188792-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-a626cc6667dsi86080966b.588.2024.05.24.07.31.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 07:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188792-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-188792-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188792-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 C89281F21FEE for ; Fri, 24 May 2024 14:31:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD8E112C53A; Fri, 24 May 2024 14:31:01 +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 2BB0F1AACC; Fri, 24 May 2024 14:31:00 +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=1716561061; cv=none; b=r2KVktV2AXWqbIUoZ/LhU7G+8oQX2hRAwIHy4c6yLs4bbOb/9P1XpaUS358rx6XS4oXnLrikArJAb+xGagw/mg75SPcHFTM6AIYOs2oEqTNBBjuhysAp6aSTzBHT7HnH/Y2nn3WSyUa7hY27vW2Lwn336TCZgyskzI2Ydf4M4rw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716561061; c=relaxed/simple; bh=aOZq1tNo2kEdYYZTGQpJMZiV8l/3wuWC+gR87EmXRAY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SWgFwn1e0Dax7p3vwytrHcKHLk05SEP1vrxU6sUuFVHnvYp4TD6zjoxgIHsmhS9QzOSX+WOAGfvXf1qGnrzC1hYWsfi326CmA3MiZ1kEhBFarwspF6KG98c7ggXJHkSgNs8ArEMGrizsB0tOZCTfaXBb622SHJOjmr5kyYUShvg= 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 84EB9C2BBFC; Fri, 24 May 2024 14:30:58 +0000 (UTC) Date: Fri, 24 May 2024 10:31:44 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" 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: <20240524103144.4cd800c0@gandalf.local.home> In-Reply-To: <20240524103754.1df43a670eeb15bca9df48c7@kernel.org> References: <171509088006.162236.7227326999861366050.stgit@devnote2> <171509091569.162236.17928081833857878443.stgit@devnote2> <20240523191459.3858aecf@gandalf.local.home> <20240524103754.1df43a670eeb15bca9df48c7@kernel.org> X-Mailer: Claws Mail 3.20.0git84 (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, 24 May 2024 10:37:54 +0900 Masami Hiramatsu (Google) wrote: > > > > > > #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"? Yeah, on x86_64 ftrace_regs uses regs.cs to denote if it is valid or not: static __always_inline struct pt_regs * arch_ftrace_get_regs(struct ftrace_regs *fregs) { /* Only when FL_SAVE_REGS is set, cs will be non zero */ if (!fregs->regs.cs) return NULL; return &fregs->regs; } -- Steve