Re: [PATCH] x86/CPU/AMD: Rename the spectral chicken

From: Peter Zijlstra
Date: Tue Apr 25 2023 - 17:00:20 EST


On Tue, Apr 25, 2023 at 09:50:24PM +0200, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@xxxxxxxxx>
>
> We've had enough fun with the spectral chicken bit - name it what it
> really does: it suppresses non-branch predictions.
>
> Rename defines to make it clear that it is Zen2 only.
>
> No functional changes.
>
> Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
> ---
> arch/x86/include/asm/msr-index.h | 6 ++++--
> arch/x86/kernel/cpu/amd.c | 22 +++++++++++-----------
> 2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
> index ad35355ee43e..0094e6a1b553 100644
> --- a/arch/x86/include/asm/msr-index.h
> +++ b/arch/x86/include/asm/msr-index.h
> @@ -625,8 +625,10 @@
> /* Fam 17h MSRs */
> #define MSR_F17H_IRPERF 0xc00000e9
>
> -#define MSR_ZEN2_SPECTRAL_CHICKEN 0xc00110e3
> -#define MSR_ZEN2_SPECTRAL_CHICKEN_BIT BIT_ULL(1)
> +/* Fam 17h, Zen2 MSRs */
> +#define MSR_ZEN2_DE_CFG2 0xc00110e3
> +#define MSR_ZEN2_DE_CFG2_SUPPRESS_NOBR_PRED_BIT 1
> +#define MSR_ZEN2_DE_CFG2_SUPPRESS_NOBR_PRED BIT(MSR_ZEN2_DE_CFG2_SUPPRESS_NOBR_PRED_BIT)

NAK, I had to write all this without *any* official communication from
AMD, mostly on hear-say.

This gets to be the spectral chicken forever more as punishment. Next
time AMD can try again, and if they manage to get their act together and
publish something before I get to write the code and invent a name for a
magical bit, they get to name it how they like.