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: 160621 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp133669jad; Tue, 19 Mar 2019 16:29:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6BhDfCuEJZDdsjuBBhk9cZ2sAiD7dXPR7zxB5WChec9XN1kOFDU28t+dz/mRP2+2u2d0j X-Received: by 2002:a81:6054:: with SMTP id u81mr4326415ywb.189.1553038167693; Tue, 19 Mar 2019 16:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553038167; cv=none; d=google.com; s=arc-20160816; b=wDuFuoR6UnhQ+cpLEqUy67N4q42hfw3+bUu9C+x8c0rMkwONckV9foo7MsxeHDusp4 sesoAEIACDvPw2bYDbaSsgRRqTZmEehNuT2Sw0+AVrdm+GlmIpm1wWKnYSh25G5vctmg W+sTu7b8iigbTduO1uemTWirxz3WrFkGaSMiY7mrXstCiTacI/U1+Hbs2oDIQi8EB7f0 qRJ8Nar89szs5ZxDkMbI/uXs1pteeRkooTPdvIN9OoH4kx+PpEBpmOqdSB2T9PMBuVei JwnXpDMH+cdLrkkf8b9AwLyJel0n0bphwKrftcVuEfqJ57InhoaDI2w2Y10pIaDnxSVA cggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:message-id:date:to:from; bh=Kn6HlOVevuRYWAO7nipGT/UtYdCHJUI7g4oER0yks4Q=; b=eovSfBORFm7IFT9knjjvI2qr+EgifojOTi7xGV8SJFHVqL/vKMFm2maGXcsGceULYw LSqomdhRpiiFPt8a3BIsNZEHSuF+Y8I6b3B3lKlhYGMDqS8Xiyjuuuop6LLE0MEPfwfb LvOI0nJlWlvu05/GVMv4q9xOvoshD8VaRpLrchCPGsh+imdP2aH7csRF5/JiBq9jCkwl KW55opw90urNFzAJs33HboI3SnvPm6fCLOtoupRDWwtHF+9RNqLJPZbXF14ozKS8kim8 litHbZcp5oq3kmhF2y3MRjw4M8d06DiOI8dJDM3dvMPK8u2TXUbUM90xzvH+eWLkAu/D vmew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 205si237812ybg.16.2019.03.19.16.29.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 16:29:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org 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" 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: */