Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1123415rdb; Fri, 9 Feb 2024 10:56:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyAWo1cAvcEkVzLb6DV3Ex9YgHz2ATmsIccxnOGa2MxyDh7ux+GfavXzxm5KQ76shpzoS1 X-Received: by 2002:a05:651c:b20:b0:2d0:aae6:bf2e with SMTP id b32-20020a05651c0b2000b002d0aae6bf2emr2129087ljr.34.1707505016693; Fri, 09 Feb 2024 10:56:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707505016; cv=pass; d=google.com; s=arc-20160816; b=eq6FTpdyRvi4O5cLQLImXufzbSVDd0335OUGCgf6cQpj3Zd45KoAZ6X3XCUbs4nX/6 zTB/NVZiW3pCcAAFE+JqTMkTOtP/WqsqSfpM2iRq1zVnUMXePY6IbEiI16hdpf+jM70n hLnjARq94unKGGFIA2P8DU3R700oD/wdxtep6ipHiHgRS+GS/BbxpQJ9cpGSuzZMcivL FpKHY/ORd3nm6PoiR692am15BTjS6yxb1lftmvtEKqBNTBvOPFgWnKuuU1YazIHB3JBZ txzWfjSYvZWjAvK8phR752ldFUmFP7WIm3IkC4PyTguf5qhrVaG0L6RPsQLOfLFjadnF hTdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qSgfdKC+4VKsmU/qM3WIP+p4+Kz908lssHbTKtdyiFE=; fh=YTsh+jEpulvT8oQLgLGzv+6IfdHUJ3Rj5I8lUHP0yJY=; b=g6h1gbkooKplwShgoqbtjoRPC/OWV+FzKeJCfBoWH+Ohra6jPoF9siThJXe4+7nKKz lQD98wRnVY5hk/SzfmxwbMC5fJaAe9kAIthl/obHgiCoatv2s1Oy7qz4wvdlCTMAbOCw LRPgSWF4sqrovU97I1A2Ze7iB+lDySHs9s3F6EVFyYdkJqZMJKZK2/AnPY+p/wJBMVcl 38GISEiNyGt+1A6EdNEiZ89mfdF0JKOmjcGh+N5LTxSqmkXeZa/grG8p5D5BlNSCTaHq VRS3A0qV/udiLV+isF7TMI7k5mz9oIi8QaBLD9SHjXw1bTxlORH5XrllFaB4FJBfzbzT Sf7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xlwy4N1j; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUNP6oiZbGjmWt/fPA+h9TbUTzoypohHwOFaJi+3BIIbqnFrmBY+5/RjK6gHaK6uFU7/9AhVC757EVuDQKrAXWxdBuJ+owvK73qFd6+5A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i1-20020a056402054100b0055ff1384e15si10558edx.225.2024.02.09.10.56.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:56:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xlwy4N1j; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59841-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 707A41F211ED for ; Fri, 9 Feb 2024 18:56:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD9078288B; Fri, 9 Feb 2024 18:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xlwy4N1j" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EE99B57339 for ; Fri, 9 Feb 2024 18:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707504988; cv=none; b=uG9Gx/Mi0YHyljntMmfFViywao9BUzXlhLw1MwRhDNjhOF04Vv8VlqvAGr1RM8XxGyhgwEgyqjiPlEUkAnrvLIoJ/F83X85Hv44XchsV3+gX9Bx5tQ7+l7+7oWMjjDtylJyii7Th5nzfUAiFW/TmO+S6BNAz6mQmgI6Q7d5pOoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707504988; c=relaxed/simple; bh=SO31TmbkBMJBQykzmqYbyMuh5uGqCUjrVHEFJC8knyQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D5NQyIZoJC9d4+guOBz21qbAL9cP2HTyfgHVAGFaIO3TakFZ4avBMl6DMXXih/4uUNPNvOtnn1G+NHf0m8SkbTDTKl5AcLLn2CvugLuK8ApMGAD31yLMd181+JL1UKqRZw9DIJy67QChL9X+BUKsxwN3aAqVEnD4uN790QDLOBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xlwy4N1j; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A416C433F1; Fri, 9 Feb 2024 18:56:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707504987; bh=SO31TmbkBMJBQykzmqYbyMuh5uGqCUjrVHEFJC8knyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xlwy4N1jANhELD5loPDx1a5pvan3SJFF75/x/kYJsso5EIG3oERDQn1VHdZxIZt0G 8+UYqP99aIi6jd/nkPq6p7yU8MzY4Pr0lSk8a4l+pAMZpPaly7WimS0l5WVibvr8tn UhjXAkDwVuqhhnEyeEosWsVD3z9HYzRlFckAMnmllF9Doca0lqTz9qD1XiaTq5VyiD h0wHcTbixni70dHExcE40Xxq5h1O01H/R98+P445VroAG2KABsR/2oB7EFNzj3xfGr mqKI1b4hLvHabgponutJiU0FT6LvpQ5gI4MYfBuvH79C13CdA7oSLHFodvxTQx/DUJ XuKD1qPwfqiOw== Date: Fri, 9 Feb 2024 10:56:25 -0800 From: Josh Poimboeuf To: Pawan Gupta Cc: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Daniel Sneddon , antonio.gomez.iglesias@linux.intel.com, alyssa.milburn@linux.intel.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, Alyssa Milburn Subject: Re: [PATCH] x86/bugs: Default retbleed to =stuff when retpoline is auto enabled Message-ID: <20240209185625.hca6lts6dv4cd3fu@treble> References: <20240208-retbleed-auto-stuff-v1-1-6f12e513868f@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240208-retbleed-auto-stuff-v1-1-6f12e513868f@linux.intel.com> On Thu, Feb 08, 2024 at 05:12:15PM -0800, Pawan Gupta wrote: > @@ -1025,10 +1041,17 @@ static void __init retbleed_select_mitigation(void) > retbleed_mitigation = RETBLEED_MITIGATION_UNRET; > else if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY) && boot_cpu_has(X86_FEATURE_IBPB)) > retbleed_mitigation = RETBLEED_MITIGATION_IBPB; > + } else if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && > + spectre_v2_parse_cmdline() == SPECTRE_V2_CMD_AUTO && spectre_v2_parse_cmdline() has side effects (printks) and shouldn't be called twice. And what's the point of checking spectre_v2= anyway? Shouldn't retbleed be mitigated by default, independently of whatever the user may have specified for Spectre v2? > + spectre_v2_enabled == SPECTRE_V2_RETPOLINE) { > + if (IS_ENABLED(CONFIG_CALL_DEPTH_TRACKING)) > + retbleed_mitigation = RETBLEED_MITIGATION_STUFF; > + else > + pr_err("WARNING: Retpoline enabled, but kernel not compiled with CALL_DEPTH_TRACKING.\n"); If retbleed is vulnerable then the sysfs file should show that. Also, I think this pr_err() is redundant with RETBLEED_INTEL_MSG and can be removed. -- Josh