From patchwork Fri Jan 13 12:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 43247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp243702wrt; Fri, 13 Jan 2023 04:36:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsB9Kdc2l5QK1PTs4awc+wBY6E1kNu1313Vxnl649J2GXsSsEebS9SCo+l0cJ8jqp/ATgEO X-Received: by 2002:a05:6402:f0b:b0:499:b48b:2c3 with SMTP id i11-20020a0564020f0b00b00499b48b02c3mr17994378eda.25.1673613389778; Fri, 13 Jan 2023 04:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613389; cv=none; d=google.com; s=arc-20160816; b=jwp47AV2anzaYezhXqX3YXl3h2Wc86Rxg8r8/Mz1kOitM8A8iICrjL1cqGt2Vfz4vT OGTbs1a2BE2W3FQgpiGceVx6wjTGItXIAh0rJIBbNMFyGMsVF5FjThi2LrasDxRf102Z JeMO4iiL3uvRt7jhiXmsmyG0vJF+Fu+rudjENDbjR5xY0E4hJwqiUplCGhVPveI20YZj G2twu1Jl5R+GKNCH+gBPVkc5aB2AFMcEJ1+0/UoNyZKum01emLbNik2rUzh4ameUQI+I jfhyayVU/5K5E4zVwWpCBn20ixCkAZ2vvBvYe74f0/iTfbIi09+mBE7MTB++yUMp1ir1 raxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=C0ubaXfDfhpMCgnJFD4tqKhLDwUq1u6iRG5Kjrq1zIA=; b=oASzzp7zFHM7XjOAsepyCdw9/Tx+rg7dqwgd878JwQaP7JUmlNHkj3+bm4ybjbGPs0 2055qnp14fnByo0/nPZds0medB/9MF4t4S5AnGZtTN7LGNXsml0qLIE4isx1dJPvWsU4 crqpu5Gx9QgCqlw/yByHKyjgOrPWgLTb9v5dZYp4ouEMpuWTsEakN2c0SWAOZUCFKF3A 1TlSHu3grnNON2wI3sQF5oz3Tj0Vo2z2JsassdBxnaYHO8/+AlhLVYW4KzPJbTipniAT 9rx57l6gPYVF61Wl1D/PRDuZE2KTVM82AugBQBchlFt6XXQ1zABtqZRrjyjSFyDC9bAE ZSig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=21qUFe+V; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds16-20020a0564021cd000b0049a06a001adsi7271209edb.155.2023.01.13.04.36.05; Fri, 13 Jan 2023 04:36:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=21qUFe+V; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241050AbjAMMfU (ORCPT + 99 others); Fri, 13 Jan 2023 07:35:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240874AbjAMMcP (ORCPT ); Fri, 13 Jan 2023 07:32:15 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81D8551D7; Fri, 13 Jan 2023 04:31:12 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613069; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C0ubaXfDfhpMCgnJFD4tqKhLDwUq1u6iRG5Kjrq1zIA=; b=21qUFe+V+/+ol7Lsbmkmct+AcRh6rz/bqjHG+FQimWI/NQUJyDROg3j4v6f26vmop2TYuQ EUjMEh+IdSJMpspkebHFjRGa8b0MxxY8IE8EASA2cx+WLzayMrDhvbvhEqiE3yLJHvu5IB DOCW/X5vqjmfoUUwSCaABmgHxHRjrRWM2fteFwFwK4wHErflN00BgVgjdKtBHhMNARwdW4 GgyhLf0yS1dC0gU+c16FebXi8uRCo2O6y/hOrJdcfa68vivo/r2tvGu3cQXOA66g/Al9/l NHs/TCzCJ+kiCkm8Whu+SA8O4LhmrL8Vwjv3OVHZuelpGgwEMRCQYKlaPZY31A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613069; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C0ubaXfDfhpMCgnJFD4tqKhLDwUq1u6iRG5Kjrq1zIA=; b=NreBUqAuXTWJcfFzTGFrEVYCVVDmdgkaoWo4ZzxTJnHGT/VhJla4GKMZxDspod8DQvO+z7 VdNVt1N1jr6uKeDw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cpuidle, mwait: Make the mwait code noinstr clean Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , "Rafael J. Wysocki" , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195541.050542952@infradead.org> References: <20230112195541.050542952@infradead.org> MIME-Version: 1.0 Message-ID: <167361306942.4906.10598168030102825603.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754910833681306394?= X-GMAIL-MSGID: =?utf-8?q?1754910833681306394?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 2ec8efe64e6dfcaa50906ae4b0b5a0a7e1a54d50 Gitweb: https://git.kernel.org/tip/2ec8efe64e6dfcaa50906ae4b0b5a0a7e1a54d50 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:42 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:48:16 +01:00 cpuidle, mwait: Make the mwait code noinstr clean objtool found a few cases where this code called out into instrumented code: vmlinux.o: warning: objtool: intel_idle_s2idle+0x6e: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_irq+0x8c: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle+0x73: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: mwait_idle+0x88: call to clflush() leaves .noinstr.text section Fix it by marking the affected methods as __always_inline. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Acked-by: Rafael J. Wysocki Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230112195541.050542952@infradead.org --- arch/x86/include/asm/mwait.h | 12 ++++++------ arch/x86/include/asm/special_insns.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h index f224216..778df05 100644 --- a/arch/x86/include/asm/mwait.h +++ b/arch/x86/include/asm/mwait.h @@ -26,7 +26,7 @@ #define TPAUSE_C01_STATE 1 #define TPAUSE_C02_STATE 0 -static inline void __monitor(const void *eax, unsigned long ecx, +static __always_inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { /* "monitor %eax, %ecx, %edx;" */ @@ -34,7 +34,7 @@ static inline void __monitor(const void *eax, unsigned long ecx, :: "a" (eax), "c" (ecx), "d"(edx)); } -static inline void __monitorx(const void *eax, unsigned long ecx, +static __always_inline void __monitorx(const void *eax, unsigned long ecx, unsigned long edx) { /* "monitorx %eax, %ecx, %edx;" */ @@ -42,7 +42,7 @@ static inline void __monitorx(const void *eax, unsigned long ecx, :: "a" (eax), "c" (ecx), "d"(edx)); } -static inline void __mwait(unsigned long eax, unsigned long ecx) +static __always_inline void __mwait(unsigned long eax, unsigned long ecx) { mds_idle_clear_cpu_buffers(); @@ -77,8 +77,8 @@ static inline void __mwait(unsigned long eax, unsigned long ecx) * EAX (logical) address to monitor * ECX #GP if not zero */ -static inline void __mwaitx(unsigned long eax, unsigned long ebx, - unsigned long ecx) +static __always_inline void __mwaitx(unsigned long eax, unsigned long ebx, + unsigned long ecx) { /* No MDS buffer clear as this is AMD/HYGON only */ @@ -87,7 +87,7 @@ static inline void __mwaitx(unsigned long eax, unsigned long ebx, :: "a" (eax), "b" (ebx), "c" (ecx)); } -static inline void __sti_mwait(unsigned long eax, unsigned long ecx) +static __always_inline void __sti_mwait(unsigned long eax, unsigned long ecx) { mds_idle_clear_cpu_buffers(); /* "mwait %eax, %ecx;" */ diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index c2e3221..54621e7 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -196,7 +196,7 @@ static inline void load_gs_index(unsigned int selector) #endif /* CONFIG_PARAVIRT_XXL */ -static inline void clflush(volatile void *__p) +static __always_inline void clflush(volatile void *__p) { asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p)); }