Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp1619398rdb; Sat, 26 Aug 2023 09:50:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMquIG8if9xbyIxfqWz1ffSLJo4/BlI2M8xQrGosU64UOFjfbmrCktvWKZ1ojHV0i112b2 X-Received: by 2002:a17:90b:19c1:b0:26c:f9a5:4391 with SMTP id nm1-20020a17090b19c100b0026cf9a54391mr17558509pjb.26.1693068610857; Sat, 26 Aug 2023 09:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693068610; cv=none; d=google.com; s=arc-20160816; b=UjC6FYfjREK/pbppDHKgKWeEgZZ39B9CWCUYAAS2l5ysL9XrzC2eHBh3kS1sAfwUZ4 jACnujsd7P953LKaYquytlTcinTLNbZlMeEluz5LczQAP8WcY2NMMX/VGIMls9ixnd6f WBsvlYm55DvmxuU3ELrPBZLMELH32e7nVFe03WfDW/TQRAO66a9HtuWxu78K5sSeT+Yc 55nD1iGiBubsKTlZN1Rae3tm64eIoAS152EJU8EY0wTAtU+ty2ZrTChuIxnmR6r0/T5+ Cql7IPWb87Sp1FUyaaXqA2hrJbOHRd/3XbEzNhXFLAea5ad4WU0hD2+sg4iCPndgwFBa jE6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ucFqMoksp5n14OzdkTuSV0BYJB6wDG4i2x6kFP6rwPE=; fh=vPi7qY5P+mBIWCC8HGHe3eRAGEf032Rw4NqL7YfyCLg=; b=WWhG8Z5r98am1RZSbTQCldH1eh6eVtjvomM7RoBexlU6qrLYTZBFnSH5NvOzNeoUS3 hu4G/CoRpsJ9hZxNMpkCJJsxYe5r0yV+W7n9RtUaiOv0JezK1QWL9K/U9OT5fmyy8n4i xV8bIDCtN2MsCOmnDneVI3gn9WdHhT3DOmoyqMWX0KJotofzn2DJOhCJi/QPXTT4Cv4x Cg1d1W9v/eEq3e2/RF2GHY79csxG2X3qwiV/cEtWYoEyTKtDxKgjhIhi35q5RsLcliOS iLPbi5MHtoLNlHK2Ef9hWqX9/fa33kwJ7p8GdTmCMF5vfiDU30bhSKE6nzKT2wzRT7+4 zFbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DzGF2Xt7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a17090ab90700b00263c4af31f2si3972905pjr.157.2023.08.26.09.49.47; Sat, 26 Aug 2023 09:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DzGF2Xt7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjHZPp3 (ORCPT + 99 others); Sat, 26 Aug 2023 11:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbjHZPpX (ORCPT ); Sat, 26 Aug 2023 11:45:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846E919AE for ; Sat, 26 Aug 2023 08:45:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21BC3627D5 for ; Sat, 26 Aug 2023 15:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1485AC433C8; Sat, 26 Aug 2023 15:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693064720; bh=nA+MA1XZYDPu6nvn+EVt9YkyGx7UTRtZ6bKzI2prtgo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DzGF2Xt7CHGesJs4av4ISSW1PqvLtL+sK2Z5yZMjjjHeo4t6DvDIexC1E4+LuNUpD ZSOYpR6ey7j2CvAP07HUxBsZfq+CciGzXOx0hlMz9e590OigA1H74tX14v/fpm5guH hTAtZBC7WQw5va00xbHH6HBVXHZ6c0LcbNGqcjteK82fKBNH01qE/cBDNmC7EncpKM ZAREwWBlryeWUuks/hU4Aj2QUoddqAL2sNzMCEmVk+WF4gGsHVCU2sv+tBCELywu+J 4aXlWJ3s6FVmHBw8ieW/aVH2LKHdtEFgeZk0s4XjxdFeqMlH+TUAct3Z/o1oDhNGRV nBHo2R5hr33HA== Date: Sat, 26 Aug 2023 08:45:18 -0700 From: Josh Poimboeuf To: Nikolay Borisov Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Peter Zijlstra , Babu Moger , Paolo Bonzini , Sean Christopherson , David.Kaplan@amd.com, Andrew Cooper , gregkh@linuxfoundation.org, Thomas Gleixner Subject: Re: [PATCH 15/23] x86/srso: Remove 'pred_cmd' label Message-ID: <20230826154518.rwu5wyerqhefmhon@treble> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 25, 2023 at 10:51:04PM +0300, Nikolay Borisov wrote: > > > On 25.08.23 г. 10:01 ч., Josh Poimboeuf wrote: > > SBPB is only enabled in two distinct cases: > > > > 1) when SRSO has been disabled with srso=off > > > > 2) when SRSO has been fixed (in future HW) > > > > Simplify the control flow by getting rid of the 'pred_cmd' label and > > moving the SBPB enablement check to the two corresponding code sites. > > This makes it more clear when exactly SBPB gets enabled. > > > > Signed-off-by: Josh Poimboeuf > > > I think it never was explained why SBPB should be used when SRSO is off/hw > is not affected? There's nothing in AMD's whitepape and there's nothing in > the original patch introducing SRSO_NO. This patch deals with the "when", > but what about the "Why" ? Can you put this in the changelog (if I'm the > only one missing this detail)? This patch was merged, but the "why" is that on Zen3/4, the new microcode adds branch type flushing to IBPB, making IBPB slower. SBPB is the "old" IBPB, without branch type flushing. So if you don't need the branch type flushing (i.e., to mitigate SRSO) then you can just use the old IBPB (aka SBPB). -- Josh