From patchwork Mon Mar 20 13:18:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13181231 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF921C7618A for ; Mon, 20 Mar 2023 13:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TxRhbubOGVb8MNnaqmfbDrf/i9IQIrUp+NnOCmBldY8=; b=p/QyExWW285KZN udR+KW85EZLizQkbeiFNna/vCkY//oF32U7x8U7pccv+pRW+t0U1c6UKaJ4CKRBSnM3CZJJBLEXCn AJReMmzL/bUTWKi9JLFfqDMfdY6ysVRJGCiX4Y+47taJ+DAJja1oJJ2gDWy25xlkc4SwwBOAAxPjE 17dt8Iqb7w7Z2+n0sWWQa45cdkRQ63TsTFz0heWRvzNVyGzl3EpuPIB2GJP0dyukZG7C6+9+I69sr B6KtOcK8gu9NI/nJFt/FrPCUEdvi0NWPqW2xUyTWZSgMkxkStU0iY+wJp/BDEWI9si2eVxGvotSbD YK2qTRf4L/wfqwgK12cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peFQV-0096K1-1m; Mon, 20 Mar 2023 13:19:51 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peFPy-00960L-0Y for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2023 13:19:19 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B60161245; Mon, 20 Mar 2023 13:19:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C69C433A4; Mon, 20 Mar 2023 13:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679318357; bh=mrkqRia/8nyqoyQrBjH/j08RaxzdU6JSnpJVhNUANj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZnNwcG5j6SsRuolAG6p5gi6A+JWG+0wcEDNyfApWcBckh6axkuOkgSO/fzCyObjo rg+s74Bpq7LOtWJO9xzE/HGSFP2TFTtkxvQ3ThKf98159ZxGF42WnAbzhSApA0/PPX R/+MtLtnAi3yaBFe8dGeScIaHN4Pnu4y2NGRld0wx5vjd1UMb7UgqVBI/6bcUaThCN JAEFMNU+0bFAB9R3vKkcPoQyE0dfxiFgRucjekVCPGwxVxj324++ePXC5zcW515wp5 nQwyAJOM6vTFXnTn7TBWvtKuL6OiJ3+SHKeq4iH7l/yNy5mizl3PCm4iViG44pmpUb hmrNCbCTLJPMg== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk Cc: Ard Biesheuvel , Frederic Weisbecker , Guenter Roeck , Peter Zijlstra , Linus Walleij , Arnd Bergmann Subject: [PATCH v4 12/12] ARM: entry: Make asm coproc dispatch code NWFPE only Date: Mon, 20 Mar 2023 14:18:45 +0100 Message-Id: <20230320131845.3138015-13-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230320131845.3138015-1-ardb@kernel.org> References: <20230320131845.3138015-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1683; i=ardb@kernel.org; h=from:subject; bh=mrkqRia/8nyqoyQrBjH/j08RaxzdU6JSnpJVhNUANj4=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIUUi1vSuxMJ/ZZu5lfU/7D499ZhrrFug8wFplUgN1b8fH q+a5MLZUcrCIMbBICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACZytpbhr9w28Q3265ar9q6u zpJ4PtVxwxN9xrjmv9Z+u8Q/OMb/dGH4XybIukKh84E3S6c8w9y8OZufiv2Pllj0SIcjuffIEel gVgA= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230320_061918_254437_F89C8C13 X-CRM114-Status: GOOD ( 13.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we can dispatch all VFP and iWMMXT related undef exceptions using undef hooks implemented in C code, we no longer need the asm entry code that takes care of this unless we are using FPE. As this means it is ARM only, we can also remove the Thumb2 specific decorations. It also means the non-standard, asm-only calling convention where returning via LR means failure and returning via R9 means success is now only used on legacy platforms that lack any kind of function return prediction, avoiding the associated performance impact. Signed-off-by: Ard Biesheuvel Reviewed-by: Linus Walleij --- arch/arm/kernel/entry-armv.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 0367c9581c1f05a6..5552179faf7a469e 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -532,8 +532,9 @@ ENDPROC(__und_usr) * IRQs enabled, FIQs enabled. */ call_fpe: - badr r9, ret_from_exception - badr lr, __und_usr_fault_32 +#ifdef CONFIG_FPE_NWFPE + adr r9, ret_from_exception + adr lr, __und_usr_fault_32 sub r4, r2, #4 @ ARM instr at LR - 4 USERL( 4b, ldrt r0, [r4]) @@ -554,9 +555,7 @@ ARM_BE8(rev r0, r0) @ little endian instruction teqeq r5, #1 << TIF_USING_IWMMXT @ check whether it is set beq iwmmxt_task_enable @ branch if set #endif - ARM( add pc, pc, r8, lsr #6 ) - THUMB( lsr r8, r8, #6 ) - THUMB( add pc, r8 ) + add pc, pc, r8, lsr #6 nop ret.w lr @ CP#0 @@ -598,6 +597,7 @@ ENTRY(fp_enter) ENTRY(no_fp) ret lr ENDPROC(no_fp) +#endif __und_usr_fault_32: mov r1, #4