From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968199AbdIZIhW (ORCPT ); Tue, 26 Sep 2017 04:37:22 -0400 Received: from terminus.zytor.com ([65.50.211.136]:46249 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964889AbdIZIhS (ORCPT ); Tue, 26 Sep 2017 04:37:18 -0400 Date: Tue, 26 Sep 2017 01:30:33 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: dave.hansen@linux.intel.com, tglx@linutronix.de, peterz@infradead.org, luto@amacapital.net, riel@redhat.com, bp@alien8.de, mingo@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org, ebiggers3@gmail.com, torvalds@linux-foundation.org, yu-cheng.yu@intel.com, akpm@linux-foundation.org, fenghua.yu@intel.com, oleg@redhat.com, hpa@zytor.com Reply-To: fenghua.yu@intel.com, oleg@redhat.com, hpa@zytor.com, ebiggers3@gmail.com, torvalds@linux-foundation.org, yu-cheng.yu@intel.com, akpm@linux-foundation.org, mingo@kernel.org, bp@alien8.de, ak@linux.intel.com, peterz@infradead.org, riel@redhat.com, luto@amacapital.net, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de In-Reply-To: <20170923130016.21448-24-mingo@kernel.org> References: <20170329062605.4970-1-andi@firstfloor.org> <20170923130016.21448-24-mingo@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Turn WARN_ON() in context switch into WARN_ON_FPU() Git-Commit-ID: 03eaec81ac09814817e9f0307d572ffe8365f980 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 03eaec81ac09814817e9f0307d572ffe8365f980 Gitweb: http://git.kernel.org/tip/03eaec81ac09814817e9f0307d572ffe8365f980 Author: Andi Kleen AuthorDate: Sat, 23 Sep 2017 15:00:06 +0200 Committer: Ingo Molnar CommitDate: Sun, 24 Sep 2017 13:04:35 +0200 x86/fpu: Turn WARN_ON() in context switch into WARN_ON_FPU() copy_xregs_to_kernel checks if the alternatives have been already patched. This WARN_ON() is always executed in every context switch. All the other checks in fpu internal.h are WARN_ON_FPU(), but this one is plain WARN_ON(). I assume it was forgotten to switch it. So switch it to WARN_ON_FPU() too to avoid some unnecessary code in the context switch, and a potentially expensive cache line miss for the global variable. Signed-off-by: Andi Kleen Cc: Andrew Morton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Eric Biggers Cc: Fenghua Yu Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Yu-cheng Yu Link: http://lkml.kernel.org/r/20170329062605.4970-1-andi@firstfloor.org Link: http://lkml.kernel.org/r/20170923130016.21448-24-mingo@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/fpu/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 629e7abc..2dca7c6 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -350,7 +350,7 @@ static inline void copy_xregs_to_kernel(struct xregs_state *xstate) u32 hmask = mask >> 32; int err; - WARN_ON(!alternatives_patched); + WARN_ON_FPU(!alternatives_patched); XSTATE_XSAVE(xstate, lmask, hmask, err);