From patchwork Fri Jan 13 12:31:12 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: 43249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp243753wrt; Fri, 13 Jan 2023 04:36:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvWrYWtw68q5R3SvfNzOogl+58wIOaFKqdf/Js5LWbWR0PENcvjA3xULlL0eMk9PZMNQsK5 X-Received: by 2002:a17:906:6d47:b0:7c1:311f:3533 with SMTP id a7-20020a1709066d4700b007c1311f3533mr63663904ejt.60.1673613396998; Fri, 13 Jan 2023 04:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613396; cv=none; d=google.com; s=arc-20160816; b=TWjs2T0m/Q3TbjhzKDvONp0nqsD87OFHoJsdW0s+b37g7ebNUiG4OOTmENnoL5UU8C +5RdB9AIv5M3LW0mlchUfUbIcjtUvpVE/17QxDUpjXfXetybojkLFuKBGFaBbXuiSuwC wPFjtvFtTUMoR5Z2hP5kv6RXswo2lytaIpKzdVKHltFB9DULkPi822Nkb6eZK0yo47PW FjJ+SVJihwQ3MCwgPNlqvRF7hSP5/DFOsx2MYvq1aL3thWqqLGAq6NSQD3JMKM+vHYb3 Y4AwGbkKFy2rrjW+TKW/MFLKpFkxrS0fUx20VNAhXfQl/45x4AlZB88KFEfPHGZYKoET 6hoA== 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=XmlS8EOv1e3rHzLjqaJ8PDK8nkn49/W6t330MrJ1iQs=; b=g7VRcAwH2uzhERrTm1os0JHC3XVkLFt+hkzTu0eKFCDsbZPyCqsRI0daSitCwgUV0v VYCeZBJsJYCbU2/1qeJAybrzMcjgCbjnhHRyzUcLKadCv/3ohgEC7dLK+edlwsODj/Ne R/FH+Wf0aZkaCtPhVdqsCNplyGUEKxxmgS+LVUZNrWqD4OqMuPX2nmqUvjt1PGh3PDIf 2dtZvpWi5BxlMhxUHkudEUCIoeYhGZkHGFBwyJgZeqPs9/s9FhigqwlIaS8g3kPJOjmD wCmOxiujQWWtgdsf7ZkiHnl7Wpp2MjGFa9DwfGWUj1sZdtQwP7YAVuxkKxbjN4fy/vL9 qsLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3KftdnkZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 o8-20020a170906974800b00791a3dd01b6si22106951ejy.864.2023.01.13.04.36.13; Fri, 13 Jan 2023 04:36:36 -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=3KftdnkZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S241663AbjAMMfb (ORCPT + 99 others); Fri, 13 Jan 2023 07:35:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241163AbjAMMcQ (ORCPT ); Fri, 13 Jan 2023 07:32:16 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3DF7559C1; Fri, 13 Jan 2023 04:31:13 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613072; 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=XmlS8EOv1e3rHzLjqaJ8PDK8nkn49/W6t330MrJ1iQs=; b=3KftdnkZ+uTCYFtlvPe7u+/Gs2qNEFEhCTboFyADy7csCdYdSuNg/EKLqKOpZzL1kO+2U9 NO7fGY5uegG0ZavBvPNPGBrWpqjZ2xV+qBQRwbs4WVNE8RzUSeDWtoWwqbdD1WUcLAgqRO TeR2wuGnAKpzJWaeXuCL7mTFeFK7hmD+j5oB5WbpGqBZyaEG4cy1735f3pMdjZHqxPp92B OhdmcEjjwNIiTlqibeNarLMYy0Ey3oWSQxAZ/CDGXbTMQdM+t28LpxNQaP3ATDxbdryyE+ LH82aLMh81iLzGdP+dcT2zO5PA0lBFrd/ifP8llJ4WV70Fk5oClX4EPubtzAzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613072; 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=XmlS8EOv1e3rHzLjqaJ8PDK8nkn49/W6t330MrJ1iQs=; b=UkEKSRX0/g8V4JpnV+PP/5McyhWtEmwnG9cFXJltGOKa/IAVezxVc9cWYoCS0h1Nu1/Ix1 9ocvyu6d7O7xKqBw== 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, intel_idle: Fix CPUIDLE_FLAG_IBRS 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: <20230112195540.556912863@infradead.org> References: <20230112195540.556912863@infradead.org> MIME-Version: 1.0 Message-ID: <167361307215.4906.2346441819750127043.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?1754848345496109109?= X-GMAIL-MSGID: =?utf-8?q?1754910841180625105?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 9b461a6faae7b220c32466261965778b10189e54 Gitweb: https://git.kernel.org/tip/9b461a6faae7b220c32466261965778b10189e54 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:34 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:48:15 +01:00 cpuidle, intel_idle: Fix CPUIDLE_FLAG_IBRS objtool to the rescue: vmlinux.o: warning: objtool: intel_idle_ibrs+0x17: call to spec_ctrl_current() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_ibrs+0x27: call to wrmsrl.constprop.0() leaves .noinstr.text section 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/20230112195540.556912863@infradead.org --- arch/x86/kernel/cpu/bugs.c | 2 +- drivers/idle/intel_idle.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d970ddb..aac6d81 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -86,7 +86,7 @@ void update_spec_ctrl_cond(u64 val) wrmsrl(MSR_IA32_SPEC_CTRL, val); } -u64 spec_ctrl_current(void) +noinstr u64 spec_ctrl_current(void) { return this_cpu_read(x86_spec_ctrl_current); } diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index f060ac7..7b996a0 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -181,12 +181,12 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev, int ret; if (smt_active) - wrmsrl(MSR_IA32_SPEC_CTRL, 0); + native_wrmsrl(MSR_IA32_SPEC_CTRL, 0); ret = __intel_idle(dev, drv, index); if (smt_active) - wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl); + native_wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl); return ret; }