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

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


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 22 May 2023 14:47:19 +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=/2FCGoi/+NciEYZl0lxPf7LHht5l07ddO42XZV4xGlc=; b=HD74JDZVpufJAMzy1VTUI4/Ul0lsWoenmGvdLJ75c+v6zZb7ZFTizkcifuCvcrgD34iMbxtTSm7BOiXTTrqZUTr3evU8AQ63cthMtInKydzLWNgjLJF9oaUIyFZaK20Zk8vs+kWzucuEk7YTUrxaTZ5k5hNvLlt+54EhKw3vaMYhEAGzBVp+NzVZ4axVGw/gu5IBK+y5au0C+s3UzicjRtys8zsJL2kQQHT5T8KqNO2QdABSNiHtSBuPn38sGNg69jhl9p+7A7qrc8LB/XfLpI4HypDZGUQ+zXkOvzjPbCB6/GWP8UOD1WFnhNoeZycpQHAY3cmacsAjTRqjMWIRlw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BMyhLW5FPHdzVKwP9Y0hoJc5Ex4IBHC8wirDur57vrNbMVKC9Eida5BcbhU31ZxPBwVjt3bKHz64ECKEEXLmCtARgPVXaCSUezGoaMX2yZlXgJpqdNMB6wj2qdloQaIXUhNkEdsQcNQwrjSOvimRRT+J9cqHo96ppEALj0CEXhOrpHxsjhSe4UuvjA/goGiVMzwkj7vQEvBNTJ5FF9fulemPJhGaKqgTlKpXBBCWhtRszyVOYdSNpQzTCdaVwf/ah1/6sSnJYkuNMuXthZrAhA6QgLChjJdc3dY/QYF66kVi2N0ksy6mdUz3+KchKK0lzaeqJuk8kSzdaCaqp1znew==
  • 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>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 22 May 2023 12:48:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.05.2023 14:18, 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 RV_STAGE1_MODE == SATP_MODE_SV39

Nit: #if please, not #ifdef. Also may I stress again that ideally this
would be formatted such that when e.g. grep-ing for SATP_MODE_SV39, the
matching line here would _not_ give the impression of being "a comment
only" (making people possibly pay less attention)? My referral to the
x86 way of doing things remains.

> + * 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 |  0000007f80000000 | 309 GB | L2 200-509 | Direct map

And another, yet more minor nit: Would be nice if all addresses here
were spelled uniformly, i.e. also with upper vs lower case of hex
digit letter consistent.

Jan

> + *                 ...                  |  1 GB  | L2 199     | Unused
> + * 0000003100000000 |  00000031C0000000 |  3 GB  | L2 196-198 | Frametable
> + *                 ...                  |  1 GB  | L2 195     | Unused
> + * 0000003080000000 |  00000030C0000000 |  1 GB  | L2 194     | VMAP
> + *                 ...                  | 194 GB | L2 0 - 193 | Unused
> + * 
> ============================================================================
> + *
> + * #endif
> + */
> +
>  #if defined(CONFIG_RISCV_64)
>  # define LONG_BYTEORDER 3
>  # define ELFSIZE 64




 


Rackspace

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