From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753649AbdC2G0T (ORCPT ); Wed, 29 Mar 2017 02:26:19 -0400 Received: from mga11.intel.com ([192.55.52.93]:60967 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753134AbdC2G0S (ORCPT ); Wed, 29 Mar 2017 02:26:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,239,1486454400"; d="scan'208";a="1148249749" From: Andi Kleen To: x86@kernel.org Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH] x86/fpu: Turn WARN_ON in context switch into WARN_ON_FPU Date: Tue, 28 Mar 2017 23:26:05 -0700 Message-Id: <20170329062605.4970-1-andi@firstfloor.org> X-Mailer: git-send-email 2.9.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen 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. (or could be removed since if it hasn't triggered by now it probably never will) Signed-off-by: Andi Kleen --- 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 d4a684997497..ec0c542a91ab 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -340,7 +340,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); -- 2.9.3