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 X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3B28C43464 for ; Fri, 18 Sep 2020 10:31:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7ACC72311B for ; Fri, 18 Sep 2020 10:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600425077; bh=8gU0ai9cxzUF92a9lzW8kCl46shP0CmuPk9ZEpvhNFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QF6jio9NTwEFi/QzbhlcvyE3OgCrBDVfq2HY1ugsSF/BkQznd/P8AjuYFNXOFpYMS FTc0GsqHdkPG89YxtU3Kt+LfaZR++sMMw/wvd7nex4odVUufGv3GTD1RHh1ehwNVV0 NhF+dl852YWEKjjODmS1WYWgYoyWXL6HM/G2W214= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbgIRKbR (ORCPT ); Fri, 18 Sep 2020 06:31:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgIRKbQ (ORCPT ); Fri, 18 Sep 2020 06:31:16 -0400 Received: from e123331-lin.nice.arm.com (adsl-119.109.242.22.tellas.gr [109.242.22.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19BE321D92; Fri, 18 Sep 2020 10:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600425076; bh=8gU0ai9cxzUF92a9lzW8kCl46shP0CmuPk9ZEpvhNFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1LxIet9m7vLFSaL/8TDpwkhqXc3EUzNssB9vhD6OX/xQMshOKa6KhZ50v86/jfUIj DQZQtD8wGtYRLggw6HvPzKakMsiPz1qenpsBHUkbtVpTgVMxv+QgXfunnGMhDgAD3D 2hohLDv6mqOE/eLY8CxDxyb9Gh1cobxcnA+8VJL0= From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org, Ard Biesheuvel , Zhen Lei , Russell King , Santosh Shilimkar , Linus Walleij , Nicolas Pitre Subject: [RFC/RFT PATCH 2/6] ARM: p2v: factor out BE8 handling Date: Fri, 18 Sep 2020 13:30:58 +0300 Message-Id: <20200918103102.18107-3-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200918103102.18107-1-ardb@kernel.org> References: <20200918103102.18107-1-ardb@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 9a0c11ac8281..c2a912121e3e 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -669,26 +669,24 @@ ARM_BE8(rev16 ip, ip) strh ip, [r7] #else #ifdef CONFIG_CPU_ENDIAN_BE8 - moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction +@ in BE8, we load data in BE, but instructions still in LE +#define PV_BIT22 0x00004000 +#define PV_IMM8_MASK 0xff000000 +#define PV_ROT_MASK 0x000f0000 #else - moveq r0, #0x400000 @ set bit 22, mov to mvn instruction +#define PV_BIT22 0x00400000 +#define PV_IMM8_MASK 0x000000ff +#define PV_ROT_MASK 0xf00 #endif + + moveq r0, #PV_BIT22 @ set bit 22, mov to mvn instruction b .Lnext .Lloop: ldr ip, [r7, r3] -#ifdef CONFIG_CPU_ENDIAN_BE8 - @ in BE8, we load data in BE, but instructions still in LE - bic ip, ip, #0xff000000 - tst ip, #0x000f0000 @ check the rotation field - orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 - biceq ip, ip, #0x00004000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 -#else - bic ip, ip, #0x000000ff - tst ip, #0xf00 @ check the rotation field - orrne ip, ip, r6 @ mask in offset bits 31-24 - biceq ip, ip, #0x400000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 -#endif + bic ip, ip, #PV_IMM8_MASK + tst ip, #PV_ROT_MASK @ check the rotation field + orrne ip, ip, r6 ARM_BE8(, lsl #24) @ mask in offset bits 31-24 + biceq ip, ip, #PV_BIT22 @ clear bit 22 + orreq ip, ip, r0 @ mask in offset bits 7-0 str ip, [r7, r3] #endif -- 2.17.1 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 X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A97E1C43463 for ; Fri, 18 Sep 2020 10:32:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 432F920771 for ; Fri, 18 Sep 2020 10:32:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zxbFiUb0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="1LxIet9m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 432F920771 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YnhoEhpSOq1IEpttkLKiOReM/vz0LR8iv+vyMa3tqcU=; b=zxbFiUb0qbvM/o0dory93PxpGC H1JvdD9bHZI3ErDlthymNfB4Xu5o5PdnDqUFqh6+cGCE7tUindGgbugRgvNb2I1skq1dkwcmImsCq kBT4Sb/HWX2wGLGiPn4EG8aZkWmzpUg5dMuIXG4lmcA1rqz6bs70mF4IvGfSOHfRcx5sF5eauJZ3B mSyHGgb3z/VZZnCNJ9MzsNApAdQc5O/9eqsR45Cj/WbLKINhH42/QKb4FPDenKn8W0mWfuvJiF1rU H1q7TrulRM20yO2v0Wj5eMEDD14lczwLkFdeE+Zna/ne+hOrdAm4QLrfmmw+N24rom1k/ArrDm+1p K9LN5Dgw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJDfm-0000qX-KH; Fri, 18 Sep 2020 10:31:22 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJDfg-0000pG-UW for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 10:31:17 +0000 Received: from e123331-lin.nice.arm.com (adsl-119.109.242.22.tellas.gr [109.242.22.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19BE321D92; Fri, 18 Sep 2020 10:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600425076; bh=8gU0ai9cxzUF92a9lzW8kCl46shP0CmuPk9ZEpvhNFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1LxIet9m7vLFSaL/8TDpwkhqXc3EUzNssB9vhD6OX/xQMshOKa6KhZ50v86/jfUIj DQZQtD8wGtYRLggw6HvPzKakMsiPz1qenpsBHUkbtVpTgVMxv+QgXfunnGMhDgAD3D 2hohLDv6mqOE/eLY8CxDxyb9Gh1cobxcnA+8VJL0= From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [RFC/RFT PATCH 2/6] ARM: p2v: factor out BE8 handling Date: Fri, 18 Sep 2020 13:30:58 +0300 Message-Id: <20200918103102.18107-3-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200918103102.18107-1-ardb@kernel.org> References: <20200918103102.18107-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200918_063117_117431_2091FD1D X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi@vger.kernel.org, Nicolas Pitre , Linus Walleij , Russell King , Santosh Shilimkar , Zhen Lei , Ard Biesheuvel MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 9a0c11ac8281..c2a912121e3e 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -669,26 +669,24 @@ ARM_BE8(rev16 ip, ip) strh ip, [r7] #else #ifdef CONFIG_CPU_ENDIAN_BE8 - moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction +@ in BE8, we load data in BE, but instructions still in LE +#define PV_BIT22 0x00004000 +#define PV_IMM8_MASK 0xff000000 +#define PV_ROT_MASK 0x000f0000 #else - moveq r0, #0x400000 @ set bit 22, mov to mvn instruction +#define PV_BIT22 0x00400000 +#define PV_IMM8_MASK 0x000000ff +#define PV_ROT_MASK 0xf00 #endif + + moveq r0, #PV_BIT22 @ set bit 22, mov to mvn instruction b .Lnext .Lloop: ldr ip, [r7, r3] -#ifdef CONFIG_CPU_ENDIAN_BE8 - @ in BE8, we load data in BE, but instructions still in LE - bic ip, ip, #0xff000000 - tst ip, #0x000f0000 @ check the rotation field - orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 - biceq ip, ip, #0x00004000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 -#else - bic ip, ip, #0x000000ff - tst ip, #0xf00 @ check the rotation field - orrne ip, ip, r6 @ mask in offset bits 31-24 - biceq ip, ip, #0x400000 @ clear bit 22 - orreq ip, ip, r0 @ mask in offset bits 7-0 -#endif + bic ip, ip, #PV_IMM8_MASK + tst ip, #PV_ROT_MASK @ check the rotation field + orrne ip, ip, r6 ARM_BE8(, lsl #24) @ mask in offset bits 31-24 + biceq ip, ip, #PV_BIT22 @ clear bit 22 + orreq ip, ip, r0 @ mask in offset bits 7-0 str ip, [r7, r3] #endif -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel