From nobody Wed Jan 22 10:54:41 2025 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 478101C2304; Wed, 22 Jan 2025 02:32:06 +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=1737513127; cv=none; b=H3Tn/WxT0561kKjf/kI3wCLpEo/tI6FgPmNglBqOVsWVhD1V2fn0ssnP7UVjOqkVp44C5RvTe/NTKmvXBaYsWqUjpfjsWauj0Y1qXg7tEd/bZazpXVjxwQ0v5hCzl1qYQq2xT3KFQsVeWb2zbNTl8lxwKbdDXpmyRQr7OwSLqNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737513127; c=relaxed/simple; bh=GXuPggdOdnrO7sypEn586aKnLMgz6Grse8Wk7Tzz2xk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LZ2umTpam248s/7I/ERzhwuQDPl6AnNIdSRjjMDdRMLGAH4RSQApdbiZLGej/FBh4i1XQbvGXeUEl82zCOPPtayM/JgWpsXHTHrGys9cScqXmcmS1+/n3Jx2892eD0NZZpwnTfCuk5wSTXy70VM7+TceBjl4UaNsDJTxinQRORk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dd+hZewj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Dd+hZewj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD98DC4CEE0; Wed, 22 Jan 2025 02:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737513126; bh=GXuPggdOdnrO7sypEn586aKnLMgz6Grse8Wk7Tzz2xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dd+hZewjudMKRsvbtsDX3Q6bDYlpOmRBdrM8soW2pRqP151QF/RJmRnvhkZnHjMGv UR13luqOtqrGAfvEcxZaBmGz23L8ZskIWY13W+XrdgOBAR3G6EEs92Qx90Yw2lcW7y WaLlGl+JTvG4GHY5vVirFq4M2z4hNxOPvB+fiaFxTqPDjcJvRNvNch4GWCYkZ7rRrC M8kz7zq+GUpS0spYKqvVWI4IBFXpXoM5hMP+yfW1RJin5EDqzQgz+VjQxftcuRGWt2 nAMMbvkTHPYFG2Owh+/Q4Wl/uig1RNBWCNDHNQGdWYlXjQj3RP++7Hszi4Xm2CDZen QvmLsHM7jdM2w== From: Josh Poimboeuf To: x86@kernel.org Cc: Peter Zijlstra , Steven Rostedt , Ingo Molnar , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Indu Bhagat , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Mark Brown , linux-toolchains@vger.kernel.org, Jordan Rome , Sam James , linux-trace-kernel@vger.kernel.org, Andrii Nakryiko , Jens Remus , Mathieu Desnoyers , Florian Weimer , Andy Lutomirski , Masami Hiramatsu , Weinan Liu Subject: [PATCH v4 14/39] perf/x86: Rename get_segment_base() and make it global Date: Tue, 21 Jan 2025 18:31:06 -0800 Message-ID: X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" get_segment_base() will be used by the unwind_user code, so make it global and rename it so it doesn't conflict with a KVM function of the same name. Signed-off-by: Josh Poimboeuf --- arch/x86/events/core.c | 10 +++++----- arch/x86/include/asm/perf_event.h | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index c75c482d4c52..23ac6343cf86 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2790,7 +2790,7 @@ valid_user_frame(const void __user *fp, unsigned long= size) return __access_ok(fp, size); } =20 -static unsigned long get_segment_base(unsigned int segment) +unsigned long segment_base_address(unsigned int segment) { struct desc_struct *desc; unsigned int idx =3D segment >> 3; @@ -2874,8 +2874,8 @@ perf_callchain_user32(struct pt_regs *regs, struct pe= rf_callchain_entry_ctx *ent if (user_64bit_mode(regs)) return 0; =20 - cs_base =3D get_segment_base(regs->cs); - ss_base =3D get_segment_base(regs->ss); + cs_base =3D segment_base_address(regs->cs); + ss_base =3D segment_base_address(regs->ss); =20 fp =3D compat_ptr(ss_base + regs->bp); pagefault_disable(); @@ -2994,11 +2994,11 @@ static unsigned long code_segment_base(struct pt_re= gs *regs) return 0x10 * regs->cs; =20 if (user_mode(regs) && regs->cs !=3D __USER_CS) - return get_segment_base(regs->cs); + return segment_base_address(regs->cs); #else if (user_mode(regs) && !user_64bit_mode(regs) && regs->cs !=3D __USER32_CS) - return get_segment_base(regs->cs); + return segment_base_address(regs->cs); #endif return 0; } diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_= event.h index d95f902acc52..75956c68356f 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h @@ -639,4 +639,6 @@ static __always_inline void perf_lopwr_cb(bool lopwr_in) =20 #define arch_perf_out_copy_user copy_from_user_nmi =20 +unsigned long segment_base_address(unsigned int segment); + #endif /* _ASM_X86_PERF_EVENT_H */ --=20 2.48.1