From mboxrd@z Thu Jan 1 00:00:00 1970 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 E30C51386B3 for ; Thu, 11 Apr 2024 15:34:25 +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=1712849666; cv=none; b=DUyeQ5opV1z3xdCUH9VHvhEEDzkp9GOb6v2STsb+uxEwxNzPvq5DSljG7mHRfGe3usZCdveCO5otBfBl/GhoxHKlUZUKPlZJCWxuFNINsAYQP9Z+plvNP3liH3lEVeePbzFICB1SwgfPFzxw3i9ZBPqJL5uElexh7kXdmsF2wis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849666; c=relaxed/simple; bh=YuahbXm5K4d78BIJVxJtPpmqTY2F+D+qHk/aXZOQcK0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mYg67Ay2k2jVi+MR+462Kz//ZgKA2GQMM5lB7LK3in8jECGumPc8idMEKprOGAQXHd1O4I3kQsdfDZqQy3acZhz/Ht2cBL8FEYLtJqSj2sdNWYteMVI/SY9lvf+VklIzOdJuyUzR81L7RrVHK2dk2MnAxjewrvXNmX+acX4QFFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TsKroPqu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TsKroPqu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9704C072AA; Thu, 11 Apr 2024 15:34:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712849665; bh=YuahbXm5K4d78BIJVxJtPpmqTY2F+D+qHk/aXZOQcK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TsKroPqupbSVei8wIXh/rCDph/186G/6XSinWmH51RZRs3XsWiDI795Vo3M5sgcLt CFCh4pTDBu8zEW/GKJFn7dlYqC5uT9qjrtLDUwlxa7HE8RkAjcpq+NUAQkLnPVsitz pHQV9OU5rKwT/cmntNigeKhydhv33kkpvsT3cAG/ORLrakBGMyZ7uyMdOBXbUmqYK+ 8T/UG3ucar9c92RxVWgnG9fqAipB8T9K4r1KeDWrE6E+t/ItdNqxWkPP2s2IPncEYl E4JBA5U6wlZufMmhpbNXbJo+yr4rqaQO2J3iwGq4k7125yEHw1aoTrrXR/PHHeEvWR NVCN4uhUfEIZA== Date: Thu, 11 Apr 2024 08:34:23 -0700 From: Josh Poimboeuf To: Andrew Cooper Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov Subject: Re: [PATCH 3/7] x86/bugs: Fix BHI handling of RRSBA Message-ID: <20240411153423.6oolchbhjvnk2jm3@treble> References: <6f56f13da34a0834b69163467449be7f58f253dc.1712813475.git.jpoimboe@kernel.org> <997d9bf9-2a8b-452f-b458-2fa15f92918e@citrix.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 Content-Transfer-Encoding: 8bit In-Reply-To: <997d9bf9-2a8b-452f-b458-2fa15f92918e@citrix.com> On Thu, Apr 11, 2024 at 11:02:42AM +0100, Andrew Cooper wrote: > > /* Disable in-kernel use of non-RSB RET predictors */ > > static void __init spec_ctrl_disable_kernel_rrsba(void) > > { > > - u64 ia32_cap; > > + if (rrsba_disabled) > > + return; > > + > > + if (!(ia32_cap & ARCH_CAP_RRSBA)) { > > + rrsba_disabled = true; > > + return; > > + } > > You'll take this path if you have out-of-date microcode. > > RRSBA is only enumerated from September last year, IIRC.  (Definitely > from this point on some CPUs.) > > When RRSBA was introduced, I was under the (false) impression that all > eIBRS systems suffered RRSBA, but it turns out that select parts > (ICX,TGL,RKL) are non-RRSBA despite not having RRSBA_CTRL. Hm, so the original code here had this problem too, right? if (cpu_feature_enabled(X86_FEATURE_RETPOLINE) && !(x86_read_arch_cap_msr() & ARCH_CAP_RRSBA)) return; At this point I'm having a hard time caring about 7 months out-of-date microcode, but is there a reasonable way to check for that? -- Josh