Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp988476lqb; Wed, 17 Apr 2024 17:54:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/J2/KJLZiP6GEuXYWcXk/p0f8PWLoGPhRF7L7FGaVRiWXTrvGWXI0e/Xz7+r9fUn5VdlGqPZWHQRWjNDW5SE6f0Dg8zpQtNaRFEdCyA== X-Google-Smtp-Source: AGHT+IGDe1Yn82JXf9iTa+FxCAXyD85396fNCh8LCr9TjR3Y5fnycgdrjL/OVMtKd6qzezXPLsjI X-Received: by 2002:a05:6a00:aca:b0:6f0:28a4:a871 with SMTP id c10-20020a056a000aca00b006f028a4a871mr1506041pfl.19.1713401684758; Wed, 17 Apr 2024 17:54:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713401684; cv=pass; d=google.com; s=arc-20160816; b=wTJkXogkWFVzz8zkmyFjMrBxlVXSXrIiEUIPH+gEXxGxrapRaynmgtHNg2gjQjeeHH Oi6tDerBfTE//ZzNFj0CCR4Tx+Xy+ORVNZfE3hI9ahFV2F7V4EPTxDZGWARaolBLxKQ4 TUv8XahCZCkfFHC2mY39z+U2T5SqE2IhU/gJDLuhzUu3oiCU41z48L2cfSmKghjCtwGh rWhqt9ViSmULa6SmQhDXgrKG93u5YjjugiCnUw834JQKIPJII9PzVV3IQZ9zKPSkQZc+ iMGSlfnqIAfRQaavyih3o8bt7SoKNtYBxl/RKjHL2fMJIYLRCtaA1pPEyGbmMoUzBD62 Zrrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=aDG3p51AHQpbTq3NLy30yBtk1qMbUt6rlsMzU/0vs+c=; fh=EmKuk6fFwft8hv/FFaz5MtWJx2vCe6uYK3//34dkUUQ=; b=jNcTFzxku8ADzIp2vP9syQA+pp7XnSfEYLigcfis1AffAsoJ/kaKztwcPNLiF8lvmK GDiDe65EwL2q59EQS2/LEy6NX/cmu+AzKaHWhYRkv1NNma9f5x2buCQDdHRD93ZHcDtT xod18qaGa8nFUD+66RMvgtmvzNAtSOHY2C+tXj0jUGO3UNqYiWXcMmnaBYBr6E2UkgVD l5gLjQLk1//XnvEVDbyVK8t4jte2O8pCOXsRsuJAUriSJKaKIIgmG2H2qRzX9BB6Acan YSCLsXXGWG734t4FmIQGSKdEnkoy8Co1i7E3xZPgZvVWAIgO60e+Wn171a9bQ1ThnGjW JaLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=DYLgMPLH; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-149371-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149371-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ll11-20020a056a00728b00b006e6f9ce6388si392963pfb.195.2024.04.17.17.54.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 17:54:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149371-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=DYLgMPLH; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-149371-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149371-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 13C4B282D4D for ; Thu, 18 Apr 2024 00:54:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 801085684; Thu, 18 Apr 2024 00:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="DYLgMPLH" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D50E10FA; Thu, 18 Apr 2024 00:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713401677; cv=none; b=GYpOGkibDxn79A0QtkuiLBp3fEtX661OB2FXgIJ7i2Ste0wA1zq98u84ycUkn3OwbSc/KthkIo29yKNU/GQjSGKSHc5whm3RUiuLScJQNV11gzyOtlo+OEfbH2jls/FZyIuilDuJKtwwcnUgYvCBYaj8SZTfB90T5aL5Roik8BU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713401677; c=relaxed/simple; bh=wAfm/febHBO7WS9l7V3gS7eMe755bKnF0FqkdZH3vP4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KBEH401BF7zWeG/l/wtOY0ya9avyu5X3ofduSx9R2w8Q5Ad3ORCOJOtYNR4MPNfgflN0hSelfYPv7FLPSq8JQL0wZcihX8xf+W252FABf8ylZrbWxI2ww032eCzj3nIUBV7cff5eXrli3AiqigfkjXEG/m+yjZHoXaDY6I+4IfM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=DYLgMPLH; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1713401672; bh=aDG3p51AHQpbTq3NLy30yBtk1qMbUt6rlsMzU/0vs+c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DYLgMPLH7SaX85J65aHjr0TWwpsRnrweVRL98MhbWZ4q21Lei0zwZPOWNu7TrLJMN s4NbXruH9JqHTfkJzzzFgRcK1lKN+PZhkpIRJajRKan9W6hjirqxzCe3nLZMSV+YHH Kka/I2aV70qA10VAlOQYT8JmsOrJX9ICFnXiJ9a1CrzJKKbwaZBVc2b73zPr8kDAXK ZX3m6zOxVzMXijOKC//fdze2SFVKFuMe8tYzb/0MnypqftsXd82i2X/7U9b4YBq6ji crBIT26y2on2KH1wNgXIXH0rC28O9n8G6ztMcIj2p/Vzy8RsnknXWX0+iLogW+YQet r91oA7HDUjB4A== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4VKfS66FgYz4wjF; Thu, 18 Apr 2024 10:54:30 +1000 (AEST) From: Michael Ellerman To: Sean Christopherson , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Greg Kroah-Hartman , Peter Zijlstra Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Rothwell , Geert Uytterhoeven , Sean Christopherson Subject: Re: [PATCH 1/2] cpu: Re-enable CPU mitigations by default for !X86 architectures In-Reply-To: <20240417001507.2264512-2-seanjc@google.com> References: <20240417001507.2264512-1-seanjc@google.com> <20240417001507.2264512-2-seanjc@google.com> Date: Thu, 18 Apr 2024 10:54:28 +1000 Message-ID: <87jzkvbid7.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Sean Christopherson writes: > Add a generic Kconfig, CPU_MITIGATIONS, to control whether or not CPU > mitigations are enabled by default, and force it on for all architectures > except x86. A recent commit to turn mitigations off by default if > SPECULATION_MITIGATIONS=n kinda sorta missed that "cpu_mitigations" is > completely generic, where as SPECULATION_MITIGATIONS is x86 specific. > > Alternatively, SPECULATION_MITIGATIONS could simply be defined in common > code, but that creates weirdness for x86 because SPECULATION_MITIGATIONS > ends up being defined twice, and the default behavior would likely depend > on the arbitrary include order (if the two definitions diverged). > > Ideally, CPU_MITIGATIONS would be unconditionally on by default for all > architectures, and manually turned off, but there is no way to unselect a > Kconfig. > > Reported-by: Stephen Rothwell > Reported-by: Michael Ellerman > Reported-by: Geert Uytterhoeven > Closes: https://lkml.kernel.org/r/20240413115324.53303a68%40canb.auug.org.au > Fixes: f337a6a21e2f ("x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n") > Cc: stable@vger.kernel.org > Signed-off-by: Sean Christopherson > --- Thanks for fixing it up. Tested-by: Michael Ellerman (powerpc) cheers