[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Arm64: make setup_virt_paging()'s pa_range_info[] static


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Nov 2022 15:39:05 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a3OpF1woK9VvvQNT661w/BfGQpJYfrcyi80/QATXGsc=; b=cNTCv03GkKGrecL1mwTxNBwkLNETAaK3cdtlmN5rT2LvtqMnurPP7aXxImqpRRn8AsXJlxMzcHQRjjIv28n1mHOHqemQO1C9Cq0oA2afFLu1D3oX7ucEOXy2ELptX1QG5LMm6EccyiSVozp8uocmb24pEUwPCuiqzXp9wRR8AoQIjzvPvyKD5HQcJVKKP4AnPTZLfMyVghM77yKSxAalPjGu2Am+iehCCKtQT6kwDHHdPPW9f/+tlJZS7HWoWznizFNoKnesO9MGR+9E1IWEVVEK3P1o0R64UwandqiCB+KDBEcLLjdR/O5VIUzzqTu9Oo4WoAOCb1eTN2lwpYxtzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LQlETgz0hFhyPmHf4oxK2JSsanQdu48Q2bN4IxhLmPJ44C1t2yu2BAs/Iu0LYBONav0ejyl0xIumzRbewx9QS0m8nXY8XJ/A0y7LbKEYmphxGGOnvEcbG61umJ1yPAH4N/3C14ntP/x4rJJ+M+ha1fwAQ+agiYbwMfK07TGIK+I9ifJbdGbDdKyNXgeMen1GYMURjFKDS7Tq5LVtTd+m1PwHWr0OyDmEbShFqYtKtPr1R5KGkJdLEVjDFQZvKiMJBIvOPn/ZiZiPPZ8k9ifV8E8WQaMRtlPo+t+XpG+FVxjmvW82G/rVgCxkxF6X9K0VPoKvdT7yn/hgy/0xkJdEow==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Tue, 29 Nov 2022 14:39:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

While not as inefficient as it would be on x86 (due to suitable constant
loading and register pair storing instructions being available to fill
some of the fields), having the compiler construct an array of constants
on the stack still looks odd to me.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Actual space savings could be had if further converting the field types
to e.g. unsigned char (all of the values fit in that type).

--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -2281,12 +2281,12 @@ void __init setup_virt_paging(void)
     val |= VTCR_T0SZ(0x18); /* 40 bit IPA */
     val |= VTCR_SL0(0x1); /* P2M starts at first level */
 #else /* CONFIG_ARM_64 */
-    const struct {
+    static const struct {
         unsigned int pabits; /* Physical Address Size */
         unsigned int t0sz;   /* Desired T0SZ, minimum in comment */
         unsigned int root_order; /* Page order of the root of the p2m */
         unsigned int sl0;    /* Desired SL0, maximum in comment */
-    } pa_range_info[] = {
+    } pa_range_info[] __initconst = {
         /* T0SZ minimum and SL0 maximum from ARM DDI 0487H.a Table D5-6 */
         /*      PA size, t0sz(min), root-order, sl0(max) */
         [0] = { 32,      32/*32*/,  0,          1 },



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.