From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92EAEE4996 for ; Mon, 21 Aug 2023 14:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235779AbjHUORF (ORCPT ); Mon, 21 Aug 2023 10:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234035AbjHUORD (ORCPT ); Mon, 21 Aug 2023 10:17:03 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807FA131 for ; Mon, 21 Aug 2023 07:16:36 -0700 (PDT) Received: from nazgul.tnic (dynamic-089-015-236-044.89.15.236.pool.telefonica.de [89.15.236.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 005E91EC0103; Mon, 21 Aug 2023 16:16:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1692627374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=TsLwJ2hOq2MeqQXbEbNTFLaKHWWUNEe06QxxsHNt33w=; b=DFFh2gf2EG6P+nOWi1xyDsgoLYvnf0EiRLUi6GFGgd+QGx4kqhbZ/Hn+lAJEjZXQjh8VVR NvLEFyuwsqOhDaMLeKRP7hziCxJ2e2lDsB8p6mrzV60+lB7ol3n79F4xAV03lsGWwJmDV/ pM7nj8wFWcQP35cVFK84asmUGu8ZR+k= Date: Mon, 21 Aug 2023 16:16:19 +0200 From: Borislav Petkov To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Babu Moger , Paolo Bonzini , Sean Christopherson , David.Kaplan@amd.com, Andrew Cooper , Nikolay Borisov , gregkh@linuxfoundation.org, Thomas Gleixner Subject: Re: [PATCH 04/22] x86/srso: Fix SBPB enablement for spec_rstack_overflow=off Message-ID: <20230821141619.GCZONxs5OdbbXFYSq2@fat_crate.local> References: <23a121e309d5e880eb35c441d9bdfa642d6d59f4.1692580085.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <23a121e309d5e880eb35c441d9bdfa642d6d59f4.1692580085.git.jpoimboe@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 20, 2023 at 06:19:01PM -0700, Josh Poimboeuf wrote: > If the user has requested no SRSO mitigation, other mitigations can use > the lighter-weight SBPB instead of IBPB. > > Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") > Signed-off-by: Josh Poimboeuf > --- > arch/x86/kernel/cpu/bugs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c > index b0ae985aa6a4..10499bcd4e39 100644 > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/kernel/cpu/bugs.c > @@ -2433,7 +2433,7 @@ static void __init srso_select_mitigation(void) > > switch (srso_cmd) { > case SRSO_CMD_OFF: > - return; > + goto pred_cmd; Can't do that - you need to synchronize it with retbleed. If retbleed has selected IBPB mitigation you must not override it. It's a whole different story whether it makes sense. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette