Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp150259rbe; Wed, 28 Feb 2024 15:33:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU4t73szrDr+xfsfDBFyKY9Q3G290mJAmm9gV+bUfPLd+y6aG5FtkoDyPQjw8IqKXYs7iTtZkDsglyEFpljUGGkEOsKBelWxwbqwGnhDQ== X-Google-Smtp-Source: AGHT+IEeS24gl4rgdKLPSUsrVA8wdSbu9GlVSx89gripxcj04en9Qe2/gMd6TaqKAb/B0Ip0qCfC X-Received: by 2002:a17:906:f198:b0:a3f:9629:d305 with SMTP id gs24-20020a170906f19800b00a3f9629d305mr248768ejb.28.1709163191731; Wed, 28 Feb 2024 15:33:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709163191; cv=pass; d=google.com; s=arc-20160816; b=B38KV0hspBO4iy8QryREvcZx9l+m0RO+xDxidI19eHwueczptwFjH0QZ75+rT549vF Bk6qi1J42FRVRKRjRZ5A5NZdDxiPlSBjL28+MDmOPY8AzN7kqU8KH4IuNkhk8Gb5YGu6 ndbh1KJ2oNMfqB+e4P00gpTuybh0rK4sh7/LVvr9U8IELwqqRueWRMLpSwfgshF2lXOf yr8S0036CcwrBCTENHlsp7tOp/zf26/AOMIn+kTWAzD68rHUmx9uwktF42Q5M2ky+gph 3zFPK2yd2XU0HAGFzjPbk6n397qlsTbLI5DMSfYc/cl7GSnb2NxsFKjlployTV9eIIOV FNog== 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=E2qV5G0WPVM2Oiy3l+U6k+Mnl/f+W2rZBIgi/cH74WU=; fh=kgycG3zR6gvcta/VyGexiM2c3LHfZkyXo3CIgPse2TI=; b=LQUtG+1vLrzWUA4xUu1F73eM5E/az6zmxuXhQpSRUjmIPKlAKoY0/J3ycq5qnKcJ7h ep6tUUney9chgepgfOnn8isTOO4Xo30IIk93P6ABKbf95aNpt8F8l1Uk8gCWBZUcBAZC Xq+1L4x+FDqN8LaWGxkxKxdEbWBGfz45Ey6u5qCalfppUUZNIe+G9wDamTOaK2yIVAIB 0/ZVT0MDoWpqicujcsj/9GH2dr+scJ7cRjoSu6/ttEVqJDXlBcNwDJ8GXLVjvovvMEp8 NbsADgifZPVhnhnD84C8y6ml/vXj8qaIb+8VzC4SEZnflV7T+FR72lkldGhaXN6jWKui KeCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-85851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85851-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 n16-20020a170906119000b00a3f829ed319si23464eja.444.2024.02.28.15.33.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 15:33:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85851-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-85851-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85851-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 777961F2203E for ; Wed, 28 Feb 2024 23:33:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE6E571ECE; Wed, 28 Feb 2024 23:33:05 +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 376DC13D2FA for ; Wed, 28 Feb 2024 23:33:04 +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=1709163185; cv=none; b=pJol25tyqo8vsqhgUFpQVnA5xhkNZ+sJXi8XKEpP4mpqX6HPr4gyoeyBKh0XnhT90F9NLGS/CKxK/ie37iPF9j6NIzxyRkxs90iVqMFJgXLl94OqnxZMhaZmw0HUxWV+wiUhDUQTy72PIY5pmZMMrukoBws4PK8woR+jo+yaIIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709163185; c=relaxed/simple; bh=fmyNSUcPVp9b3i6F509Z6PDdFlXhI3KhBOJlRENZKog=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ro1c/ZLA0xJBFh/e3epcSw+w/zod9746dnmcjn2LkrlioiS7fR93w70axE1tBd52RmRxs7lRAJ2GNYbjb7Yia0oddhsGVcauCmHE8+YDMww2VQ17Y5mPoQOwP2D+F7WWkLTJH7tXHBuQIUtH6oTib9gvFZsxxyIQx9dPp6sDO54= 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 31A27C433F1; Wed, 28 Feb 2024 23:33:03 +0000 (UTC) Date: Wed, 28 Feb 2024 18:35:07 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Vince Weaver , Dave Jones , Jann Horn , Miroslav Benes , Andy Lutomirski , Thomas Gleixner , Masami Hiramatsu , Nilay Vaish Subject: Re: [PATCH v2 06/11] x86/unwind/orc: Convert global variables to static Message-ID: <20240228183507.78c5f130@gandalf.local.home> In-Reply-To: <43ae310bf7822b9862e571f36ae3474cfde8f301.1587808742.git.jpoimboe@redhat.com> References: <43ae310bf7822b9862e571f36ae3474cfde8f301.1587808742.git.jpoimboe@redhat.com> X-Mailer: Claws Mail 3.19.1 (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 Sat, 25 Apr 2020 05:03:05 -0500 Josh Poimboeuf wrote: > These variables aren't used outside of unwind_orc.c, make them static. > > Also annotate some of them with '__ro_after_init', as applicable. So it appears that crash uses "lookup_num_blocks" to be able to do back-traces with the ORC unwinder. But because it's now static, crash can no longer do that. Is it possible to make lookup_num_blocks global again? /* Not static so that the crash utility can access it */ unsigned int lookup_num_blocks __ro_after_init; -- Steve > > Signed-off-by: Josh Poimboeuf > Reviewed-by: Miroslav Benes > --- > arch/x86/kernel/unwind_orc.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c > index e9cc182aa97e..64889da666f4 100644 > --- a/arch/x86/kernel/unwind_orc.c > +++ b/arch/x86/kernel/unwind_orc.c > @@ -15,12 +15,12 @@ extern int __stop_orc_unwind_ip[]; > extern struct orc_entry __start_orc_unwind[]; > extern struct orc_entry __stop_orc_unwind[]; > > -static DEFINE_MUTEX(sort_mutex); > -int *cur_orc_ip_table = __start_orc_unwind_ip; > -struct orc_entry *cur_orc_table = __start_orc_unwind; > +static bool orc_init __ro_after_init; > +static unsigned int lookup_num_blocks __ro_after_init; > > -unsigned int lookup_num_blocks; > -bool orc_init; > +static DEFINE_MUTEX(sort_mutex); > +static int *cur_orc_ip_table = __start_orc_unwind_ip; > +static struct orc_entry *cur_orc_table = __start_orc_unwind; > > static inline unsigned long orc_ip(const int *ip) > {