Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1198836rdb; Sun, 20 Aug 2023 23:22:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiH+Rfm5vnl4RcaafwS50mJtFWfqPKbEFKh8DyowDUilb3NwjKCEnG3eEqr6nhIFk1S0Df X-Received: by 2002:a05:6a00:99d:b0:688:4337:3c55 with SMTP id u29-20020a056a00099d00b0068843373c55mr4365937pfg.6.1692598925962; Sun, 20 Aug 2023 23:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692598925; cv=none; d=google.com; s=arc-20160816; b=A3Cy2r+ip9BA1kz7aU0y/D3pC3tQ64c4vmCa51W5tzhmJrCALR3EpJgdyqNT50p2JW J14imnOj5jJUgNG7CufYzn0h1+DneBDhBT8zM0VR8Q86SLTslFnk9LmpQVfm3I/fGX4B DJPEDNsvRCWsUF5B1EHq4h2Arf+dSiW9sjmFEFqluQT4pJ9sCFlUoZa0rc1njxbvC4Cw 5Fx0tvyIafG5fYD5fmkCgTnHXZKa8apHslA4RFD+tEbtwoJVjNLwbeisYrtWQZ5t4CAN TehMw3O1+Ik0RMf9GF61OViay0yhb44zAsz3D3RMsfyPPndKYvQJcF4zn05XTp04pldE 9xNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=93eUytCAz7GH9XIIC6IPTqv0p0jrqKiewukwsFvRAZI=; fh=1KVrD/LnRsN9N7k2d12iARV4DA2tVMW012QtKSrD46c=; b=hbsQspDL0n7H7WBWorkUAQZcrMLT4nmIfaaferN2NVOMWjshFlgMlIWY24qMR5f7Ia W65MT7/Tc81754+opUttOkDpqgw8wfoiCYSXjM//oxWfm3/F+XN/zOIXmwlfwXyt9Uxc 5LUDA/aq0Ow0W8xnsmnPeaziZ9c9oa+Efwp87wDeiBnB2DKbYhISiKCxakyFytW/uxMj z/rGB0yhw1tyXQk8KxRjAPI8UoqVHBXgRii1uJbV1+nvhVT4Jm7l7vbCMwxxf4bW716e H99W0dJhpSDwhCkJmdbtyJBNfqaB0mXDVvq9PYU5GlH0upGTdmagejp4S63DqvAZePb0 5DrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NeQXpsaa; 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 e14-20020a63ee0e000000b005428f25f67bsi6539005pgi.784.2023.08.20.23.21.53; Sun, 20 Aug 2023 23:22:05 -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=NeQXpsaa; 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 S232268AbjHUBTa (ORCPT + 99 others); Sun, 20 Aug 2023 21:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjHUBT3 (ORCPT ); Sun, 20 Aug 2023 21:19:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BF749C for ; Sun, 20 Aug 2023 18:19:28 -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 BD63B61E8E for ; Mon, 21 Aug 2023 01:19:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A369FC433C8; Mon, 21 Aug 2023 01:19:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692580767; bh=jArgxD7lzLNxdiulYTukUVJwbw7Th0G7hkO4belLIKY=; h=From:To:Cc:Subject:Date:From; b=NeQXpsaaApDsUbGcd5YYjmy88fLNXApFsOzdvBq4xztr7PHTLam72MvPAJQrKUnV7 IeEASp8g2TDDJBjl3pvSrmNWi0zb1UkN02hB0k5v+efPROm6aPAaIyyBAEn8JP94Ru 839pwh5iNMNZBOgxsmLxNcMdd9IlwrZ+gB3CKsng7ivaowUlZZ2ANIl4p1DIB2eHtB vMis+16jruzYH5M0ojZVs5VQGjtgWZrAyevoJq5vj85q4XwITK2wL/AqVHUIY2wrda ADmfgkVUF2P8WARSfUAxFpIoGDhtJf1Qgdm0hMS00EfBk4jO0/E/boB+ISlyyzWn8L SKydktjZoAD2w== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Peter Zijlstra , Babu Moger , Paolo Bonzini , Sean Christopherson , David.Kaplan@amd.com, Andrew Cooper , Nikolay Borisov , gregkh@linuxfoundation.org, Thomas Gleixner Subject: [PATCH 00/22] SRSO fixes/cleanups Date: Sun, 20 Aug 2023 18:18:57 -0700 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Here are several SRSO fixes and cleanups, based on tip/x86/urgent. One of the patches also adds KVM support, though a corresponding patch is still needed in QEMU. I have a working QEMU patch which I can post to qemu-devel. Josh Poimboeuf (22): x86/srso: Fix srso_show_state() side effect x86/srso: Set CPUID feature bits independently of bug or mitigation status KVM: x86: Support IBPB_BRTYPE and SBPB x86/srso: Fix SBPB enablement for spec_rstack_overflow=off x86/srso: Fix SBPB enablement for mitigations=off x86/srso: Print actual mitigation if requested mitigation isn't possible x86/srso: Remove default case in srso_select_mitigation() x86/srso: Downgrade retbleed IBPB warning to informational message x86/srso: Simplify exit paths x86/srso: Print mitigation for retbleed IBPB case x86/srso: Slight simplification x86/srso: Remove redundant X86_FEATURE_ENTRY_IBPB check x86/srso: Fix vulnerability reporting for missing microcode x86/srso: Fix unret validation dependencies x86/alternatives: Remove faulty optimization x86/srso: Unexport untraining functions x86/srso: Disentangle rethunk-dependent options x86/rethunk: Use SYM_CODE_START[_LOCAL]_NOALIGN macros x86/srso: Improve i-cache locality for alias mitigation x86/retpoline: Remove .text..__x86.return_thunk section x86/nospec: Refactor UNTRAIN_RET[_*] x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk() Documentation/admin-guide/hw-vuln/srso.rst | 22 ++- arch/x86/include/asm/nospec-branch.h | 69 ++++----- arch/x86/include/asm/processor.h | 2 - arch/x86/kernel/alternative.c | 8 - arch/x86/kernel/cpu/amd.c | 28 ++-- arch/x86/kernel/cpu/bugs.c | 87 +++++------ arch/x86/kernel/vmlinux.lds.S | 10 +- arch/x86/kvm/cpuid.c | 4 + arch/x86/kvm/x86.c | 9 +- arch/x86/lib/retpoline.S | 171 +++++++++++---------- include/linux/objtool.h | 3 +- scripts/Makefile.vmlinux_o | 3 +- 12 files changed, 199 insertions(+), 217 deletions(-) -- 2.41.0