From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6EFFC433EF for ; Thu, 4 Nov 2021 17:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0AAC6124B for ; Thu, 4 Nov 2021 17:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbhKDREV (ORCPT ); Thu, 4 Nov 2021 13:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbhKDREJ (ORCPT ); Thu, 4 Nov 2021 13:04:09 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50C86C06120A for ; Thu, 4 Nov 2021 10:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=GP01YFM16qeWeivEJh41tvuNdAjyBsO9/aV4rwEvVJo=; b=ugHfpiLyVEGNlLYx8Gy1wM502e X4NaW5RkEE/vtkux0fzFrq1eKS2ViorMqjbSKeqvfJAR1wk7y6q78EtLKxm3bwsePtBonivtZa+5x qB3u5OLILd+7RKRpvUzzhSF75KcyVmVEtad7c49GR5D0dLZUZ2l0fOgfymvuBxNo239dpWpZfE9OP D+GNaboGSD1vyky3cJE0rxapG4F1UAXHUBFF5fG8xFwhVw35nKciajy44tdbcU+Iab5/xsdvbfXVF Uvr+RpXvd3JIVWip8HqWtmpJ2dhZHuV3aaEUYD7i7T2ZtLdBpBKUnm0oi539gA/tZ0QBAI4U5cvFJ mWKww1PQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mig2X-0060FZ-CB; Thu, 04 Nov 2021 16:57:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5B168301A54; Thu, 4 Nov 2021 17:56:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 3CBA92DD49FBE; Thu, 4 Nov 2021 17:56:35 +0100 (CET) Message-ID: <20211104165525.228321055@infradead.org> User-Agent: quilt/0.66 Date: Thu, 04 Nov 2021 17:47:41 +0100 From: Peter Zijlstra To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, jpoimboe@redhat.com, mark.rutland@arm.com, dvyukov@google.com, seanjc@google.com, pbonzini@redhat.com, mbenes@suse.cz Subject: [RFC][PATCH 12/22] x86,fpu: Remove .fixup usage References: <20211104164729.226550532@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Employ EX_TYPE_NEG_REG to store '-1' into the %[err] register on exception. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/fpu/legacy.h | 6 +----- arch/x86/kernel/fpu/xstate.h | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) --- a/arch/x86/kernel/fpu/legacy.h +++ b/arch/x86/kernel/fpu/legacy.h @@ -35,11 +35,7 @@ static inline void ldmxcsr(u32 mxcsr) int err; \ asm volatile("1:" #insn "\n\t" \ "2:\n" \ - ".section .fixup,\"ax\"\n" \ - "3: movl $-1,%[err]\n" \ - " jmp 2b\n" \ - ".previous\n" \ - _ASM_EXTABLE(1b, 3b) \ + _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_NEG_REG, %[err]) \ : [err] "=r" (err), output \ : "0"(0), input); \ err; \ --- a/arch/x86/kernel/fpu/xstate.h +++ b/arch/x86/kernel/fpu/xstate.h @@ -107,11 +107,7 @@ static inline u64 xfeatures_mask_indepen "\n" \ "xor %[err], %[err]\n" \ "3:\n" \ - ".pushsection .fixup,\"ax\"\n" \ - "4: movl $-2, %[err]\n" \ - "jmp 3b\n" \ - ".popsection\n" \ - _ASM_EXTABLE(661b, 4b) \ + _ASM_EXTABLE_TYPE_REG(661b, 3b, EX_TYPE_NEG_REG, %[err]) \ : [err] "=r" (err) \ : "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \ : "memory")