Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp887559pxb; Wed, 27 Oct 2021 14:30:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCNTrlsy1bTa93ohh+Wfqkl/LS4buelUcbnHXhAj5RV3v4c+qufMFszA4urtiks97jBk8+ X-Received: by 2002:a17:907:6d82:: with SMTP id sb2mr77253ejc.201.1635370212072; Wed, 27 Oct 2021 14:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370212; cv=none; d=google.com; s=arc-20160816; b=PvyldmVRN9+LlK9Y+JTJgg01AVAjfVQ0g0bHLgESjJkstT3RCwwC1r5rLBIE6WXOrS AMCHiGGTlK0r6ZTPE6GseJTGvmg/8I6y53hpxgTf2U8LDTqTlmh5FzAMQUFtR3WNvDlT OSKiZOoV09NizO1VcOz5nSZP77JT1P7nx2E+0f+m9R+bI3C7h9t2ij5bMBbqwuuXf0ZE OZsdrxb2HI9BD3WVPlog+jcjZrnSUm64UkSCpebtxSa5t8cA2tB6GH+IlE510PdOvwWY edd5EPeoOEdjdbIXxx6HWQfZtvDnKSR3QB+PMGlM7rHrLMv5TIGn42sKFJTYKDb3JSYa F92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=DvIwhXdeH0bKthXRzPqStEFs19Q8Pn9BY0Ld8zgL3BA=; b=HZ57d8cZ+iIONrLYxVbMER2juVH66sKab91W41ts0iAvZl0pSSIBTJdpb2LSCKVR+L n7XF+jKKFDlRkNfMqdx1WqFvbj4iRaFx1KtjHsFki1ZIa/mwl4zZQKetJTY8QZd1CXWa SmPnivzgY6SG5L0CBbSqjHhKn1S5Q27P+DI5FN6XXCjsdLlRwS7n44jdRps/+efCpXdq P0bo6vy5V7/qRuuWvFNQdQB1lsFrrnhPqV3k/qgClWeH6CriNRDj9OnjnPRsxRZbqlP6 IrGPO7GQzfKn1xiCJ5JInmeQ8Y4hx0N16HwxStTfc6DfJZASj/deYKiL0dQuyhzaKcWW 2Yng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=tExYXoo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si1559503edd.342.2021.10.27.14.29.49; Wed, 27 Oct 2021 14:30:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=tExYXoo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237906AbhJ0QRu (ORCPT + 97 others); Wed, 27 Oct 2021 12:17:50 -0400 Received: from linux.microsoft.com ([13.77.154.182]:53142 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbhJ0QRt (ORCPT ); Wed, 27 Oct 2021 12:17:49 -0400 Received: from [192.168.254.32] (unknown [47.187.212.181]) by linux.microsoft.com (Postfix) with ESMTPSA id 5B2512034CB7; Wed, 27 Oct 2021 09:15:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5B2512034CB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1635351324; bh=DvIwhXdeH0bKthXRzPqStEFs19Q8Pn9BY0Ld8zgL3BA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=tExYXoo54lVvG2m6Ei1Z/rvIH8DX7KSn7e7FJnYb/wud1mywvbC++w632dhi1ppW7 VmHSyylStge+1aY7qGAPA8IYjhkNq+9IdEWQaGDXAeYieMmPcflbu4ksDXHhGImpNk oFhj3OlytJaJSJV9WNeVlRKtLJkkMGGC8/2+ksXE= Subject: Re: [PATCH v10 06/11] arm64: Make profile_pc() use arch_stack_walk() To: Mark Rutland Cc: broonie@kernel.org, jpoimboe@redhat.com, ardb@kernel.org, nobuta.keiya@fujitsu.com, sjitindarsingh@gmail.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211015025847.17694-1-madvenka@linux.microsoft.com> <20211015025847.17694-7-madvenka@linux.microsoft.com> <20211027133212.GG54628@C02TD0UTHF1T.local> From: "Madhavan T. Venkataraman" Message-ID: Date: Wed, 27 Oct 2021 11:15:22 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211027133212.GG54628@C02TD0UTHF1T.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/21 8:32 AM, Mark Rutland wrote: > On Thu, Oct 14, 2021 at 09:58:42PM -0500, madvenka@linux.microsoft.com wrote: >> From: "Madhavan T. Venkataraman" >> >> Currently, profile_pc() in ARM64 code walks the stack using >> start_backtrace() and unwind_frame(). Make it use arch_stack_walk() >> instead. This makes maintenance easier. >> >> Signed-off-by: Madhavan T. Venkataraman >> --- >> arch/arm64/kernel/time.c | 22 +++++++++++++--------- >> 1 file changed, 13 insertions(+), 9 deletions(-) >> >> diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c >> index eebbc8d7123e..671b3038a772 100644 >> --- a/arch/arm64/kernel/time.c >> +++ b/arch/arm64/kernel/time.c >> @@ -32,22 +32,26 @@ >> #include >> #include >> >> +static bool profile_pc_cb(void *arg, unsigned long pc) >> +{ >> + unsigned long *prof_pc = arg; >> + >> + if (in_lock_functions(pc)) >> + return true; >> + *prof_pc = pc; >> + return false; >> +} >> + >> unsigned long profile_pc(struct pt_regs *regs) >> { >> - struct stackframe frame; >> + unsigned long prof_pc = 0; >> >> if (!in_lock_functions(regs->pc)) >> return regs->pc; > > This can go -- the first call to profile_pc_cb() will use regs->pc. > Agreed. > With that gone, and the include updates to use : > > Reviewed-by: Mark Rutland > I will make the two changes. Madhavan