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 X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 A7B95C43464 for ; Fri, 18 Sep 2020 02:14:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6649623787 for ; Fri, 18 Sep 2020 02:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395294; bh=SI+fWPNrFFRRT2Bdau69PuEhJHWv0Qy0sgSIomMiLeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VZb0RVRYB9BqP+uk2flO0WeoYOGNPPKNOT6STHh6embA1gF0+MA210mh+Dhu2g4pX eZSbZSdnj9X34uQN0IvBWNam/m2avGR/89xRYqc8Ul87aSPuVP7NTyuMhwydG50QgE KFqQYt6uquVKJR/Hj5O+OOER8sW8uIHfFR9qT814= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728383AbgIRCOw (ORCPT ); Thu, 17 Sep 2020 22:14:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:43116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729130AbgIRCOp (ORCPT ); Thu, 17 Sep 2020 22:14:45 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E5B5239D4; Fri, 18 Sep 2020 02:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395285; bh=SI+fWPNrFFRRT2Bdau69PuEhJHWv0Qy0sgSIomMiLeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xLy6WhIWjp3czhpznpPSCKOFinpuBnBX31ApbVlcGtXVCtuQ6bQS+++AM1hIkxlp7 FVNwKJzyjbd7smWXelFgDz/2DIEOSmTJvWaahlQllPE8nlyVhf1ZGI/rCaqKEW5VJn s6vS5NQf+biSe2icVcmpqmP1FfGNOlM0ix5XM+Aw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thomas Gleixner , Alexandre Chartre , Peter Zijlstra , Sasha Levin Subject: [PATCH AUTOSEL 4.14 120/127] x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline Date: Thu, 17 Sep 2020 22:12:13 -0400 Message-Id: <20200918021220.2066485-120-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918021220.2066485-1-sashal@kernel.org> References: <20200918021220.2066485-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 041d2a04be1d8..270448b178a7a 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(); -- 2.25.1