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

Re: [PATCH v4 2/2] xen/arm: Enlarge identity map space to 10TB


  • To: "leo.yan@xxxxxxxxxx" <leo.yan@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 16 Oct 2023 13:40:26 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=ztjbguKXdEz7z9rAKiDOM15tBB6Ho2eCZRga0DcrtYU=; b=T1b40x/ZbKsAuSwkenslKteDXR9eZS+4zbEtvlsk0nCfVy9I2kMsWb1Mpgxh5gzKw/4+IsLeP9OUL4Q+eLI2laeA2A18BgfgEXj+X9yn4/cJ8qsp2XRu8ZIAeT8gd7wHghZWQ+jh/+Q3STH/AVkQhA4JF+XWDPV/sTmelQKb9VAhR/DXGXmnWkqs8yEAUwD1CAh5zBAH8sPvauERrglCXyhNXHb/LP/qFWKLMOQmysU/KSwVewoUVcmTLopE0hbEXjn7pzxt/oGg2KhDtMfSKY4qXeG3Deaq230EVUr4W4tw4zU9EXB0wG/WWf7Bo4xdXxoMlNReuciydxBmApSy2g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JGFnKEqcfeRNEi9uKvIQElx93Nmf8Wlp62Nl8QPK4vA4x/CyMtWegtuC4GZU+SbcLGGZ01Y92mrCLq9gRaecWojfaC8HH1+a+Cb7nY9bGfW1FOuWgttv/+zfbwiLY3Bh4Xo4d9QqW42s7Z1Ke4aaFd5vmEwmUToOk/lgQKCc5t3TTGd2OMiQxX+Aw1G8yf1WN01psJ0nDJ9n98UmrRAwDoaIvcBTD/HjVwVDT5+cIrF8Sd3kE7kX4AWxt1ps+FnGctC+rONVHKd3zzV0TjO3AokV/9S6tSsV2jDsKKKhkUrT6TclQwSCOb1tjb+7wdNubEs5ihdKPQnYy3HXUeZTFg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Alexey Klimov <alexey.klimov@xxxxxxxxxx>
  • Delivery-date: Mon, 16 Oct 2023 13:40:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ/dCeetLGz4GvX0qAhZnpE9HtkrBMcPYA
  • Thread-topic: [PATCH v4 2/2] xen/arm: Enlarge identity map space to 10TB

Hi,

> On 13 Oct 2023, at 14:26, Leo Yan <leo.yan@xxxxxxxxxx> wrote:
> 
> On ADLink AVA platform (Ampere Altra SoC with 32 Arm Neoverse N1 cores),
> the physical memory regions are:
> 
>  DRAM memory regions:
>    Node[0] Region[0]: 0x000080000000 - 0x0000ffffffff
>    Node[0] Region[1]: 0x080000000000 - 0x08007fffffff
>    Node[0] Region[2]: 0x080100000000 - 0x0807ffffffff
> 
> The UEFI loads Xen hypervisor and DTB into the high memory, the kernel
> and ramdisk images are loaded into the low memory space:
> 
>  (XEN) MODULE[0]: 00000807f6df0000 - 00000807f6f3e000 Xen
>  (XEN) MODULE[1]: 00000807f8054000 - 00000807f8056000 Device Tree
>  (XEN) MODULE[2]: 00000000fa834000 - 00000000fc5de1d5 Ramdisk
>  (XEN) MODULE[3]: 00000000fc5df000 - 00000000ffb3f810 Kernel
> 
> In this case, the Xen binary is loaded above 8TB, which exceeds the
> maximum supported identity map space of 2TB in Xen. Consequently, the
> system fails to boot.
> 
> This patch enlarges identity map space to 10TB, allowing module loading
> within the range of [0x0 .. 0x000009ff_ffff_ffff].
> 
> Fixes: 1c78d76b67 ("xen/arm64: mm: Introduce helpers to 
> prepare/enable/disable")

I agree with Michal here, this is not a fix so this should be removed (can be 
done
on commit).

> Reported-by: Alexey Klimov <alexey.klimov@xxxxxxxxxx>
> Signed-off-by: Leo Yan <leo.yan@xxxxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> xen/arch/arm/arm64/mm.c               | 6 ++++--
> xen/arch/arm/include/asm/mmu/layout.h | 8 ++++----
> 2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/mm.c b/xen/arch/arm/arm64/mm.c
> index 78b7c7eb00..cb69df0661 100644
> --- a/xen/arch/arm/arm64/mm.c
> +++ b/xen/arch/arm/arm64/mm.c
> @@ -41,7 +41,8 @@ static void __init prepare_boot_identity_mapping(void)
>     clear_page(boot_third_id);
> 
>     if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
> -        panic("Cannot handle ID mapping above 2TB\n");
> +        panic("Cannot handle ID mapping above %uTB\n",
> +              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
> 
>     /* Link first ID table */
>     pte = mfn_to_xen_entry(virt_to_mfn(boot_first_id), MT_NORMAL);
> @@ -74,7 +75,8 @@ static void __init prepare_runtime_identity_mapping(void)
>     DECLARE_OFFSETS(id_offsets, id_addr);
> 
>     if ( id_offsets[0] >= IDENTITY_MAPPING_AREA_NR_L0 )
> -        panic("Cannot handle ID mapping above 2TB\n");
> +        panic("Cannot handle ID mapping above %uTB\n",
> +              IDENTITY_MAPPING_AREA_NR_L0 >> 1);
> 
>     /* Link first ID table */
>     pte = pte_of_xenaddr((vaddr_t)xen_first_id);
> diff --git a/xen/arch/arm/include/asm/mmu/layout.h 
> b/xen/arch/arm/include/asm/mmu/layout.h
> index 2cb2382fbf..eac7eef885 100644
> --- a/xen/arch/arm/include/asm/mmu/layout.h
> +++ b/xen/arch/arm/include/asm/mmu/layout.h
> @@ -19,11 +19,11 @@
>  *   2G -   4G   Domheap: on-demand-mapped
>  *
>  * ARM64 layout:
> - * 0x0000000000000000 - 0x000001ffffffffff (2TB, L0 slots [0..3])
> + * 0x0000000000000000 - 0x000009ffffffffff (10TB, L0 slots [0..19])
>  *
>  *  Reserved to identity map Xen
>  *
> - * 0x0000020000000000 - 0x0000027fffffffff (512GB, L0 slot [4])
> + * 0x00000a0000000000 - 0x00000a7fffffffff (512GB, L0 slot [20])
>  *  (Relative offsets)
>  *   0  -   2M   Unmapped
>  *   2M -  10M   Xen text, data, bss
> @@ -35,7 +35,7 @@
>  *
>  *  32G -  64G   Frametable: 56 bytes per page for 2TB of RAM
>  *
> - * 0x0000028000000000 - 0x00007fffffffffff (125TB, L0 slots [5..255])
> + * 0x00000a8000000000 - 0x00007fffffffffff (512GB+117TB, L0 slots [21..255])
>  *  Unused
>  *
>  * 0x0000800000000000 - 0x000084ffffffffff (5TB, L0 slots [256..265])
> @@ -49,7 +49,7 @@
> #define XEN_VIRT_START          _AT(vaddr_t, MB(2))
> #else
> 
> -#define IDENTITY_MAPPING_AREA_NR_L0     4
> +#define IDENTITY_MAPPING_AREA_NR_L0     20
> #define XEN_VM_MAPPING                  SLOT0(IDENTITY_MAPPING_AREA_NR_L0)
> 
> #define SLOT0_ENTRY_BITS  39
> -- 
> 2.39.2
> 




 


Rackspace

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