From 5a4a324044f04ecfd5cb3fc3189b00ccd099670f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 23 Nov 2026 21:59:46 +0000 Subject: [PATCH] kernel: turn on UDMABUF (/dev/udmabuf, 4 KB), which Mesa's lavapipe needs to export its images as dma-bufs --- .../patches/linux/0029-wasm-add-kw_defconfig.patch | 12 +++++++----- ...onal-atomics-and-shared-memory-builds-KW_AT.patch | 2 +- ...e-atomic_read-and-atomic_set-plain-accesses.patch | 2 +- ...olio_ref_add-of-zero-when-mapping-an-order-.patch | 2 +- ...-allow-percpu-km-on-SMP-with-a-flat-vmalloc.patch | 2 +- ...-an-arch-hold-tasks-on-their-CPU-except-whe.patch | 2 +- ...orkqueue-restart-points-for-ARCH_TASKS_STAY.patch | 2 +- ...-an-arch-wait-for-a-csd-and-wake-its-waiter.patch | 2 +- kernel/patches/linux/0037-wasm-SMP.patch | 2 +- .../linux/0038-wasm-host-devices-on-SMP.patch | 2 +- kernel/patches/linux/0039-wasm-kwblk-on-SMP.patch | 2 +- kernel/patches/linux/0040-wasm-kwshm-on-SMP.patch | 2 +- kernel/patches/linux/0041-wasm-kwfb-on-SMP.patch | 2 +- kernel/patches/linux/0042-wasm-kwinput-on-SMP.patch | 2 +- kernel/patches/linux/0043-wasm-kwsnd-on-SMP.patch | 2 +- kernel/patches/linux/0044-wasm-kwvirtio-on-SMP.patch | 2 +- ...ock-instead-of-spinning-for-another-CPU-SMP.patch | 2 +- ...-a-free-spinlock-out-of-turn-kw_spin_unfair.patch | 2 +- ...ot-wait-for-a-CPU-that-compiles-or-yields-t.patch | 2 +- .../0048-wasm-parking-and-snapshots-on-SMP.patch | 2 +- 20 files changed, 26 insertions(+), 24 deletions(-) diff --git a/kernel/patches/linux/0029-wasm-add-kw_defconfig.patch b/kernel/patches/linux/0029-wasm-add-kw_defconfig.patch index 5ae7ada..7e32611 100644 --- a/kernel/patches/linux/0029-wasm-add-kw_defconfig.patch +++ b/kernel/patches/linux/0029-wasm-add-kw_defconfig.patch @@ -1,4 +1,4 @@ -From a67aa523b3b89dce0013a4dae9ea330dc7bceb82 Mon Sep 17 00:00:00 2001 +From 44885b0596c2ae4d63699bd02b16f3e0d84b6502 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 15 Nov 2026 10:16:10 +0000 Subject: [PATCH] wasm: add kw_defconfig @@ -54,16 +54,16 @@ calls. Built with FRAME_WARN=1024, no other function warns. Signed-off-by: Pooya Parsa --- - arch/wasm/configs/kw_defconfig | 184 +++++++++++++++++++++++++++++++++ - 1 file changed, 184 insertions(+) + arch/wasm/configs/kw_defconfig | 186 +++++++++++++++++++++++++++++++++ + 1 file changed, 186 insertions(+) create mode 100644 arch/wasm/configs/kw_defconfig diff --git a/arch/wasm/configs/kw_defconfig b/arch/wasm/configs/kw_defconfig new file mode 100644 -index 00000000000..7c84764b4fe +index 00000000000..eb90662a5f9 --- /dev/null +++ b/arch/wasm/configs/kw_defconfig -@@ -0,0 +1,184 @@ +@@ -0,0 +1,186 @@ +# unkernel: wasm64 kernel, emulated riscv64 user mode (kwemu) +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="unkernel" @@ -171,6 +171,8 @@ index 00000000000..7c84764b4fe +CONFIG_FB_KWFB=y +# kwshm: the host reads and writes shmem files in place, /dev/kwshm +CONFIG_KWSHM=y ++# /dev/udmabuf: dma-bufs from memfds (lavapipe exports its images so) ++CONFIG_UDMABUF=y +# kwsnd: ALSA playback when the host has audio, plus OSS /dev/dsp for SDL 1.2 +CONFIG_SOUND=y +CONFIG_SND=y diff --git a/kernel/patches/linux/0030-wasm-optional-atomics-and-shared-memory-builds-KW_AT.patch b/kernel/patches/linux/0030-wasm-optional-atomics-and-shared-memory-builds-KW_AT.patch index 031f629..93bd10a 100644 --- a/kernel/patches/linux/0030-wasm-optional-atomics-and-shared-memory-builds-KW_AT.patch +++ b/kernel/patches/linux/0030-wasm-optional-atomics-and-shared-memory-builds-KW_AT.patch @@ -1,4 +1,4 @@ -From 6724db931b3ec15de5d8512fd661202b794f2730 Mon Sep 17 00:00:00 2001 +From 7c303d3de8eb7e084b08665e8a383877d060b63d Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 13:12:25 +0000 Subject: [PATCH] wasm: optional atomics and shared-memory builds (KW_ATOMICS, diff --git a/kernel/patches/linux/0031-wasm-make-atomic_read-and-atomic_set-plain-accesses.patch b/kernel/patches/linux/0031-wasm-make-atomic_read-and-atomic_set-plain-accesses.patch index 4b69461..4ec699a 100644 --- a/kernel/patches/linux/0031-wasm-make-atomic_read-and-atomic_set-plain-accesses.patch +++ b/kernel/patches/linux/0031-wasm-make-atomic_read-and-atomic_set-plain-accesses.patch @@ -1,4 +1,4 @@ -From 66006dedd609d89e4c4098056c8fcbe2f68de771 Mon Sep 17 00:00:00 2001 +From 79e481ce724f19475cd5f2f01cc76ac40a0f466d Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 14:54:54 +0000 Subject: [PATCH] wasm: make atomic_read and atomic_set plain accesses diff --git a/kernel/patches/linux/0032-mm-skip-folio_ref_add-of-zero-when-mapping-an-order-.patch b/kernel/patches/linux/0032-mm-skip-folio_ref_add-of-zero-when-mapping-an-order-.patch index 272a51d..b87a981 100644 --- a/kernel/patches/linux/0032-mm-skip-folio_ref_add-of-zero-when-mapping-an-order-.patch +++ b/kernel/patches/linux/0032-mm-skip-folio_ref_add-of-zero-when-mapping-an-order-.patch @@ -1,4 +1,4 @@ -From 4d40ef28d82c98ed74fc2a1f7920caebbddeec88 Mon Sep 17 00:00:00 2001 +From 4070a45f95f1b20d6f88cf86e39d44a04049ab54 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 14:54:54 +0000 Subject: [PATCH] mm: skip folio_ref_add() of zero when mapping an order-0 diff --git a/kernel/patches/linux/0033-mm-allow-percpu-km-on-SMP-with-a-flat-vmalloc.patch b/kernel/patches/linux/0033-mm-allow-percpu-km-on-SMP-with-a-flat-vmalloc.patch index 51989ad..b7ca884 100644 --- a/kernel/patches/linux/0033-mm-allow-percpu-km-on-SMP-with-a-flat-vmalloc.patch +++ b/kernel/patches/linux/0033-mm-allow-percpu-km-on-SMP-with-a-flat-vmalloc.patch @@ -1,4 +1,4 @@ -From 97e073a6974f68829f75b556095b5f14d68b4a26 Mon Sep 17 00:00:00 2001 +From e367c1409e80f327f1433f412687aec96a92ae04 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 16:06:57 +0000 Subject: [PATCH] mm: allow percpu-km on SMP with a flat vmalloc diff --git a/kernel/patches/linux/0034-sched-let-an-arch-hold-tasks-on-their-CPU-except-whe.patch b/kernel/patches/linux/0034-sched-let-an-arch-hold-tasks-on-their-CPU-except-whe.patch index 81ddc9c..305d504 100644 --- a/kernel/patches/linux/0034-sched-let-an-arch-hold-tasks-on-their-CPU-except-whe.patch +++ b/kernel/patches/linux/0034-sched-let-an-arch-hold-tasks-on-their-CPU-except-whe.patch @@ -1,4 +1,4 @@ -From 3530ec9e61c918f1ddca788028128d1a503fc45c Mon Sep 17 00:00:00 2001 +From 906870a61ecb7afff6b82b9094301ca3ebfcab63 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 16:06:57 +0000 Subject: [PATCH] sched: let an arch hold tasks on their CPU except where they diff --git a/kernel/patches/linux/0035-kthread-workqueue-restart-points-for-ARCH_TASKS_STAY.patch b/kernel/patches/linux/0035-kthread-workqueue-restart-points-for-ARCH_TASKS_STAY.patch index a1bf379..dfaa72b 100644 --- a/kernel/patches/linux/0035-kthread-workqueue-restart-points-for-ARCH_TASKS_STAY.patch +++ b/kernel/patches/linux/0035-kthread-workqueue-restart-points-for-ARCH_TASKS_STAY.patch @@ -1,4 +1,4 @@ -From 0421c8bf497860230502fc5d9d2c85a26d2ba2d7 Mon Sep 17 00:00:00 2001 +From 3c9007f024a2deb4261e2baaa5b383c3ca0e865f Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 16:06:57 +0000 Subject: [PATCH] kthread, workqueue: restart points for ARCH_TASKS_STAY_ON_CPU diff --git a/kernel/patches/linux/0036-smp-let-an-arch-wait-for-a-csd-and-wake-its-waiter.patch b/kernel/patches/linux/0036-smp-let-an-arch-wait-for-a-csd-and-wake-its-waiter.patch index 95d4c9f..bc2b874 100644 --- a/kernel/patches/linux/0036-smp-let-an-arch-wait-for-a-csd-and-wake-its-waiter.patch +++ b/kernel/patches/linux/0036-smp-let-an-arch-wait-for-a-csd-and-wake-its-waiter.patch @@ -1,4 +1,4 @@ -From 091040763121b2ada8ef8f43fedfb5b549f722be Mon Sep 17 00:00:00 2001 +From e1fe174c6f737734a1eb051acfca0c4db3ce82c1 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 23:07:54 +0000 Subject: [PATCH] smp: let an arch wait for a csd and wake its waiter diff --git a/kernel/patches/linux/0037-wasm-SMP.patch b/kernel/patches/linux/0037-wasm-SMP.patch index 7410c2b..1b3cd3e 100644 --- a/kernel/patches/linux/0037-wasm-SMP.patch +++ b/kernel/patches/linux/0037-wasm-SMP.patch @@ -1,4 +1,4 @@ -From eb6245319c1a65327d2895ffdae88343c821c156 Mon Sep 17 00:00:00 2001 +From 3bb4d10b58a68042410cdbb0dbff6e5b2ec89fcc Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 16:07:10 +0000 Subject: [PATCH] wasm: SMP diff --git a/kernel/patches/linux/0038-wasm-host-devices-on-SMP.patch b/kernel/patches/linux/0038-wasm-host-devices-on-SMP.patch index 8c8a045..a237bc6 100644 --- a/kernel/patches/linux/0038-wasm-host-devices-on-SMP.patch +++ b/kernel/patches/linux/0038-wasm-host-devices-on-SMP.patch @@ -1,4 +1,4 @@ -From 900e79cf3604d0dc353e0a3678a2121d616cccb8 Mon Sep 17 00:00:00 2001 +From 44f27c58da220ee20ba3f8462b3d5a667d07aa5a Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 16:07:10 +0000 Subject: [PATCH] wasm: host devices on SMP diff --git a/kernel/patches/linux/0039-wasm-kwblk-on-SMP.patch b/kernel/patches/linux/0039-wasm-kwblk-on-SMP.patch index 0c38f21..4c49957 100644 --- a/kernel/patches/linux/0039-wasm-kwblk-on-SMP.patch +++ b/kernel/patches/linux/0039-wasm-kwblk-on-SMP.patch @@ -1,4 +1,4 @@ -From f2c849c4d01f77d086d21280d93f0c12656c856e Mon Sep 17 00:00:00 2001 +From 3cd70ba641ac8ac093edf044c9f3a19fd48e4a77 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 20:16:02 +0000 Subject: [PATCH] wasm: kwblk on SMP diff --git a/kernel/patches/linux/0040-wasm-kwshm-on-SMP.patch b/kernel/patches/linux/0040-wasm-kwshm-on-SMP.patch index 9fdfc1a..dc5a9e5 100644 --- a/kernel/patches/linux/0040-wasm-kwshm-on-SMP.patch +++ b/kernel/patches/linux/0040-wasm-kwshm-on-SMP.patch @@ -1,4 +1,4 @@ -From bd2acbd0c6f3120b55b8a6d7e3aa6ee3dcc9cc86 Mon Sep 17 00:00:00 2001 +From 83653ca4be0510d085a32b5f7484a54f9669faed Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 20:16:03 +0000 Subject: [PATCH] wasm: kwshm on SMP diff --git a/kernel/patches/linux/0041-wasm-kwfb-on-SMP.patch b/kernel/patches/linux/0041-wasm-kwfb-on-SMP.patch index dcffc05..c9ae1d6 100644 --- a/kernel/patches/linux/0041-wasm-kwfb-on-SMP.patch +++ b/kernel/patches/linux/0041-wasm-kwfb-on-SMP.patch @@ -1,4 +1,4 @@ -From 6c1e7aa08fdca7146b32796a8b72272c110441a5 Mon Sep 17 00:00:00 2001 +From 8d66fafc644e76c693d0e3073e4a73711b58a293 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 20:16:03 +0000 Subject: [PATCH] wasm: kwfb on SMP diff --git a/kernel/patches/linux/0042-wasm-kwinput-on-SMP.patch b/kernel/patches/linux/0042-wasm-kwinput-on-SMP.patch index f9c45ea..9f2cb86 100644 --- a/kernel/patches/linux/0042-wasm-kwinput-on-SMP.patch +++ b/kernel/patches/linux/0042-wasm-kwinput-on-SMP.patch @@ -1,4 +1,4 @@ -From 1bde48ad1e0e47844b42f1f642d537deefb496f0 Mon Sep 17 00:00:00 2001 +From 63b271f1f206785790161c59ac02e2481f73a4ba Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 20:16:04 +0000 Subject: [PATCH] wasm: kwinput on SMP diff --git a/kernel/patches/linux/0043-wasm-kwsnd-on-SMP.patch b/kernel/patches/linux/0043-wasm-kwsnd-on-SMP.patch index ba32e25..9af98ce 100644 --- a/kernel/patches/linux/0043-wasm-kwsnd-on-SMP.patch +++ b/kernel/patches/linux/0043-wasm-kwsnd-on-SMP.patch @@ -1,4 +1,4 @@ -From 0acec711ac8b602c126a039ec505fd26c91d6803 Mon Sep 17 00:00:00 2001 +From c3056b2ff073ce2661180ca268258a953409cd1b Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 20:16:04 +0000 Subject: [PATCH] wasm: kwsnd on SMP diff --git a/kernel/patches/linux/0044-wasm-kwvirtio-on-SMP.patch b/kernel/patches/linux/0044-wasm-kwvirtio-on-SMP.patch index 774b1f1..6fdc4de 100644 --- a/kernel/patches/linux/0044-wasm-kwvirtio-on-SMP.patch +++ b/kernel/patches/linux/0044-wasm-kwvirtio-on-SMP.patch @@ -1,4 +1,4 @@ -From 2542dbb63360c1889fdc11171f7e220e16bea571 Mon Sep 17 00:00:00 2001 +From 21c584d5fec5803098ebcb2829830433dc4f1bc4 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Sat, 21 Nov 2026 18:55:03 +0000 Subject: [PATCH] wasm: kwvirtio on SMP diff --git a/kernel/patches/linux/0045-wasm-block-instead-of-spinning-for-another-CPU-SMP.patch b/kernel/patches/linux/0045-wasm-block-instead-of-spinning-for-another-CPU-SMP.patch index c644084..c112a92 100644 --- a/kernel/patches/linux/0045-wasm-block-instead-of-spinning-for-another-CPU-SMP.patch +++ b/kernel/patches/linux/0045-wasm-block-instead-of-spinning-for-another-CPU-SMP.patch @@ -1,4 +1,4 @@ -From 841474b2962e5e62574a710be4d050f6bf7b25cc Mon Sep 17 00:00:00 2001 +From c5b794ce5f619aa14e9294ce04feacbcf06f6c81 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Mon, 16 Nov 2026 23:07:54 +0000 Subject: [PATCH] wasm: block instead of spinning for another CPU (SMP) diff --git a/kernel/patches/linux/0046-wasm-take-a-free-spinlock-out-of-turn-kw_spin_unfair.patch b/kernel/patches/linux/0046-wasm-take-a-free-spinlock-out-of-turn-kw_spin_unfair.patch index 80a26ba..8c05722 100644 --- a/kernel/patches/linux/0046-wasm-take-a-free-spinlock-out-of-turn-kw_spin_unfair.patch +++ b/kernel/patches/linux/0046-wasm-take-a-free-spinlock-out-of-turn-kw_spin_unfair.patch @@ -1,4 +1,4 @@ -From 42d85ee2c63b4a3600298bd19af9cd3f126d296b Mon Sep 17 00:00:00 2001 +From 0b3add7f4bf282a9730a0a44ebb4a155e38e44d0 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Tue, 17 Nov 2026 09:05:49 +0000 Subject: [PATCH] wasm: take a free spinlock out of turn (kw_spin_unfair=, SMP) diff --git a/kernel/patches/linux/0047-wasm-do-not-wait-for-a-CPU-that-compiles-or-yields-t.patch b/kernel/patches/linux/0047-wasm-do-not-wait-for-a-CPU-that-compiles-or-yields-t.patch index 38840c7..4c89109 100644 --- a/kernel/patches/linux/0047-wasm-do-not-wait-for-a-CPU-that-compiles-or-yields-t.patch +++ b/kernel/patches/linux/0047-wasm-do-not-wait-for-a-CPU-that-compiles-or-yields-t.patch @@ -1,4 +1,4 @@ -From 48f6fd5dd3b18fad24c07ee45c7c642976e257ed Mon Sep 17 00:00:00 2001 +From 2c81bcbefbb1e03aab3c7bd59b169ffa2e959956 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Tue, 17 Nov 2026 14:38:17 +0000 Subject: [PATCH] wasm: do not wait for a CPU that compiles or yields to its diff --git a/kernel/patches/linux/0048-wasm-parking-and-snapshots-on-SMP.patch b/kernel/patches/linux/0048-wasm-parking-and-snapshots-on-SMP.patch index 989f2d4..ae43322 100644 --- a/kernel/patches/linux/0048-wasm-parking-and-snapshots-on-SMP.patch +++ b/kernel/patches/linux/0048-wasm-parking-and-snapshots-on-SMP.patch @@ -1,4 +1,4 @@ -From 33d2c08dfeea6365dbd0c7294d6b508953d80da8 Mon Sep 17 00:00:00 2001 +From 677502fde4d8dc803e243a46afa7a669c8dd68a1 Mon Sep 17 00:00:00 2001 From: kernel-wasm Date: Fri, 20 Nov 2026 08:27:30 +0000 Subject: [PATCH] wasm: parking and snapshots on SMP