Re: [PATCH v5 10/13] x86/process: Clear hardware feedback history for AMD processors

From: Borislav Petkov
Date: Tue Oct 29 2024 - 15:48:34 EST


On Sun, Oct 27, 2024 at 09:02:48PM -0500, Mario Limonciello wrote:
> +__always_inline void reset_hardware_history_hetero(void)
> +{
> + if (static_branch_unlikely(&hardware_history_features))
> + wrmsrl(AMD_WORKLOAD_HRST, 0x1);

Get rid of all of the other crap - the static key and that
reset_hardware_history_hetero() silly thing and do

/* Reset hw history on AMD CPUs */
if (cpu_feature_enabled(X86_FEATURE_AMD_WORKLOAD_CLASS))
wrmsrl(AMD_WORKLOAD_HRST, 0x1);

in __switch_to().

Nothing else.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette