Re: [RFC PATCH v3 5/7] x86/mm: Introduce Remote Action Request
From: Nadav Amit
Date: Fri Jun 06 2025 - 15:59:15 EST
> On 6 Jun 2025, at 3:03, Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
> On Fri, 2025-06-06 at 01:45 +0300, Nadav Amit wrote:
>
>>
>> So you may want to do some initial checks on the BSP as for
>> whether RAR is supported and what rar_max_payloads is (e.g., in
>> bsp_init_intel() ). And then on each AP, in something like
>> init_intel() you’d call setup_clear_cpu_cap() to disable RAR if any
>> CPU's max_payloads is different than the BSP.
>
> Grabbing the value of rar_max_payloads from early_init_intel()
> might make sense, since it is supposed to be a system-wide
> value, and not a per CPU thing.
>
> That seems like it would solve data race issues?
>
early_init_intel() is called from init_intel() so it
would be called both for the BSP and the APs; IOW, it won’t solve
the race.
Looking again at the code, I think that you should be able to assume
this data is the same on all cores and move the X86_FEATURE_RAR enabling
and rar_max_payloads setting into intel_detect_tlb() which appears
both to be the most logical place to put it and only runs on the BSP.