From nobody Mon Feb 9 19:08:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1683131559; cv=none; d=zohomail.com; s=zohoarc; b=NyHzJoT56EiBmKdiz0WdIDdgLjMat6gl3kcMq02YrAceY5/7HTGcDk9Wf8eDO+42z8NHsyoa2JEVcG/alXdCRUzbIZpJr+BMgnlMaAXCWgdtB9EZtR4shmr+jSVzZcsblruIdoCo+1GqPm3b9iVxWtlzxJ/WnTzHKWuiNb5BVms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683131559; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Na1AM2pS/tIxc8UzxXCz1qX+aY29hkPhhjEAhDGZruo=; b=knFPoSKpRV8FdhSSONUdx9MoiCpVd3SiXseI1prHPqF12STFgVONzF93VWh40Ml8hzFvQJJQtHMpH/lNV6PuRAVZdCaBEZmltS7KCRkbrNs3ySjPNcmCoYi9TS/1fb3kfDRCu2PMm4/CTJbOY89wBRDBVdCIN4ooBqhrV/8Xnng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1683131559187353.7213231128716; Wed, 3 May 2023 09:32:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.529380.823729 (Exim 4.92) (envelope-from ) id 1puFOl-00047h-9j; Wed, 03 May 2023 16:32:11 +0000 Received: by outflank-mailman (output) from mailman id 529380.823729; Wed, 03 May 2023 16:32:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puFOl-00046e-1Y; Wed, 03 May 2023 16:32:11 +0000 Received: by outflank-mailman (input) for mailman id 529380; Wed, 03 May 2023 16:32:09 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puFOj-0003pe-9y for xen-devel@lists.xenproject.org; Wed, 03 May 2023 16:32:09 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0b1c3d72-e9d0-11ed-8611-37d641c3527e; Wed, 03 May 2023 18:32:06 +0200 (CEST) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f00c33c3d6so6788921e87.2 for ; Wed, 03 May 2023 09:32:06 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id h20-20020a2e9ed4000000b002a634bfa224sm6074321ljk.40.2023.05.03.09.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 09:32:05 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0b1c3d72-e9d0-11ed-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683131526; x=1685723526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Na1AM2pS/tIxc8UzxXCz1qX+aY29hkPhhjEAhDGZruo=; b=YN4i0x2Yf/gqJP/4Wil8NwO76B5aVgrwNYJfDOi8HrmreBLvnv7H08aytbVqZ11YhL 4KekE+f6UrOsu3MY9X0MLjVCZYapuKXWZQmCGXGqq8oAdXx3NeEHZitnOUlLKf47hQIK vlcgKcr35nyhsh7XF1oHcpG/Q4bJJS3fAYMSY0cvU/HeMXSfq6cRBqE/bRG/69xs0Sr6 4icKCS2Oqd4uKktE5QoUTobPVOK4ETFx7dZIOhK1XQ8c7XZdnXz09wuhqf0jo67vsRsp NK2vVQRZ+tmQYCMI8Qneg6sD6J93ozqM+SGdnvl+wYsxK5GDUpBkMIECURDrm9kV4ydO tPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683131526; x=1685723526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Na1AM2pS/tIxc8UzxXCz1qX+aY29hkPhhjEAhDGZruo=; b=eII/XvRzZF/PXjkQ8ZFZoREfOlqHoiknav+w5Sz+PIpOGfLmLQWOQE7EXUR2XWtR5D aLjnTOtf7S6GUHp9rOYfl2xzCB8Y5aIwsoGMDWKZJz++4ozQ28tbHQugnFluD+HV5/Rx sfpU7IhZqV8uOe3HQCk4JmGlMzwnEYI+HbrozCES3w3LvRdRAluXM1Nc+ShDefJm1SUL zRC9/8Kyl3J0AwowVYT+C/sD13gKHfLDGWAXd+JlxwrRi8nXhcYdipY9pyKEM7quvudO qG2xjHzKb7IPn1Q5hErenOiaZj8RSEDIMGgCXzkoo+TByMfuF5Pk5wPlCu9zctWt44hb N7eQ== X-Gm-Message-State: AC+VfDysJH1CQn/S7VEFuRQRKd3yt7XIhzg/2gU27msm2wh/9+O/Kcd1 67Ke0iL1sgT9NjKlc8rmAAvVj/Fys2w= X-Google-Smtp-Source: ACHHUZ6yZKqCW5UQULMXODri/ZEA/RVcnsdSbX8Yx5MfUVYSJ4SkZhriZAecO1eFmtWzAYYMtP4P3g== X-Received: by 2002:ac2:42d4:0:b0:4ec:9fe9:fea9 with SMTP id n20-20020ac242d4000000b004ec9fe9fea9mr1289229lfl.56.1683131525895; Wed, 03 May 2023 09:32:05 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Julien Grall , Jan Beulich , Andrew Cooper , Stefano Stabellini , Gianluca Guida , Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v6 1/4] xen/riscv: add VM space layout Date: Wed, 3 May 2023 19:31:58 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1683131561358100005 Content-Type: text/plain; charset="utf-8" Also it was added explanation about ignoring of top VA bits Signed-off-by: Oleksii Kurochko --- Changes in V6: - update comment above the RISCV-64 layout table - add Slot column to the table with RISCV-64 Layout - update RV-64 layout table. --- Changes in V5: * the patch was introduced in the current patch series. --- xen/arch/riscv/include/asm/config.h | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/a= sm/config.h index 763a922a04..73b86ce789 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -4,6 +4,37 @@ #include #include =20 +/* + * RISC-V64 Layout: + * + * 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. + * + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + * Start addr | End addr | Size | Slot |area descri= ption + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + * FFFFFFFFC0000000 | FFFFFFFFC0200000 | 2 MB | L2 511 | Xen + * FFFFFFFFC0200000 | FFFFFFFFC0600000 | 4 MB | L2 511 | FDT + * FFFFFFFFC0600000 | FFFFFFFFC0800000 | 2 MB | L2 511 | Fixmap + * ... | 1 GB | L2 510 | Unused + * 0000003200000000 | 0000007f40000000 | 331 GB | L2 200-609 | Direct map + * ... | 1 GB | L2 199 | Unused + * 0000003100000000 | 0000003140000000 | 3 GB | L2 196-198 | Frametable + * ... | 1 GB | L2 195 | Unused + * 0000003080000000 | 00000030c0000000 | 1 GB | L2 194 | VMAP + * .................. unused .................. + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + */ + #if defined(CONFIG_RISCV_64) # define LONG_BYTEORDER 3 # define ELFSIZE 64 --=20 2.40.1