Re: [PATCH v12 00/16] AMD broadcast TLB invalidation
From: Borislav Petkov
Date: Sat Feb 22 2025 - 11:19:47 EST
On Sat, Feb 22, 2025 at 11:05:41AM -0500, Rik van Riel wrote:
> It's crashing when writing the value to the
> invlpgb_count_max variable.
>
> This would be because:
> 1) invlpgb_count_max is marked __ro_after_init, making
> it read-only after the system has finished booting, but
> 2) get_cpu_cap gets run at resume and CPU hotplug time!
Yet another side effect of us reading CPUID gazillion times. /facepalm.
> Borislav, do you prefer I move the initialization of
> invlpgb_count_max back to where it was before, or get
> rid of the __ro_after_init thing?
You probably could move it back to where it was - cpu_detect_tlb_amd - and
leave it __ro_after_init because cpu_detect_tlb() is run on the BSP only so
I'm guessing resume doesn't bootstrap that thing...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette