Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1365440pxj; Wed, 19 May 2021 04:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqeACNEQxnDcvc2jkhSq9sTsLPINUadtgWz8sP2QDXxlBKLvVnjA3g7g51tfWfOyUP+Zdt X-Received: by 2002:a5d:84d5:: with SMTP id z21mr9218176ior.183.1621424049143; Wed, 19 May 2021 04:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621424049; cv=none; d=google.com; s=arc-20160816; b=VFZ8KgMX4emYPHVYVSze1Bjm2NTc/x5CuVroG7ohz+SdJGAAYPPT/5qQX5BprKlhnw bBMEW25Zbd/Rz60nB+gqMsiJExgO4IrEGq4q1IdJvOaxmtA+WIyq9ttwJIvK67PGMWn5 8sZ1bcQtsicMtr5bLA1w1FdQYXMR36+of/t09mLBr15JBQqeSSecBT84Ozpxa+eVwOTf 8kpiDR0FIjeWQgzZOjJfoMyellQ4+6and/fKw6vm8rjABPo8iq45LbKg5syPg+0Ds9rU uwc5ZrUu+3cRsjjjZ/2UuI5YE69QQG7X+1L+FOTGELCjygYUfcebetBEI94u4vA8Z1Ji b6Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=HtVYMIJVCcdPMV1ZIQfaVF7WDdZ7Z5IeSQsP+a0c6/Y=; b=gGBfCuWGDWsuQWfab44vG6HwY+18HoDtfPKeLmizzI+gle3wgLVMm8WRq69c/eme8N PhNPIu5vbFAgUoAvsIW0wbNNs42K3aN9sajeeEDHwWFi9d6KwRMx1tMw+07JkWIq1twB /oCVGV6J9LNyfeWFkH7NoAkdZAYNw31zHZSXzHHWT7tyI/ORxfgs5kzrvvkGwIc+Xaus vUl5dYyN2UUjJwqBQQEmeEwhieQDz3MZNjcRsMeYGx43DOIQ/Fr9v6y79o5F278NvG+L IE7MPeh4/4nwfLJO0KTGcq/UBkaPWVUbGhs3BGNKjQ591DsCXld/HdH34Xdy8ad4pw8w Akxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Re1ARGvG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si22339345ilg.25.2021.05.19.04.33.56; Wed, 19 May 2021 04:34:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Re1ARGvG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345671AbhERC50 (ORCPT + 99 others); Mon, 17 May 2021 22:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238859AbhERC5Z (ORCPT ); Mon, 17 May 2021 22:57:25 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53B0C061573 for ; Mon, 17 May 2021 19:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=HtVYMIJVCcdPMV1ZIQfaVF7WDdZ7Z5IeSQsP+a0c6/Y=; b=Re1ARGvG6OoD/+bc1RstFAz9EW xNnEKrivytc77Y5KGJicIPFm19nPLrrmdPOrXjXzB6LhcIEq8f1rZxaXe6e/wMesVdfvjx98MjB+4 NEx83wvtKdBwzYVGpe1A3kT39kUiDxMTIkJTGPpNFYuO9wzVJWwf6k0aL6tkS0zXCq8+tnt27M03M SY7UDnxHSgHvnPiPhYonqqdQi513L1FcNMbO8I9pTsh7wfcvpr6Q1ADabiqUQ0krd9sGEYafqBjST 9U2sQLQYARD8vSXjX4CY5bItqJ1Uf2KuT2nXD7ApuvcEaRLxjIumOexzVQny+BKeb3bhFchrvAW8K M1d5f+BQ==; Received: from [2601:1c0:6280:3f0::7376] by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lipti-00EHK1-AP; Tue, 18 May 2021 02:55:54 +0000 Subject: Re: [v6 1/1] x86/bugs: Implement mitigation for Predictive Store Forwarding To: Ramakrishna Saripalli , linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, Jonathan Corbet Cc: bsd@redhat.com References: <20210517220059.6452-1-rsaripal@amd.com> <20210517220059.6452-2-rsaripal@amd.com> From: Randy Dunlap Message-ID: <20c6fa3d-949d-156a-6d74-89829e3bffdf@infradead.org> Date: Mon, 17 May 2021 19:55:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210517220059.6452-2-rsaripal@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi again, On 5/17/21 3:00 PM, Ramakrishna Saripalli wrote: > From: Ramakrishna Saripalli > > Certain AMD processors feature a new technology called Predictive Store > Forwarding (PSF). > > PSF is a micro-architectural optimization designed to improve the > performance of code execution by predicting dependencies between > loads and stores. > > Incorrect PSF predictions can occur due to two reasons. > ... > > Kernel parameter predictive_store_fwd_disable has the following values > > - on. Disable PSF on all CPUs. > > - off. Enable PSF on all CPUs. > This is also the default setting. > > Signed-off-by: Ramakrishna Saripalli > --- > .../admin-guide/kernel-parameters.txt | 5 + > arch/x86/include/asm/cpufeatures.h | 1 + > arch/x86/include/asm/msr-index.h | 2 + > arch/x86/include/asm/nospec-branch.h | 6 ++ > arch/x86/kernel/cpu/bugs.c | 94 +++++++++++++++++++ > 5 files changed, 108 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 04545725f187..a5f694dccb24 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -3940,6 +3940,11 @@ > Format: {"off"} > Disable Hardware Transactional Memory > > + predictive_store_fwd_disable= [X86] This option controls PSF. > + off - Turns on PSF. > + on - Turns off PSF. > + default : off. and as I did earlier, I still object to "off" meaning PSF is on and "on" meaning that PSF is off. It's not at all user friendly. If it's done this way because that's how the h/w bit is defined/used, that's not a good excuse IMHO. Hm, it sorta seems to be a common "theme" when dealing with mitigations. And too late to fix that. I look forward to h/w that doesn't need mitigations. ;) -- ~Randy