Re: [PATCH v11 13/14] perf/x86: Rename and move get_segment_base() and make it global
From: Peter Zijlstra
Date: Thu Jun 26 2025 - 09:07:37 EST
On Wed, Jun 25, 2025 at 06:56:13PM -0400, Steven Rostedt wrote:
> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
>
> get_segment_base() will be used by the unwind_user code, so make it
> global and rename it to segment_base_address() so it doesn't conflict with
> a KVM function of the same name.
>
> As the function is no longer specific to perf, move it to ptrace.c as that
> seems to be a better location for a generic function like this.
>
> Also add a lockdep_assert_irqs_disabled() to make sure it's always called
> with interrupts disabled.
FWIW, I recently found we have a second 'copy' of all this in
insn_get_seg_base() / get_desc().
Its all subtly different, but largely the same.