Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp854156pxk; Thu, 17 Sep 2020 19:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr7yBT+u4FuLxQBBk1/OSDf/pMb0UAsjXmui+7WO6Nxf5TU0QmgrxB/3i0Z3ilvCloBx1Q X-Received: by 2002:a17:906:fa01:: with SMTP id lo1mr34897106ejb.394.1600395013555; Thu, 17 Sep 2020 19:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600395013; cv=none; d=google.com; s=arc-20160816; b=N89hD/KIDiu6XSLnmVSFbqXX3i55vE9JUXngHtInEV8ajF2tQ1ioN1/dahPdMhjUv4 G3Upy3Do4Aoj4z1Pv/tiwrLEi7GP+Cnbpu/sQkNUXgPnrCC9QXqGUVzOuw09I/yinKPy EBxZaOcsuK+Ce02wSkyy9hhXgGvTHGFqUYaVENFNFcAEAbEfK47vOV3MBBC4zno7PKY7 WzwQjjmgIdkA52U1WX6/5hZ8hYomZkh3QvpYgkeQBM5V0Yi5EB1xRcM5MDL/6+5v+CXZ 3s+/DdcxelfJ8D1ls3CQXr2YNcU/vJLep3RbVyWXnvTfY1bD5zvc2a3ia/MrbtsJTugY 2V3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tVMjiFylovcSXFst353VFPdf80+OlffHYwmb56aXc0k=; b=wMiaVMsdl0X9gnJzx2B3CV0FozbNdrxQ6vT/HspWIECsA53jkSgWAFjcOPxughfKbZ KT0eJi8P4mGKqqfPnhQMXMx0yimlXUXLCJiiorSfUCWizHzxwlnrQj9ieE8XRXCGO6ql OWrWiCGnje+GtP44gT+rpBFGsRgwPfFe2BMwkfCeQpHlwpPzl/ItEHrI28C76hGknpNx XZUUAvRc+j+I402ooXc+nFD7ukUe19jHN8DYx1Ar8+CuO6Xx5/QnODi0sG2bgFzgxaTm VxAjz8E9juowV9/xbEJNY7z/UNMKf8nfRLjh2dWV0qMDYZFb1oPxOUK4m9WgXdhkMYPT FScw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qlsC4RNL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si1107088edj.64.2020.09.17.19.09.50; Thu, 17 Sep 2020 19:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qlsC4RNL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728014AbgIRCHz (ORCPT + 99 others); Thu, 17 Sep 2020 22:07:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:58040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727960AbgIRCHg (ORCPT ); Thu, 17 Sep 2020 22:07:36 -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 2C8D0238E5; Fri, 18 Sep 2020 02:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394855; bh=VF4UTKdIP0qSqG3PAh5qbaxMAT9+q28jnpmSM+KnBrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlsC4RNLqdDJGM9fn407HDwjh/ykjMiyR3HqspY7LGgWlyOS8NMY4Rp7sheBd3Fv8 uJwAFAXmkv87B2szRA8bAWk1ttqLzDQWtXBAFb9C+N0CV7BoAibEQTTM9gASWcMyiq q7Pu+RGm/7Cs0ZaI9X5jfMcTaOUnajGzZ4nFJens= 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 5.4 310/330] x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline Date: Thu, 17 Sep 2020 22:00:50 -0400 Message-Id: <20200918020110.2063155-310-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-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 5c24a7b351665..b222a35959467 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -320,7 +320,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; @@ -341,7 +341,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