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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, URIBL_DBL_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 372112006B for ; Thu, 8 Jan 2026 04:22:58 +0100 (CET) Received: from localhost.localdomain (phl-topicbox-02.internal [10.202.2.220]) by mailtxout.phl.internal (Postfix) with ESMTP id 8BC371C0148 for ; Wed, 7 Jan 2026 22:22:57 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=j7S0dfiE header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=crossd@gmail.com smtp.helo=mail-yw1-f180.google.com; 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=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding :list-help:list-id:list-post:list-subscribe:reply-to :list-unsubscribe; s=sysmsg-1; t=1767842577; bh=MoRolQuJ7NWXe54v INsycWfaZGUFXp0WPKt1EpgDupk=; b=IgQ4Jhv9QfRasYni4/bE+eTF7V9YATXO O/xuts++sILKk0mb4tgqZF0Y5QInD5JNS1XrguBluxeer0qceyw/lwPp5IMMOLSg z3GYuNU7kc39pb+OT3ureZESMzmusE/ZF1bC6ntPtktqcqukqi2K7k7iinDw7HLW D02AAEu/uoA= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1767842577; b=rSYB8/3W2DLW/0GzS4NdgGFyV3oV9JcJ+d+2emHuvy2azqzx6F WryeTgUCU1p/3tuMvS/o+9NNZ7i61nzcVE4l39mW7jFM0vVYlB5wimz2emcao6iQ 1SzhnMCCF8MjR/lXb5O/tRLI9Gnp4qCunX4WSvYQXMmzcX2Fb30RZ8Q8E= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=j7S0dfiE header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=crossd@gmail.com smtp.helo=mail-yw1-f180.google.com; 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: authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=j7S0dfiE header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.128.180 (mail-yw1-f180.google.com); spf=pass smtp.mailfrom=crossd@gmail.com smtp.helo=mail-yw1-f180.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=UjDo68yT; x-me-sender=none; x-ptr=pass smtp.helo=mail-yw1-f180.google.com policy.ptr=mail-yw1-f180.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_128_GCM_SHA256 smtp.bits=128/128; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t=1767842577; x=1767928977; bh=HkUszTPOkQ8/1iGxIRjWqyiCLgWXl9h/ SmjxKMkmH/Q=; b=fumWzwXq3ZECLVKkXTiwThe4eAKx07NQyRNNOdsMGZzzf73u MaYMVz0MVuqocYoobnetpom4wo8qk07EGAFW0hW1FWDHustGkz9e0NMKYkMMoU7F XtPAOzG7eC+7LGetQofs5rjWT7eSlr+uDCiTSsnJcyCnoOTIll+H5o0296E= Received: from authmilter.topicbox.com (unknown [172.17.0.1]) by mx.topicbox.com (Postfix) with ESMTP id D93B635CEA60 for <9fans@9fans.net>; Wed, 7 Jan 2026 21:50:44 -0500 (EST) Received: from mx.topicbox.com (172.17.0.1 [172.17.0.1]) by authmilter.topicbox.com (Authentication Milter) with ESMTP id 319EEC927A6; Wed, 7 Jan 2026 21:50:44 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1767840644; b=A4s4wj/qcEI2+bS3yWinHC1WoDBBD+rT8pbQvL79cvZaAua+/M TdodVXUjO0Y27EeZhLMqAw5kIt3CRz3/SOpdWpnnjiecekRBqgZemeVCNKkBOtb9 N33kD6HB3Y8Qz/uXfoBGMtAZZC5UGPeYUcZUxe5LLrYuOZTO8bjNHXRe2/qNAc3E nmExIfvL7+w/vXpn4yfG80/DJ/ghUX7RrByeiF8d2dMgjBvKvBzPJ4gmSPS5VwQs KI2sHQrq73eNL96VUiQdSS/mHaqqdDJjPA/+lyZEsFVbgGRWpDNS3WvUz6duIBf+ xuKGHgK18t4FfcNFELi0PTbvEXZOHBbpGyKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=arcseal; t=1767840644; bh=ZScXF1qhUd5vnvcxEiZ11gq1T1u7hQOZwWW 6dztDx/g=; b=LGBvk435GCkqF1XrOqNXRG4NTLR2di9+v+KqXwk4x12PrIO96Rt gv1YF6yV6Ywyk2mU8kvW5B2E4kDa3evD5tASh7Y2M1BCH9PBwbaiq5qxzs6p5T4V JbjRubUnh6+2sguDeNOZxS5IXqzKhiXJ49H/yveeb8uq/R7e+2nSGj7XdiZrheWG oKs6WWgZvU4sNPmY1iM97lKAzr8y+eR0QhM9vUXJ9C77pzeITJowM/YEbh6QVyqq D5DDgzv4mKYRdLpcF3WwBq/UxdKcCyv8YZLzoPawBIrsmRPY+iuxOtkqY4pAfBE3 AX0mliNYn2/sGAU+TiDKy6H2FQErERSZKLQ== ARC-Authentication-Results: i=1; authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=j7S0dfiE header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.128.180 (mail-yw1-f180.google.com); spf=pass smtp.mailfrom=crossd@gmail.com smtp.helo=mail-yw1-f180.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=UjDo68yT; x-me-sender=none; x-ptr=pass smtp.helo=mail-yw1-f180.google.com policy.ptr=mail-yw1-f180.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_128_GCM_SHA256 smtp.bits=128/128; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddutdegjeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeggfh gjhfffkffuvfgtgfesthhqredttddtjeenucfhrhhomhepffgrnhcuvehrohhsshcuoegt rhhoshhsugesghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnheptdfgtdefkeffge evleekueekffdtteduhefhfedviedvfeeijeeggfevhffhfeejnecuffhomhgrihhnpehk vghrghhishdrtghomhdpthhophhitggsohigrdgtohhmnecukfhppedvtdelrdekhedrud dvkedrudektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedv tdelrdekhedruddvkedrudektddphhgvlhhopehmrghilhdqhiifuddqfhdukedtrdhgoh hoghhlvgdrtghomhdpmhgrihhlfhhrohhmpeeotghrohhsshgusehgmhgrihhlrdgtohhm qedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeolehfrghnsheslehfrghnshdrnh gvtheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: 209.85.128.180 is authorized to use 'crossd@gmail.com' in 'mfrom' identity (mechanism 'ip4:209.85.128.0/17' matched)) receiver=authmilter.topicbox.com; identity=mailfrom; envelope-from="crossd@gmail.com"; helo=mail-yw1-f180.google.com; client-ip=209.85.128.180 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 21:50:44 -0500 (EST) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-78fb7704cb4so27503297b3.3 for <9fans@9fans.net>; Wed, 07 Jan 2026 18:50:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767840644; x=1768445444; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZScXF1qhUd5vnvcxEiZ11gq1T1u7hQOZwWW6dztDx/g=; b=UjDo68yTEAFA+Tia0QrCyLUguRuF7WO1evLQ/gJXuGsB2Fh3JNZLpC02BhfR/ezyUu 3dYYYS22/4sZJxaxJscEHA3HeB2fI40Mq0GENA7OC2vWSxSTudhcnXTFTUHJ+pXzyrav f53JoCBvHaKJEDiA0pS/n5Nel8NEZpuXCcR827lGztnuvnB5D4wJaJLzIZG8cxj27S19 vFHOCpaUb22YIit10p+kyHPpqJMpmgsuNZiPsCGkWZdDFq8nXF0QSK2qOdM0AdaFQG8p dVK2twV3yL7zARQ//lLGOezIjRiD6TzkB8kB7slaxbwcE+okhh6Oh6gSOScwNKJHWuPU HG5g== X-Gm-Message-State: AOJu0YwONOJKxTutHufRqXGHdQGuqZYpnTjpdzVUv3v+AzzVu+Keo+MQ r40UEegUofhbgeg+/oE9NhF8xu4fBPLti/rU9EnV25jAxunk8WTdTk9aVMtjylsfDaaM5pqVd8r tosmkSU0HZUk+2Ab2ierE8V1aGKuMX/8JqQ== X-Gm-Gg: AY/fxX6RJWe6jhPWYQGMXU7xCisf4IwfTTso+E4KwYouSV0mCoSVOppj9u1fBe+ADs4 44k2F5uAr2wSuLN/XVQUsGOiqCnWxXE5SYP5VnD1HoYz/8ZojypKaGA578ki2l7l+V1Sz2PfYI6 ty4mUOKbUcKEMv8oMn5ipm0X46A8v6D3NcwXloQMAV/TBlElJuJcsvCBWot7bkXONSKgTzwnOJZ WOyC4HrsyNSRcFMIRt7BV+nFECwCdXZZWuaP3IT+VvB0AD5tyuKbaJPNhUBticRYo0ywDWIy+DZ xdMVjLprO/TQYJGfb9SFyUalD+Yu X-Google-Smtp-Source: AGHT+IHd5nMFWtGo52aacbqMwziWADOZHUV6FOk6iMgA8qdyO2brGLetLXqo6bJ79rS+iedATyOvy0XlJs/5FJ7gues= X-Received: by 2002:a05:690e:bcd:b0:63f:ad22:f0a6 with SMTP id 956f58d0204a3-64716b33a87mr4104729d50.1.1767840643174; Wed, 07 Jan 2026 18:50:43 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dan Cross Date: Wed, 7 Jan 2026 21:50:07 -0500 X-Gm-Features: AQt7F2ou8LArrzw0Bv5RmhJrFCWcRo3vsKssom0JkJuquzSXXdeCeM3kaqINOmY Message-ID: Subject: Re: [9fans] risc-v memory layout To: 9fans <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: moderate: sender is a member; group holds all messages Topicbox-Message-UUID: d4dae748-ec3c-11f0-bcbe-026810c0285f Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZjZlMGIxYjNmODBkZjgyMS1NNzBhOTZhNWI0MjlhMTM5ODAzMmI4?= =?UTF-8?B?N2RkPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M70a96a5b429a1398032b87dd:1:GBT7VzFP1Ri-AVZSLt6LCufHDEZ2qNObhP3qg6H1FYk On Wed, Jan 7, 2026 at 3:12=E2=80=AFPM ron minnich wro= te: > I don't much like IOMMU on x86, they are just awful to program, and come = with a performance hit. They're also here to stay. If you can disable x2api= c on your amd, then you should be able to turn off iommu I believe? Two independent things, really. You can put the LAPIC into x2 mode as long as it's supported; you only need the IOMMU if you have more than 255 CPU threads and want to serve external interrupts on the high numbered ones (or if the APIC ID space is sparse, which it often is if you have >255 CPUs or a two socket system that supports large core-counts). And even then, you're really only using the IOMMU's interrupt remapping functionality; you don't _have_ to do the page-level translation stuff for IO devices if you don't want to. - Dan C. > On Wed, Jan 7, 2026 at 9:58=E2=80=AFAM wrote: >> >> 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. >> > >> > I am wondering about memory layout on riscv64. >> > >> > The old tradition of "kernel at bottom of physical, top of virtual" is >> > something we've always done. >> > >> > 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. >> > >> > 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. >> > >> > A convenience of the "kernel in high memory" was the fact that an imme= diate >> > 32-bit number, e.g. 0x80000000, sign extends to 0xffffffff_80000000, s= uch >> > that you can address a KVA with a 32-bit immediate, and a UVA with a 3= 2-bit >> > immediate, as long as it is < 0x80000000. >> > >> > But this comes with a headache: KVA breaks into a 2G region and "the r= est", >> > so you end up with two kernel VA ranges. It's annoying at least. The s= ign >> > extend hack was convenient when 2G was a lot of memory, but after that, >> > it's a bit of a pain. >> > >> > 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 wi= th a >> > 64-bit RAX -- it is SO WEIRD, but it had to be to make the heroic move= to >> > 64 bits). >> > >> > So, the proposal: on riscv64, kernel address are 0 to (1<<62)-1, and u= ser >> > 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. >> > >> > 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 simil= arly >> > simplified. >> > >> > 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 :-) >> > >> > 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 / see discussions + participants + delivery options Permali= nk ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf6e0b1b3f80df821-M70a96= a5b429a1398032b87dd Delivery options: https://9fans.topicbox.com/groups/9fans/subscription