Re: [PATCH v11 13/14] perf/x86: Rename and move get_segment_base() and make it global

From: Ingo Molnar
Date: Thu Jun 26 2025 - 04:45:06 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> 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.

So if you make an x86-internal helper function global, please prefix it
with x86_ or so:

unsigned long x86_get_segment_base(unsigned int segment)

Keeping the _get name also keeps it within the nomenclature of the
general segment descriptor API family:

get_desc_base()
set_desc_base()
get_desc_limit()
set_desc_limit()
[x86_]get_segment_base()

> Also add a lockdep_assert_irqs_disabled() to make sure it's always
> called with interrupts disabled.

Please make this a separate patch, this change gets hidden in the noise
of the function movement and renaming otherwise, plus it also makes the
title false and misleading:

perf/x86: Rename and move get_segment_base() and make it global

Thanks,

Ingo