From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1172429AbdDXVCO (ORCPT ); Mon, 24 Apr 2017 17:02:14 -0400 Received: from terminus.zytor.com ([65.50.211.136]:39703 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S977970AbdDXVCH (ORCPT ); Mon, 24 Apr 2017 17:02:07 -0400 Date: Mon, 24 Apr 2017 14:00:58 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: ak@linux.intel.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: ak@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org In-Reply-To: <20170329062605.4970-1-andi@firstfloor.org> References: <20170329062605.4970-1-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] x86/fpu: Turn WARN_ON() in context switch into WARN_ON_FPU() Git-Commit-ID: 6061efb6ee6fc891498a23994a4d0a5e2a52c059 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: 6061efb6ee6fc891498a23994a4d0a5e2a52c059 Gitweb: http://git.kernel.org/tip/6061efb6ee6fc891498a23994a4d0a5e2a52c059 Author: Andi Kleen AuthorDate: Tue, 28 Mar 2017 23:26:05 -0700 Committer: Ingo Molnar CommitDate: Fri, 31 Mar 2017 11:20:05 +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: Thomas Gleixner Link: http://lkml.kernel.org/r/20170329062605.4970-1-andi@firstfloor.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 bbee00aa..8044dc1 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);