All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: Luca.Fancellu@arm.com, michal.orzel@amd.com, Henry.Wang@arm.com,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 8/9] xen/arm: Allow the user to build Xen with USBAN
Date: Sun, 25 Jun 2023 21:49:06 +0100	[thread overview]
Message-ID: <20230625204907.57291-9-julien@xen.org> (raw)
In-Reply-To: <20230625204907.57291-1-julien@xen.org>

From: Julien Grall <jgrall@amazon.com>

UBSAN has been enabled a few years ago on x86 but was never
enabled on Arm because the final binary is bigger than 2MB (
the maximum we can currently handled).

With the recent rework, it is now possible to grow Xen over 2MB.
So there is no more roadblock to enable Xen other than increasing
the reserved area.

On my setup, for arm32, the final binaray was very close to 4MB.
Furthermore, one may want to enable USBAN and GCOV which would put
the binary well-over 4MB (both features require for some space).
Therefore, increase the size to 8MB which should us some margin.

Signed-off-by: Julien Grall <jgrall@amazon.com>

----

The drawback with this approach is that we are adding 6 new
page-table (3 for boot and 3 for runtime) that are statically
allocated. So the final Xen binary will be 24KB bigger when
neither UBSAN nor GCOV.

If this is not considered acceptable, then we could make the
size of configurable in the Kconfig and decide it based on the
features enabled.
---
 xen/arch/arm/Kconfig              |  1 +
 xen/arch/arm/include/asm/config.h | 18 +++++++++---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 61e581b8c2b0..06b5ff755c95 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -17,6 +17,7 @@ config ARM
 	select HAS_PASSTHROUGH
 	select HAS_PDX
 	select HAS_PMAP
+	select HAS_UBSAN
 	select IOMMU_FORCE_PT_SHARE
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/arm/include/asm/config.h b/xen/arch/arm/include/asm/config.h
index 6d246ab23c48..1bbf4cc9958d 100644
--- a/xen/arch/arm/include/asm/config.h
+++ b/xen/arch/arm/include/asm/config.h
@@ -74,10 +74,10 @@
 /*
  * ARM32 layout:
  *   0  -   2M   Unmapped
- *   2M -   4M   Xen text, data, bss
- *   4M -   6M   Fixmap: special-purpose 4K mapping slots
- *   6M -  10M   Early boot mapping of FDT
- *   10M - 12M   Livepatch vmap (if compiled in)
+ *   2M -  10M   Xen text, data, bss
+ *  10M -  12M   Fixmap: special-purpose 4K mapping slots
+ *  12M -  16M   Early boot mapping of FDT
+ *  16M -  18M   Livepatch vmap (if compiled in)
  *
  *  32M - 128M   Frametable: 32 bytes per page for 12GB of RAM
  * 256M -   1G   VMAP: ioremap and early_ioremap use this virtual address
@@ -94,10 +94,10 @@
  * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
  *  (Relative offsets)
  *   0  -   2M   Unmapped
- *   2M -   4M   Xen text, data, bss
- *   4M -   6M   Fixmap: special-purpose 4K mapping slots
- *   6M -  10M   Early boot mapping of FDT
- *  10M -  12M   Livepatch vmap (if compiled in)
+ *   2M -  10M   Xen text, data, bss
+ *  10M -  12M   Fixmap: special-purpose 4K mapping slots
+ *  12M -  16M   Early boot mapping of FDT
+ *  16M -  18M   Livepatch vmap (if compiled in)
  *
  *   1G -   2G   VMAP: ioremap and early_ioremap
  *
@@ -124,7 +124,7 @@
 #define XEN_VIRT_START          (SLOT0(4) + _AT(vaddr_t, MB(2)))
 #endif
 
-#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(2))
+#define XEN_VIRT_SIZE           _AT(vaddr_t, MB(8))
 #define XEN_NR_ENTRIES(lvl)     (XEN_VIRT_SIZE / XEN_PT_LEVEL_SIZE(lvl))
 
 #define FIXMAP_VIRT_START       (XEN_VIRT_START + XEN_VIRT_SIZE)
-- 
2.40.1



  parent reply	other threads:[~2023-06-25 20:49 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25 20:48 [PATCH 0/9] xen/arm: Enable UBSAN support Julien Grall
2023-06-25 20:48 ` [PATCH 1/9] xen/arm: Check Xen size when linking Julien Grall
2023-06-26  6:15   ` Henry Wang
2023-06-26  7:10     ` Julien Grall
2023-06-26  7:14       ` Henry Wang
2023-06-26 11:24   ` Michal Orzel
2023-06-28 18:13     ` Julien Grall
2023-06-25 20:49 ` [PATCH 2/9] xen/arm64: head: Don't map too much in boot_third Julien Grall
2023-06-26 11:28   ` Michal Orzel
2023-06-28 18:21     ` Julien Grall
2023-06-29  7:26       ` Michal Orzel
2023-06-29 12:28         ` Julien Grall
2023-06-25 20:49 ` [PATCH 3/9] xen/arm32: " Julien Grall
2023-06-26 11:30   ` Michal Orzel
2023-06-25 20:49 ` [PATCH 4/9] xen/arm32: head: Remove 'r6' from the clobber list of create_page_tables() Julien Grall
2023-06-26  6:37   ` Henry Wang
2023-06-26 11:31   ` Michal Orzel
2023-06-28 10:12   ` Bertrand Marquis
2023-06-25 20:49 ` [PATCH 5/9] xen/arm: Rework the code mapping Xen to avoid relying on the size of Xen Julien Grall
2023-06-26 11:43   ` Michal Orzel
2023-06-28 20:02     ` Julien Grall
2023-06-29  7:30       ` Michal Orzel
2023-06-25 20:49 ` [PATCH 6/9] xen/arm64: entry: Don't jump outside of an alternative Julien Grall
2023-06-27  7:52   ` Michal Orzel
2023-06-25 20:49 ` [PATCH 7/9] xen/arm64: head: Rework PRINT() to work when the string is not withing +/- 1MB Julien Grall
2023-06-26 11:50   ` Michal Orzel
2023-06-26 14:44   ` Henry Wang
2023-06-25 20:49 ` Julien Grall [this message]
2023-06-26  7:29   ` [PATCH 8/9] xen/arm: Allow the user to build Xen with USBAN Henry Wang
2023-06-26 11:57     ` Andrew Cooper
2023-06-28 20:35     ` Julien Grall
2023-06-29  1:36       ` Henry Wang
2023-06-29 20:01         ` Julien Grall
2023-06-26 11:56   ` Michal Orzel
2023-06-26 12:56     ` Julien Grall
2023-06-27  8:09       ` Michal Orzel
2023-06-28 20:39         ` Julien Grall
2023-06-28 22:16           ` Luca Fancellu
2023-06-29  7:31           ` Michal Orzel
2023-06-25 20:49 ` [PATCH 9/9] xen/arm32: vfp: Add missing U for shifted constant Julien Grall
2023-06-26  6:43   ` Henry Wang
2023-06-28 10:09   ` Bertrand Marquis
2023-06-26  5:45 ` [PATCH 0/9] xen/arm: Enable UBSAN support Jan Beulich
2023-06-26  7:18   ` Julien Grall
2023-06-26 14:38 ` Henry Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230625204907.57291-9-julien@xen.org \
    --to=julien@xen.org \
    --cc=Henry.Wang@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jgrall@amazon.com \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.