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

Re: [PATCH v7 1/5] xen/riscv: add VM space layout


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 16 May 2023 17:42:42 +0200
  • 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=5NMD35Yuc/kijxQlK4gShHDcs8NAlHM861Ruu5CJ210=; b=DbreSjUzlGHpRdYbcC3yMC7PSpP9M9A2tK81xeScca2OmLOU1KTsrZtYMooBHs8NCLatZ/4BneBwGq0G80FHgXEMeq2hDovp/5lNxRyz5lzoEz7Yyti+dCMxHq6HHPSFWdvfTokJ1jrKp79P955bxEItu7taanzdY4xWYSnYN0XPeKVF3bColRcYoQxm1SKRJ1tG6SFN64vbd6oGnfNtouvpsthDjA9DVxtP3RCfw1VRNSh8tzTCPw+66tRz4QzAuwo5fe7G50wb6Lh7fUT+ecNtOaN3pBCmuR+6C9skK2FzlKou7yHNm3Kg0D1gAwjqj9j7Ars6khnXUwyRi+ffRw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WRPOkUqqghNs+T1+f7QJXQIazpEDdeWdaghB51voz76DKX5xFAINZFqL2xoep87rYXNkhw+hFcnLfQJ0EVq/ZufcRZwH/xCwK71DuUd7Bw+4hoGwUuPdCbFErSJ7Q1SUvv2gdfaDtsUuSsp7OKpEN/+LRdv639Lyhs19HuYZOC16mMXQ+kswsvrmAYpuKG646gnVDIi0Ahic3rCkKHSaKk4EPD9mkkPQHVxqGk/e2/BIfHCzgiXIZT/SaNogvC8620H8tHWvvyPfcprEI1iW14hfwRTCEbB3uXen7wBsDcRDNKDRO26Q6ImRDZEemkM5vo3Y+hGU6sD30J1B2ubMwA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 16 May 2023 15:42:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.05.2023 19:09, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -4,6 +4,42 @@
>  #include <xen/const.h>
>  #include <xen/page-size.h>
>  
> +/*
> + * RISC-V64 Layout:
> + *
> + * #ifdef SV39

I did point you at x86'es similar #ifdef. Unlike here, there we use a
symbol which actually has a meaning, allowing to spot this comment in
e.g. grep output when looking for uses of that symbol. Hence here e.g.

#ifdef RV_STAGE1_MODE == SATP_MODE_SV39

? (I would also recommend to use the same style as x86 does, such that
the #ifdef and #endif look like normal directives [e.g. again in grep
output], leaving aside that they're inside a comment.)

> + * From the riscv-privileged doc:
> + *   When mapping between narrower and wider addresses,
> + *   RISC-V zero-extends a narrower physical address to a wider size.
> + *   The mapping between 64-bit virtual addresses and the 39-bit usable
> + *   address space of Sv39 is not based on zero-extension but instead
> + *   follows an entrenched convention that allows an OS to use one or
> + *   a few of the most-significant bits of a full-size (64-bit) virtual
> + *   address to quickly distinguish user and supervisor address regions.
> + *
> + * It means that:
> + *   top VA bits are simply ignored for the purpose of translating to PA.
> + *
> + * 
> ============================================================================
> + *    Start addr    |   End addr        |  Size  | Slot       |area 
> description
> + * 
> ============================================================================
> + * FFFFFFFFC0800000 |  FFFFFFFFFFFFFFFF |1016 MB | L2 511     | Unused
> + * FFFFFFFFC0600000 |  FFFFFFFFC0800000 |  2 MB  | L2 511     | Fixmap
> + * FFFFFFFFC0200000 |  FFFFFFFFC0600000 |  4 MB  | L2 511     | FDT
> + * FFFFFFFFC0000000 |  FFFFFFFFC0200000 |  2 MB  | L2 511     | Xen
> + *                 ...                  |  1 GB  | L2 510     | Unused
> + * 0000003200000000 |  0000007f40000000 | 309 GB | L2 200-509 | Direct map

The upper bound here is 0000007f80000000 afaict, which then also makes
the earlier gap 1Gb in size.

Jan



 


Rackspace

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