[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fxgzzp3yokq24swgfkokdnqb7jf53s3na2wjitr5koiamfizgm@d7uvxnuzkebd>
Date: Thu, 16 Oct 2025 14:34:22 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: David Kaplan <david.kaplan@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>, Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>, Alexander Graf <graf@...zon.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 03/56] cpu: Reset global mitigations
On Mon, Oct 13, 2025 at 09:33:51AM -0500, David Kaplan wrote:
> +#ifdef CONFIG_DYNAMIC_MITIGATIONS
> +void __weak arch_cpu_reset_mitigations(void)
> +{
> +}
> +
> +void cpu_reset_mitigations(void)
> +{
> + smt_mitigations = SMT_MITIGATIONS_AUTO;
> + cpu_mitigations = CPU_MITIGATIONS_AUTO;
> + attack_vectors[CPU_MITIGATE_USER_KERNEL] = true;
> + attack_vectors[CPU_MITIGATE_USER_USER] = true;
> + attack_vectors[CPU_MITIGATE_GUEST_HOST] = IS_ENABLED(CONFIG_KVM);
> + attack_vectors[CPU_MITIGATE_GUEST_GUEST] = IS_ENABLED(CONFIG_KVM);
> + arch_cpu_reset_mitigations();
> +}
> +#endif
Considering this will have no effect on other arches (or even on x86 at
this point in the series), should CONFIG_DYNAMIC_MITIGATIONS depend on
an arch-specific CONFIG_HAVE_DYNAMIC_MITIGATIONS?
Then the weak function can be removed (and weak functions should be
avoided anyway, IMO).
--
Josh
Powered by blists - more mailing lists