From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 0A321AFFD; Thu, 30 Jul 2026 19:28:57 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 50285AFDF; Thu, 30 Jul 2026 19:28:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-43172.protonmail.ch (mail-43172.protonmail.ch [185.70.43.172]) by atuin.qyliss.net (Postfix) with ESMTPS id 499D2B097 for ; Thu, 30 Jul 2026 19:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colbyt.com; s=protonmail; t=1785439732; x=1785698932; bh=Xp/FcNBLzzLugXhz0RkKkT15wxWJWwEaPcSZ4Qvkfq4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=lFe9TOH1c/sY6B37BK8oSqCWV0NauqnSl2YXUStEYOE7usvhqUB7En1M0Vwp6iFQd x9KVJfOwlIzl7x6DZ/DrEG0PjL1WNoiqFfF74ustk/n4VQ79UvMZ5tbY8pMRa7pTXX lVNa6XXrOq1Rd2td0eT0ZJn8MnGho0DS+HcExIqWhucjRFY3bfA0NH5Qb0RoH4YStr +QphcgmpRgKHwLmjYFQJyi0cBgU/ssaWL/++CbCrniaPCUIZzQN8PzDsgLjVbgb5PZ bAyT22rtHzNheStIOsgovLLrfa/hCKTw3mbiE30M/+IL3R7CIz+YOi0nz1AHkGTGAy 6fLa5nqWB5/Mg== X-Pm-Submission-Id: 4h9zlQ1r87z2Sd4w From: colbyt To: devel@spectrum-os.org Subject: [PATCH v2] vm: optional 16K-page guest kernel builds Date: Thu, 30 Jul 2026 12:28:44 -0700 Message-ID: <20260730192848.1916888-1-colby@colbyt.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730192035.1900845-1-colby@colbyt.com> References: <20260730192035.1900845-1-colby@colbyt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4JHIOLA7SOROYOWWOD67L3D2UKK274XY X-Message-ID-Hash: 4JHIOLA7SOROYOWWOD67L3D2UKK274XY X-MailFrom: colby@colbyt.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; emergency; member-moderation CC: PolymerOS Coordinator X-Mailman-Version: 3.3.10 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: PolymerOS Coordinator KVM hosts with a 16K stage-2 granule (Apple Silicon machines running upstream kernels, NVIDIA GB10) can only run guests whose kernel is built with ARM64_16K_PAGES. Add an optional kernelPageSize argument to the app and net VM kernel builds; the default is unchanged. A 16K-page guest Image built this way has booted to a full session under a 16K host here since June without issues on my side. --- v2: no code change — drop a stray in-body From line that would have misattributed authorship when applied. Following up on the offer in my July 7 mail, as a standalone patch now that the nixpkgs update brings Linux 7.1. The config delta is five lines; the edit (an argument defaulting to today's behavior) is a proposal — happy to rework it if you'd rather structure it differently, e.g. hang it off a single shared helper instead of two arguments. spectrum/img/app/default.nix | 7 +++++++ spectrum/vm/sys/net/default.nix | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/img/app/default.nix b/img/app/default.nix index 06dfc86c..6b839f0f 100644 --- a/img/app/default.nix +++ b/img/app/default.nix @@ -7,6 +7,7 @@ import ../../lib/call-package.nix ( , cryptsetup , erofs-utils, jq, lndir, s6-rc, util-linux , cacert, linux_latest +, kernelPageSize ? null }: let @@ -49,6 +50,12 @@ let VSOCKETS = yes; VIRTIO_VSOCKETS = yes; VT = no; + } // lib.optionalAttrs (kernelPageSize == "16k") { + # KVM hosts with a 16K stage-2 granule (e.g. Apple Silicon, NVIDIA + # GB10) can only run guests whose kernel uses 16K pages. + ARM64_4K_PAGES = lib.mkForce no; + ARM64_16K_PAGES = lib.mkForce yes; + ARM64_64K_PAGES = lib.mkForce no; }; }).overrideAttrs ({ installFlags ? [], ... }: { installFlags = installFlags ++ [ diff --git a/vm/sys/net/default.nix b/vm/sys/net/default.nix index 3ec34a7f..efd1c8e1 100644 --- a/vm/sys/net/default.nix +++ b/vm/sys/net/default.nix @@ -10,6 +10,7 @@ pkgsMusl.callPackage ( , erofs-utils, jq, lndir, s6-rc, util-linux , busybox, dbus, execline, iwd, kmod, linuxPackagesFor, linux_latest , mdevd, nftables, s6, s6-linux-init, spectrum-driver-tools, xdp-tools +, kernelPageSize ? null }: let @@ -52,6 +53,12 @@ let VIRTIO_CONSOLE = yes; VIRTIO_PCI = yes; VT = no; + } // lib.optionalAttrs (kernelPageSize == "16k") { + # KVM hosts with a 16K stage-2 granule (e.g. Apple Silicon, NVIDIA + # GB10) can only run guests whose kernel uses 16K pages. + ARM64_4K_PAGES = lib.mkForce no; + ARM64_16K_PAGES = lib.mkForce yes; + ARM64_64K_PAGES = lib.mkForce no; }; }).overrideAttrs ({ installFlags ? [], ... }: { installFlags = installFlags ++ [ -- 2.55.0