From nobody Sat Sep 21 05:30:23 2024 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=1683825027; cv=none; d=zohomail.com; s=zohoarc; b=fPGFL39TfERB3IuBvA21O7FfGDf+6Wy+MqSwh700KCL5CCVFv+WITm7wORBZQWXxc5sszSuLAW/Cu8VwqQsnDapznMQztjoMI8yuSJy9dPkdKYDWhyEdrRd+EP2NB8DYBD0cx45BvyrLcCwCTcqwrRnejnDApv4uesaCbtXBJxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683825027; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=R7T/n1zgF5any8cbvEEn1EwergrbOQgfgzV08xSHYV0dRnH/H32sHj0itMbgPsa3hxgqGuLyIDv0hgDtRqWwgrqn0xLHbdP1jSli2P+9kHBmW6PSRpimHLf8jFHDvI3p3ye2aYovgVJX7iA5qU46vPiOP+XKoJVIdQyCDVzgG7c= 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 1683825027690640.6524219608174; Thu, 11 May 2023 10:10:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.533490.830221 (Exim 4.92) (envelope-from ) id 1px9nQ-0002M1-Mt; Thu, 11 May 2023 17:09:40 +0000 Received: by outflank-mailman (output) from mailman id 533490.830221; Thu, 11 May 2023 17:09:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nQ-0002Lu-K2; Thu, 11 May 2023 17:09:40 +0000 Received: by outflank-mailman (input) for mailman id 533490; Thu, 11 May 2023 17:09:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1px9nP-0002Lh-Mq for xen-devel@lists.xenproject.org; Thu, 11 May 2023 17:09:39 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9c949eed-f01e-11ed-b229-6b7b168915f2; Thu, 11 May 2023 19:09:38 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ac8c0fbb16so82671261fa.2 for ; Thu, 11 May 2023 10:09:38 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id c9-20020a05651c014900b002aa3cff0529sm2443830ljd.74.2023.05.11.10.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 10:09:37 -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: 9c949eed-f01e-11ed-b229-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683824978; x=1686416978; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=TR1Xt4pS5K4Vz1znogj/0rL73x12kbzbC2UCZyysdZOPd+11rHyWr9kPh8x/llH618 N2/vKAGXJdC6OVTUN9N3Q2FN7iR1bdL3bI9xJCSlHyBokp2DMRrYMEgq5K8AGg06Ape/ 1rezhud1SRMlOd0zXlifugILIPOZV+o6qZg18jseLMqocHWfoObO8BFf2kQLk3oG134l 9wKZilUShYfBD9slOAvNC3RuyPgxWpfNggnc9pdca9igu1/VCr23RrMdOrzcYl65DAA9 3KWc/qCXj0TCue011TpmwW1mM3ZqLS8JfTH04MAQQRD0+yRTmKzPISi7QJCoLtZplI2y SWjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683824978; x=1686416978; 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=a8bc8sBrfSe9Kkfb3sttx5nGDE1LXzDoaGCPR0OUB4U=; b=WBW2JdVzIm30nqU8MXcMYFPT0QfDSPEnNIHfJzgBt9Fz9ZhF1SmZzNSu8vfv0lGe6U +5NSz3dO4njzbMZmBZqYGM1UdyGE2gPK+lrGBiuHMjX0HfE9Yu0Y72QPoMMi2Gmlz7T5 1GI8rmeOp5elHsM6DHwiKQSIxUoSnSMCcmJhfr0nym/X0OTlTPZl+6DDfzz8zkoWXmg/ oNCmqcprb86BM9k8TV5q7tAqRSQhfQwacoRaG5ygHx4tPKl9vLgIaxHdTXXNoTC7XVWO TezjonZMLPpJZ0Tl3QwP4aYxtY8fl+CaSiyIo5jFXszJgngLvNJBmW+sSGyFKnRKY0ua yozg== X-Gm-Message-State: AC+VfDxhVJsWcXYSFk4uD9bjHcF0M67qUxiURTBJyQkT6jRW53OfcKC3 t0pjn70ctF9fK1uIbgVvuoLJnewjbSg= X-Google-Smtp-Source: ACHHUZ5StywoRO9/FVyt83hqn6Wq7FxO91WQxwO81pg8PQemoYjsnLzH82cDNAhPhqX7mtRiQqb5hQ== X-Received: by 2002:a2e:a1c7:0:b0:2a8:c520:da1d with SMTP id c7-20020a2ea1c7000000b002a8c520da1dmr3066201ljm.29.1683824977866; Thu, 11 May 2023 10:09:37 -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 v7 1/5] xen/riscv: add VM space layout Date: Thu, 11 May 2023 20:09:29 +0300 Message-Id: <7b03dbf21718ed9c05859a629f4442167d74553c.1683824347.git.oleksii.kurochko@gmail.com> 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: 1683825028793100001 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 V7: - Fix range of frametable range in RV64 layout. - Add ifdef SV39 to the RV64 layout comment to make it explicit that description if for SV39 mode. - Add missed row in the RV64 layout table. --- 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 | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/a= sm/config.h index 763a922a04..a53833afee 100644 --- a/xen/arch/riscv/include/asm/config.h +++ b/xen/arch/riscv/include/asm/config.h @@ -4,6 +4,42 @@ #include #include =20 +/* + * RISC-V64 Layout: + * + * #ifdef SV39 + * + * 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 + * 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 + * ... | 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 + * =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 + * + * #endif + */ + #if defined(CONFIG_RISCV_64) # define LONG_BYTEORDER 3 # define ELFSIZE 64 --=20 2.40.1