[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87edb9d33r.fsf@mail.lhotse>
Date: Sat, 13 Apr 2024 19:27:36 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Stephen Rothwell <sfr@...b.auug.org.au>, Sean Christopherson
<seanjc@...gle.com>
Cc: Jonathan Corbet <corbet@....net>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave
Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org, Peter Zijlstra
<peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, Pawan Gupta
<pawan.kumar.gupta@...ux.intel.com>, Daniel Sneddon
<daniel.sneddon@...ux.intel.com>, linuxppc-dev@...ts.ozlabs.org,
linux-arch@...r.kernel.org, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Heiko Carstens <hca@...ux.ibm.com>
Subject: Re: [PATCH 1/3] x86/cpu: Actually turn off mitigations by default
for SPECULATION_MITIGATIONS=n
Stephen Rothwell <sfr@...b.auug.org.au> writes:
> Hi Sean,
>
> I noticed this commit in linux-next.
>
> On Tue, 9 Apr 2024 10:51:05 -0700 Sean Christopherson <seanjc@...gle.com> wrote:
>>
>> Initialize cpu_mitigations to CPU_MITIGATIONS_OFF if the kernel is built
>> with CONFIG_SPECULATION_MITIGATIONS=n, as the help text quite clearly
>> states that disabling SPECULATION_MITIGATIONS is supposed to turn off all
>> mitigations by default.
>>
>> │ If you say N, all mitigations will be disabled. You really
>> │ should know what you are doing to say so.
>>
>> As is, the kernel still defaults to CPU_MITIGATIONS_AUTO, which results in
>> some mitigations being enabled in spite of SPECULATION_MITIGATIONS=n.
>>
>> Fixes: f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs")
>> Cc: stable@...r.kernel.org
>> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
>> ---
>> kernel/cpu.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>> index 8f6affd051f7..07ad53b7f119 100644
>> --- a/kernel/cpu.c
>> +++ b/kernel/cpu.c
>> @@ -3207,7 +3207,8 @@ enum cpu_mitigations {
>> };
>>
>> static enum cpu_mitigations cpu_mitigations __ro_after_init =
>> - CPU_MITIGATIONS_AUTO;
>> + IS_ENABLED(CONFIG_SPECULATION_MITIGATIONS) ? CPU_MITIGATIONS_AUTO :
>> + CPU_MITIGATIONS_OFF;
>>
>> static int __init mitigations_parse_cmdline(char *arg)
>> {
>> --
>> 2.44.0.478.gd926399ef9-goog
>>
>
> I noticed because it turned off all mitigations for my PowerPC qemu
> boot tests - probably because CONFIG_SPECULATION_MITIGATIONS only
> exists in arch/x86/Kconfig ... thus for other architectures that have
> cpu mitigations, this will always default them to off, right?
Yep.
The patch has the effect of changing the default for non-x86 arches from
auto to off.
I see at least powerpc, arm64 and s390 use cpu_mitigations_off() and
will be affected.
cheers
Powered by blists - more mailing lists