* [PATCH] vm: optional 16K-page guest kernel builds
@ 2026-07-30 19:20 colbyt
2026-07-30 19:28 ` [PATCH v2] " colbyt
2026-07-30 19:35 ` [PATCH v3] " colbyt
0 siblings, 2 replies; 6+ messages in thread
From: colbyt @ 2026-07-30 19:20 UTC (permalink / raw)
To: devel; +Cc: PolymerOS Coordinator
From: PolymerOS Coordinator <coordinator@polymeros.local>
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.
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] vm: optional 16K-page guest kernel builds
2026-07-30 19:20 [PATCH] vm: optional 16K-page guest kernel builds colbyt
@ 2026-07-30 19:28 ` colbyt
2026-07-30 19:35 ` [PATCH v3] " colbyt
1 sibling, 0 replies; 6+ messages in thread
From: colbyt @ 2026-07-30 19:28 UTC (permalink / raw)
To: devel; +Cc: PolymerOS Coordinator
From: PolymerOS Coordinator <coordinator@polymeros.local>
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3] vm: optional 16K-page guest kernel builds
2026-07-30 19:20 [PATCH] vm: optional 16K-page guest kernel builds colbyt
2026-07-30 19:28 ` [PATCH v2] " colbyt
@ 2026-07-30 19:35 ` colbyt
2026-07-31 14:04 ` Alyssa Ross
1 sibling, 1 reply; 6+ messages in thread
From: colbyt @ 2026-07-30 19:35 UTC (permalink / raw)
To: devel; +Cc: colbyt
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.
---
v3/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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3] vm: optional 16K-page guest kernel builds
2026-07-30 19:35 ` [PATCH v3] " colbyt
@ 2026-07-31 14:04 ` Alyssa Ross
2026-08-01 18:40 ` colby
0 siblings, 1 reply; 6+ messages in thread
From: Alyssa Ross @ 2026-07-31 14:04 UTC (permalink / raw)
To: colbyt; +Cc: devel
[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]
colbyt <colby@colbyt.com> writes:
> 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.
> ---
> v3/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.
My instinct is that we should just always use a 16K page kernel on
aarch64 hosts. AIUI the main reason most Linux distributions don't is
to retain compatibility with binaries that may assume only 4K alignment
is needed, but on the Spectrum host we should never be running binaries
we didn't build ourselves.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] vm: optional 16K-page guest kernel builds
2026-07-31 14:04 ` Alyssa Ross
@ 2026-08-01 18:40 ` colby
2026-08-03 12:49 ` Alyssa Ross
0 siblings, 1 reply; 6+ messages in thread
From: colby @ 2026-08-01 18:40 UTC (permalink / raw)
To: Alyssa Ross; +Cc: devel
Seems fine, I don't have any special perspective on that. Everything I have is 16k.
On Friday, July 31st, 2026 at 7:04 AM, Alyssa Ross <hi@alyssa.is> wrote:
> colbyt <colby@colbyt.com> writes:
>
> > 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.
> > ---
> > v3/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.
>
> My instinct is that we should just always use a 16K page kernel on
> aarch64 hosts. AIUI the main reason most Linux distributions don't is
> to retain compatibility with binaries that may assume only 4K alignment
> is needed, but on the Spectrum host we should never be running binaries
> we didn't build ourselves.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] vm: optional 16K-page guest kernel builds
2026-08-01 18:40 ` colby
@ 2026-08-03 12:49 ` Alyssa Ross
0 siblings, 0 replies; 6+ messages in thread
From: Alyssa Ross @ 2026-08-03 12:49 UTC (permalink / raw)
To: colby; +Cc: devel
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]
On Sat, Aug 01, 2026 at 06:40:48PM +0000, colby@colbyt.com wrote:
> Seems fine, I don't have any special perspective on that. Everything I have is 16k.
Alright, I'll throw that in next time we're doing a kernel rebuild. :)
> On Friday, July 31st, 2026 at 7:04 AM, Alyssa Ross <hi@alyssa.is> wrote:
>
> > colbyt <colby@colbyt.com> writes:
> >
>
> > > 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.
> > > ---
> > > v3/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.
> >
>
> > My instinct is that we should just always use a 16K page kernel on
> > aarch64 hosts. AIUI the main reason most Linux distributions don't is
> > to retain compatibility with binaries that may assume only 4K alignment
> > is needed, but on the Spectrum host we should never be running binaries
> > we didn't build ourselves.
> >
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-03 12:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 19:20 [PATCH] vm: optional 16K-page guest kernel builds colbyt
2026-07-30 19:28 ` [PATCH v2] " colbyt
2026-07-30 19:35 ` [PATCH v3] " colbyt
2026-07-31 14:04 ` Alyssa Ross
2026-08-01 18:40 ` colby
2026-08-03 12:49 ` Alyssa Ross
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).