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: 43251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp243901wrt; Fri, 13 Jan 2023 04:36:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXtdtIhRYc+LUEJcP3nHMtNN3pVCVdx1ztkY+iMky+J1hOM35/9iW8sGIoGs/KxotriATdaO X-Received: by 2002:a17:907:8c81:b0:7c1:962e:cf28 with SMTP id td1-20020a1709078c8100b007c1962ecf28mr72362721ejc.23.1673613418607; Fri, 13 Jan 2023 04:36:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613418; cv=none; d=google.com; s=arc-20160816; b=hwClo38mxExUrKIWrM5X02VxePpYQ6i1/znN80egx3BDxYGCxsRc6BLCEhm5/SSxdk s1Nm2RwglCpTUUZG8fTlrfb6ypA7NbNFoxh8A+zR6opD8Rh9SET7aVUg1pagxWKLzVDz YX4JH4ufkSIFI3YrPHVl0pOB4Pa9RHhyI88eDkVzKgaO0SrarjvzNbe2XvpnxMIaZ3nn zmTY6C7AKzHW/jzp2z0KiNezOe5GxXhAQDG3SOWRwZRrE+sOP8PwkD3KSz3O2YFrcxyv Vb/y+FPfUVcLfwrRGVgV+SY4L8xc1VPC5I1SR/rtDpPBYbolPGhl1vFv+QZStKhGQQUW Ur0g== 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=sb6uOM6ltxpZQbw6TOgazxJey3Y2RzNXZZGCb/8jvsY=; b=kLUuvGI5zS5lc/R/ci9RHoRaGEJZfGXr7x2ZxMjZ/M5gOYuFL2g48xuCRz1EUOI5Rz H1qgUd8m4Td/BBCUFvhvb/VeorZsgM2k5tylm27yy+WU4yZIza2r6avegsNjnL35lznF t4AD9rC/eCMLyWquKqh4s7KSxOXLvsfBD72uC9gwbplVh+GiILRCERSHIJJ27FVk3Qtq iEi22Tw1P/MmloZBhC3VjRgMG78RwGNnA3p1MKVqEGeERRerWbIGYnok1qe6wbDNX4fB vW9nsm3MzBAYGpffQpPnlynDxvarkgHvUC20gMpZf0RyQeyX5EVbM+KL3PSazB/8Os6O sLEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HWELbrD6; 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 dd13-20020a1709069b8d00b0085b4d436b57si10535960ejc.1000.2023.01.13.04.36.34; Fri, 13 Jan 2023 04:36:58 -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=HWELbrD6; 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 S241685AbjAMMfh (ORCPT + 99 others); Fri, 13 Jan 2023 07:35:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240798AbjAMMcQ (ORCPT ); Fri, 13 Jan 2023 07:32:16 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ABD6559C5; Fri, 13 Jan 2023 04:31:14 -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=sb6uOM6ltxpZQbw6TOgazxJey3Y2RzNXZZGCb/8jvsY=; b=HWELbrD6jzVC2QkeSR0SRFi5WhF0WfbNhn/uGRRvjl+lka7ehbhNofxaNfUPSdIciD9WqM 2W5O14SOJsApiSrdqwk6Gvhe1OEJpBH2Mz7Kq1rIAD7CYtxp6yEWdqpyBYqPeBdFSaM4FY Glie9qjUqhL9YasjJWgkCRrgwJI7jYaStZWpq+8ykG8+mwNsVdiAZK4NhnLhLxYhm9a7Bp zqtOqO7FBfrTiah5IXRWOJ7Cr/V4Jd5QgySKsS/evwypfGIjdY5F9Ocbh2CREnAGD+EeC/ 5ZWQDi2i6UnI8/ERi858DGWqQM31IbFGFAdYV9gkIZ+N6EU8B1r5OsF24v9X6g== 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=sb6uOM6ltxpZQbw6TOgazxJey3Y2RzNXZZGCb/8jvsY=; b=yFRDjvxxT/yJpNOrDPjlme0vJKjtRK/pqrWcHGXDnd32fOJxOLXEXyckXlFDc7E7aebyGU zko2j48oYiRFCwAA== 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_INIT_XSTATE 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.494977795@infradead.org> References: <20230112195540.494977795@infradead.org> MIME-Version: 1.0 Message-ID: <167361307237.4906.11977760004915492447.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?1754848187876887062?= X-GMAIL-MSGID: =?utf-8?q?1754910864295627773?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 821ad23d0eaff73ef599ece39ecc77482df20a8c Gitweb: https://git.kernel.org/tip/821ad23d0eaff73ef599ece39ecc77482df20a8c Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:33 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:48:15 +01:00 cpuidle, intel_idle: Fix CPUIDLE_FLAG_INIT_XSTATE Fix instrumentation bugs objtool found: vmlinux.o: warning: objtool: intel_idle_s2idle+0xd5: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_xstate+0x11: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: fpu_idle_fpregs+0x9: call to xfeatures_in_use() 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.494977795@infradead.org --- arch/x86/include/asm/fpu/xcr.h | 4 ++-- arch/x86/include/asm/special_insns.h | 2 +- arch/x86/kernel/fpu/core.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/fpu/xcr.h b/arch/x86/include/asm/fpu/xcr.h index 9656a5b..9a710c0 100644 --- a/arch/x86/include/asm/fpu/xcr.h +++ b/arch/x86/include/asm/fpu/xcr.h @@ -5,7 +5,7 @@ #define XCR_XFEATURE_ENABLED_MASK 0x00000000 #define XCR_XFEATURE_IN_USE_MASK 0x00000001 -static inline u64 xgetbv(u32 index) +static __always_inline u64 xgetbv(u32 index) { u32 eax, edx; @@ -27,7 +27,7 @@ static inline void xsetbv(u32 index, u64 value) * * Callers should check X86_FEATURE_XGETBV1. */ -static inline u64 xfeatures_in_use(void) +static __always_inline u64 xfeatures_in_use(void) { return xgetbv(XCR_XFEATURE_IN_USE_MASK); } diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 35f709f..c2e3221 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -295,7 +295,7 @@ static inline int enqcmds(void __iomem *dst, const void *src) return 0; } -static inline void tile_release(void) +static __always_inline void tile_release(void) { /* * Instruction opcode for TILERELEASE; supported in binutils diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 9baa89a..dccce58 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -853,12 +853,12 @@ int fpu__exception_code(struct fpu *fpu, int trap_nr) * Initialize register state that may prevent from entering low-power idle. * This function will be invoked from the cpuidle driver only when needed. */ -void fpu_idle_fpregs(void) +noinstr void fpu_idle_fpregs(void) { /* Note: AMX_TILE being enabled implies XGETBV1 support */ if (cpu_feature_enabled(X86_FEATURE_AMX_TILE) && (xfeatures_in_use() & XFEATURE_MASK_XTILE)) { tile_release(); - fpregs_deactivate(¤t->thread.fpu); + __this_cpu_write(fpu_fpregs_owner_ctx, NULL); } }