From patchwork Tue Mar 19 23:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10860579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC1656C2 for ; Tue, 19 Mar 2019 23:29:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCBBC297C2 for ; Tue, 19 Mar 2019 23:29:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF9D4297CA; Tue, 19 Mar 2019 23:29:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49761297C2 for ; Tue, 19 Mar 2019 23:29:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h6O9K-0001zp-2e; Tue, 19 Mar 2019 23:28:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h6O9H-0001zk-Se for xen-devel@lists.xenproject.org; Tue, 19 Mar 2019 23:27:59 +0000 X-Inumbo-ID: a1c0928c-4a9e-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a1c0928c-4a9e-11e9-bc90-bc764e045a96; Tue, 19 Mar 2019 23:27:59 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD4B91596; Tue, 19 Mar 2019 16:27:58 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F09A23F575; Tue, 19 Mar 2019 16:27:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 19 Mar 2019 23:27:53 +0000 Message-Id: <20190319232753.26521-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH] xen/arm64: head: Combine lsl and str instructions in a single one X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Julien Grall We can optimize a bit the assembly code by combining the 2 instructions in a single one. This likely not going to make the code faster, but likely make easier to read the assembly. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/arm64/head.S | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 0b7f6e7f92..4589a37874 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -418,8 +418,7 @@ skip_bss: mov x3, #PT_PT /* x2 := table map of boot_first_id */ orr x2, x2, x3 /* + rights for linear PT */ - lsl x1, x1, #3 /* x1 := Slot offset */ - str x2, [x4, x1] + str x2, [x4, x1, lsl #3] load_paddr x4, boot_first_id @@ -428,8 +427,7 @@ skip_bss: mov x3, #PT_MEM /* x2 := Section map */ orr x2, x2, x3 and x1, x1, #LPAE_ENTRY_MASK /* x1 := Slot offset */ - lsl x1, x1, #3 - str x2, [x4, x1] /* Mapping of paddr(start) */ + str x2, [x4, x1, lsl #3] /* Mapping of paddr(start) */ mov x25, #1 /* x25 := identity map now in place */ 1: /* Setup boot_first: */ @@ -450,8 +448,7 @@ skip_bss: lsl x2, x2, #FIRST_SHIFT /* Base address for 1GB mapping */ mov x3, #PT_MEM /* x2 := Section map */ orr x2, x2, x3 - lsl x1, x1, #3 /* x1 := Slot offset */ - str x2, [x4, x1] /* Create mapping of paddr(start)*/ + str x2, [x4, x1, lsl #3] /* Create mapping of paddr(start)*/ mov x25, #1 /* x25 := identity map now in place */ 1: /* Setup boot_second: */ @@ -473,8 +470,7 @@ skip_bss: lsl x2, x2, #SECOND_SHIFT /* Base address for 2MB mapping */ mov x3, #PT_MEM /* x2 := Section map */ orr x2, x2, x3 - lsl x1, x1, #3 /* x1 := Slot offset */ - str x2, [x4, x1] /* Create mapping of paddr(start)*/ + str x2, [x4, x1, lsl #3] /* Create mapping of paddr(start)*/ mov x25, #1 /* x25 := identity map now in place */ 1: /* Setup boot_third: */