From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_ZEN_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.4 Received: from txout-a2-smtp.messagingengine.com (txout-a2-smtp.messagingengine.com [103.168.172.225]) by inbox.vuxu.org (Postfix) with ESMTP id 9961425694 for ; Wed, 7 Jan 2026 18:58:11 +0100 (CET) Received: from localhost.localdomain (phl-topicbox-02.internal [10.202.2.220]) by mailtxout.phl.internal (Postfix) with ESMTP id 39D931C01AE for ; Wed, 7 Jan 2026 12:58:11 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=kergis.com header.i=@kergis.com header.b=aF3h7S6A header.a=rsa-sha256 header.s=ovhmo911253-selector1 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=kergis.com; spf=pass smtp.mailfrom=tlaronde@kergis.com smtp.helo=smtpout1.mo529.mail-out.ovh.net; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1767808691; bh=5fTt+HAc4NL7/KF4 PypLdCKWl3aPhAbrv+wO7EiDShk=; b=OdEwaeF3eYsykx4v6fmENaqdowBUIqs5 skyhoWGP7tO8xwEdRQ7KWsO8aAaZbQlNm/kZliD2hCp6qnf7t2SlamAasCykfyZ6 7dcrR1iuk96jVcrOC19p23vbgaqZ4Cj4BlUtStnWyiQnvfZBj7PJs/LS8Dgu+HTJ /KUEfK9EUvk= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1767808691; b=QNXMtCcQ3uOSHZRRH4e3ViXzIopX+QHedMQUPNpF+cWF0khq+D Ap0SfNRZUCzelq1HKMZIolbDxRyC5RPMS4O07fThdbicCrD9ttY46+Z8+DsU4mqC Aw1orZlIg3Eb+ip+fk+k3bvMcU6BWD/AXjhVRb4x0/l44mcfLoRTTbrnU= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=kergis.com header.i=@kergis.com header.b=aF3h7S6A header.a=rsa-sha256 header.s=ovhmo911253-selector1 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=kergis.com; spf=pass smtp.mailfrom=tlaronde@kergis.com smtp.helo=smtpout1.mo529.mail-out.ovh.net; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: garm.ovh; auth=pass (GARM-111S00569af8456-0ce3-4a7e-b94a-94d279ce5ed1, DD529AE4BB66233CDD5BE7CE4770ABE5B91589FB) smtp.auth=tlaronde@kergis.com X-Received-Authentication-Results: authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=kergis.com header.i=@kergis.com header.b=aF3h7S6A header.a=rsa-sha256 header.s=ovhmo911253-selector1 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=kergis.com; iprev=pass smtp.remote-ip=178.32.125.2 (smtpout1.mo529.mail-out.ovh.net); spf=pass smtp.mailfrom=tlaronde@kergis.com smtp.helo=smtpout1.mo529.mail-out.ovh.net; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=smtpout1.mo529.mail-out.ovh.net policy.ptr=smtpout1.mo529.mail-out.ovh.net; x-return-mx=pass header.domain=kergis.com policy.is_org=yes (MX Records found: mx2.ovh.net,mxb.ovh.net,mx1.ovh.net); x-return-mx=pass smtp.domain=kergis.com policy.is_org=yes (MX Records found: mxb.ovh.net,mx2.ovh.net,mx1.ovh.net); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:subject:message-id:references:mime-version:content-type :in-reply-to:list-help:list-id:list-post:list-subscribe:reply-to :content-transfer-encoding:list-unsubscribe; s=dkim-1; t= 1767808691; x=1767895091; bh=b4i6ALu0iWzVzG0b6vS2ZK1eOEXq56CIZf/ t+zkqBnE=; b=HhYocPpZgGPwPAH/6LJ7+l05gH/LSAQIibuy2gejOqe0IwX0aTL auJhLadJoge/VfAcQhUyrQCU/0vg6QpLJc4gWrvwz0TAYBkQdrX26/9z5sWIYVbQ IPhz22s82UL7sMyDMmZSbRo5tN3FzkTiyntMHTn3X6rJ4VnhA4LIDcLA= Received: from authmilter.topicbox.com (unknown [172.17.0.1]) by mx.topicbox.com (Postfix) with ESMTP id A64494D86406 for <9fans@9fans.net>; Wed, 7 Jan 2026 12:54:09 -0500 (EST) Received: from mx.topicbox.com (172.17.0.1 [172.17.0.1]) by authmilter.topicbox.com (Authentication Milter) with ESMTP id 91706A14D81; Wed, 7 Jan 2026 12:54:09 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1767808449; b=JKSoj/O8+v/zx9jPePWWf95dOrttKDpUtw2CqMJWP/7jJaI14u jABg25EqjNTX76BTiKXav2hILR3Yi9zZiNG56lCJE5JclTbY1OT1/gZDzMLWs4At TfQAtHPxd+Yzq/6m7elIGinaWC5mdzlQcJ16S4rdSMINWCKCAjc1tfiA6+IEUsZi OR6R5cv5JKCfCA9pdVHfOWJZTJhbQYFoiWBwi7NgQSWUia/EOHUkLuv2572Yjr8U MZzOXuKC3clVlcxExqBcUldCC4m5p353lU8BDoJ72+E2SvHJuh3ldwptFsqhA3IR j00MOZIdlEUnSgLAqDikM0HFrSpFj38WEfGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=arcseal; t=1767808449; bh=UYCcYwb4/b9YUzgSLjxJ7fRQpwntY1n57gR7Mu4IIEI=; b=Ulttlg20hgGY +yfa5AG0w3lU4ppUJ+SMQB4aGZGa1+lX6zTpryrM/23vXXRnPPugZOYZkhnIao/k mnsFNsBr6FQRXg7+1IXMGZsDUfnmddrUnN3QvP1OuAfctmGkVUoj4h8UjYUlZZde xxlpeIJTo51eApSo7u7WCX9sR/NPq3gkt/TxUJjgnviEHgmHCn8TZ9KEgeQLMlTx iiTdVGqGaIaB6CAwoW09qbZ/FrTay5zMJMIOUXqKtw/bAIsqez+SQzpcf7IEOzmc gxO0ZVBICCQCDCZ7D1pb1yNA7nLKC1hKOr8Kdhioczk4cuvsbigIWpAto3k6XY1g /OdC0iQTBQ== ARC-Authentication-Results: i=1; authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=kergis.com header.i=@kergis.com header.b=aF3h7S6A header.a=rsa-sha256 header.s=ovhmo911253-selector1 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=kergis.com; iprev=pass smtp.remote-ip=178.32.125.2 (smtpout1.mo529.mail-out.ovh.net); spf=pass smtp.mailfrom=tlaronde@kergis.com smtp.helo=smtpout1.mo529.mail-out.ovh.net; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=smtpout1.mo529.mail-out.ovh.net policy.ptr=smtpout1.mo529.mail-out.ovh.net; x-return-mx=pass header.domain=kergis.com policy.is_org=yes (MX Records found: mx2.ovh.net,mxb.ovh.net,mx1.ovh.net); x-return-mx=pass smtp.domain=kergis.com policy.is_org=yes (MX Records found: mxb.ovh.net,mx2.ovh.net,mx1.ovh.net); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_256_GCM_SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddutdefjedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvuffkfhggtggujghisehttdertddttddvnecuhfhrohhmpeeothhlrghrohhnuggvsehk vghrghhishdrtghomheqnecuggftrfgrthhtvghrnhepfeelffehuddvffdvheeltdduke fhgffgueevkefhveduffefheehffeftdfhfedtnecuffhomhgrihhnpehtohhpihgtsgho gidrtghomhdpkhgvrhhgihhsrdgtohhmnecukfhppedujeekrdefvddruddvhedrvddpfe ejrdehledrudegvddrudduuddpvddufedrgeegrddvgeegrdehleenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedujeekrdefvddruddvhedrvddphhgvlh hopehsmhhtphhouhhtuddrmhhohedvledrmhgrihhlqdhouhhtrdhovhhhrdhnvghtpdhm rghilhhfrhhomhepoehtlhgrrhhonhguvgeskhgvrhhgihhsrdgtohhmqedpnhgspghrtg hpthhtohepuddprhgtphhtthhopeeolehfrghnsheslehfrghnshdrnhgvtheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (kergis.com: Sender is authorized to use 'tlaronde@kergis.com' in 'mfrom' identity (mechanism 'include:mx.ovh.com' matched)) receiver=authmilter.topicbox.com; identity=mailfrom; envelope-from="tlaronde@kergis.com"; helo=smtpout1.mo529.mail-out.ovh.net; client-ip=178.32.125.2 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Wed, 7 Jan 2026 12:54:08 -0500 (EST) Received: from mxplan4.mail.ovh.net (unknown [10.110.0.125]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 4dmbJG5wSqz5w0m for <9fans@9fans.net>; Wed, 7 Jan 2026 17:54:06 +0000 (UTC) Received: from kergis.com (37.59.142.111) by DAG1EX1.mxp4.local (172.16.2.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.61; Wed, 7 Jan 2026 18:54:06 +0100 X-OVh-ClientIp: 213.44.244.59 Received: from cauchy.polynum.private (localhost [127.0.0.1]) by cauchy.polynum.private (8.16.1/8.16.1) with ESMTPS id 607Hs3pA001572 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for <9fans@9fans.net>; Wed, 7 Jan 2026 18:54:04 +0100 (CET) Received: (from tlaronde@localhost) by cauchy.polynum.private (8.16.1/8.14.9/Submit) id 607Hs3iB001083 for 9fans@9fans.net; Wed, 7 Jan 2026 18:54:03 +0100 (CET) Date: Wed, 7 Jan 2026 18:54:03 +0100 From: To: 9fans <9fans@9fans.net> Subject: Re: [9fans] risc-v memory layout Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline In-Reply-To: X-Originating-IP: [37.59.142.111] X-ClientProxiedBy: DAG3EX1.mxp4.local (172.16.2.5) To DAG1EX1.mxp4.local (172.16.2.1) X-Ovh-Tracer-GUID: 3efcb193-7300-48c1-bbce-648ebccd6937 X-Ovh-Tracer-Id: 11366522511701904151 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: dmFkZTF/m2h7P74XwnxZtDsNm5o9IBVhUIstG5NhP0x9fNQtkqWtzuyPEoBOzK5mpgESagcjv6IRM2+p2s5BDJ2aYyfo9ichHQwMAjLbf39LWUjvlH7hsr2x3mIKmfGo78B8GHTYZZia2pXrA7BQQ+yh1m7u0qgqgeCjF24NtA1PDjrU3bDZoBXb9vEc9+f/rHw77hghmQrbewGHyFnXuQNGFlah4x9ZgeN+9QOxPLpKzwWOIXYN8FEELJrf/uWwpeIiH8UBoyOCAwq84HlQb/BHJo+6wXsmwBFsI0DG5zBt5vHBfVQkMH1WvX2h4iihK60B/Ivpa0AEex1tknPcCGll4QdEVXPquwbeYceG8k0wPhvdRC0MBfzbgkfnWh+qhIyZJQoRT1uaCc3ku23pue35DkhkH1QJZOy/cVNidWASERCZ4JywbUoVCn3kdnd2GOUQShSLXUf+zfJIdeguIO6RVIIb9eH9/MKGMLBQIdLDi0QjF6biXYhshb4eicv9rVSK2HisfrsmppLBpLxDD88bu84dZLfwK1JXeenB/XeCiCtpQOHYgAGxZEWopzt11WCN3rHZVstH5cyoOZ7aTIbMBpp5NlxLVuPzEE4EutpQYpYsJPtB7zHbzGvVEH8c7Q9bKtA8VVDIptjXWl23Bt2f1eG8zJlcYsCAqTr1soHLVUkFuA Topicbox-Policy-Reasoning: moderate: sender is a member; group holds all messages Topicbox-Message-UUID: decb1110-ebf1-11f0-8b92-d7666cc11ef0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZjZlMGIxYjNmODBkZjgyMS1NMWNkNWYwMTU5YWNjMmFkNTFlNjFk?= =?UTF-8?B?YjY0Pg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M1cd5f0159acc2ad51e61db64:1:A2HRQLTNxuqvOn8XE_2oz07X0sGLtO_bkXcDf7mqoKM Concerning IOMMU, what is the general position regarding it? I had tested an AMD64 8 physical cores (for Nix eventually) but run into problems regarding USB because IOMMU is not handled and apparently recent firmware unable it by default so one has to put it out the way---in my case, this is USB that was put out of the way, but it is a PITA (keyboard...). So how does it usage fit regarding Plan9, Nix? On Tue, Jan 06, 2026 at 03:13:45PM -0800, ron minnich wrote: > Something RIchard Miller said has got stuck in my head. >=20 > I am wondering about memory layout on riscv64. >=20 > The old tradition of "kernel at bottom of physical, top of virtual" is > something we've always done. >=20 > But do we have to? There are good riscv reasons to flip this. M mode, for > example, has no virtual addressing, and it would be useful (to say the > least) to have kernel and M mode have a common set of addresses. >=20 > Further, the PMP registers, which can be used to manage/limit physical > memory accesses, only gate addresses: they don't come with an offset. If = we > had kernel addresses that were 0-based and identity mapped, then the > addresses would be the same for kernel, M mode, PMP, and IOMMU. >=20 > A convenience of the "kernel in high memory" was the fact that an immedia= te > 32-bit number, e.g. 0x80000000, sign extends to 0xffffffff_80000000, such > that you can address a KVA with a 32-bit immediate, and a UVA with a 32-b= it > immediate, as long as it is < 0x80000000. >=20 > But this comes with a headache: KVA breaks into a 2G region and "the rest= ", > so you end up with two kernel VA ranges. It's annoying at least. The sign > extend hack was convenient when 2G was a lot of memory, but after that, > it's a bit of a pain. >=20 > Finally, FWIW, loading a risc-v register with 0x4000_0000_0000_0000 is one > instruction, so having a big number for a base virtual address is not the > issue it is on amd64 (amd64 is, in many ways, a 32-bit architecture with a > 64-bit RAX -- it is SO WEIRD, but it had to be to make the heroic move to > 64 bits). >=20 > So, the proposal: on riscv64, kernel address are 0 to (1<<62)-1, and user > addresses are 1<<62 to (1<<62)-1. This means valid addresses are always > int64, but will never be negative; we can keep using u64int. 62 bits of > address space ought to be enough for everybody. >=20 > Again, this makes a lot of RISC-V things easier. It would make it much > easier to use kernel addresses for M mode code, because no translation > would be needed, and a bunch of other risc-v mechanisms would be similarly > simplified. >=20 > I'm not sure the toolchain can handle having user text start at > 0x4000_0000_0000_0000, but maybe it's not so hard: for gvisor, back in > 2014, Russ added the code to 6l to allow us to link text in very high > memory. So it has to be doable. The code's there in go1.4 :-) >=20 > Comments? --=20 Thierry Laronde http://www.kergis.com/ http://kertex.kergis.com/ Key fingerprint =3D 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf6e0b1b3f80df821-M1cd5f= 0159acc2ad51e61db64 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription