From patchwork Tue Sep 29 11:00:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 290852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A190CC4727F for ; Tue, 29 Sep 2020 12:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C0DF2076A for ; Tue, 29 Sep 2020 12:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601382212; bh=F6oYTrYk+RKcvTrxqnjz5dFF2TF1L+vTloedGZvOYu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=n0iUUr8eEtWLCX+ILyZ5RzbfQrnk/GHVDeo86tnqVf1UHhZYV9GLJx1BlsBWYr/kk XjoJdFd7IL/b8jc51MGnhTTJvcfprccQcP8XQtUYCC85WINIcjUKC0NoAmVfM+49wM t+R10tSt1JnKAl5Cl6tZMJQHjoeXKuLHys6KCjMM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732265AbgI2MXU (ORCPT ); Tue, 29 Sep 2020 08:23:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:47764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729781AbgI2LfK (ORCPT ); Tue, 29 Sep 2020 07:35:10 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2876223CD0; Tue, 29 Sep 2020 11:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378937; bh=F6oYTrYk+RKcvTrxqnjz5dFF2TF1L+vTloedGZvOYu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zLX6cYfV7tzNdG2OqfIOOUL3yBoceKxF03TWU+hPw6BdaKdTGTjWXrMnOnpKQIc5r a0LdkGxtODCSKkPVVcL+JX+D1SGOLSZSmivNeTSBNvH/lAqlSgrUiJgregd3qjOwwx IWCh08b3vM5mb5PnZExFeaCy4KYGXK9dRCOhJSQ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Alexandre Chartre , Peter Zijlstra , Sasha Levin Subject: [PATCH 4.19 193/245] x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline Date: Tue, 29 Sep 2020 13:00:44 +0200 Message-Id: <20200929105956.372238933@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105946.978650816@linuxfoundation.org> References: <20200929105946.978650816@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Gleixner [ Upstream commit a7ef9ba986b5fae9d80f8a7b31db0423687efe4e ] Prevent the compiler from uninlining and creating traceable/probable functions as this is invoked _after_ context tracking switched to CONTEXT_USER and rcu idle. Signed-off-by: Thomas Gleixner Reviewed-by: Alexandre Chartre Acked-by: Peter Zijlstra Link: https://lkml.kernel.org/r/20200505134340.902709267@linutronix.de Signed-off-by: Sasha Levin --- arch/x86/include/asm/nospec-branch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index e3f70c60e8ccd..62f9903544b59 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -330,7 +330,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear); * combination with microcode which triggers a CPU buffer flush when the * instruction is executed. */ -static inline void mds_clear_cpu_buffers(void) +static __always_inline void mds_clear_cpu_buffers(void) { static const u16 ds = __KERNEL_DS; @@ -351,7 +351,7 @@ static inline void mds_clear_cpu_buffers(void) * * Clear CPU buffers if the corresponding static key is enabled */ -static inline void mds_user_clear_cpu_buffers(void) +static __always_inline void mds_user_clear_cpu_buffers(void) { if (static_branch_likely(&mds_user_clear)) mds_clear_cpu_buffers();