Open Source
My upstream work centers on firmware that boots servers and devices, the protocols they use to prove what they are running, and getting software to run well on new hardware. Everything below is merged upstream; each item links to the change itself.
Boot firmware
U-Boot
U-Boot is the bootloader on most embedded Linux boards and on QEMU’s virt machines.
QEMU RISC-V now boots through standard boot, so a kernel passed with
-kernel, -initrd and -append boots directly when U-Boot runs from pflash:
- riscv: qemu: Switch to standard boot
- cmd: Enable qfw by default on QEMU RISC-V
- riscv: qemu: Do not disable initrd relocation
- doc: qemu-riscv: Describe booting a kernel through fw_cfg
TPM:
- tpm: Fix the size of the random data in tpm2_get_random()
— a u32 was filled through a u16 pointer, so the TPM RNG failed whenever the
stale upper half was not zero, breaking the kaslr-seed fixup on every
bootefi.
SpacemiT K1, on the Milk-V Jupiter:
- spacemit: k1: drop the CS1 DRAM map on single-rank boards — a 4 GiB board was reported as 8 GiB, so U-Boot reserved memory past the end of DRAM and passed 8 GiB to Linux.
- spacemit: k1: initialise the EEPROM index in read_ddr_info()
- configs: k1: enable GigaDevice SPI NOR flash support
u-root (LinuxBoot)
u-root is the Go userland that LinuxBoot uses to replace UEFI’s boot stage with Linux. I added RISC-V and 32-bit Arm support to its kexec path.
- pkg/boot: add riscv64 kexec support
—
kexec_loadused to return ENOSYS on riscv64. Adds a parser for the RISC-VImageheader, EFI-stub kernels included, and the riscv64 load path. - pkg/boot: add arm kexec support — tested on a BeagleBone Black, which kexecs from one kernel into another and boots to a login prompt.
- pkg/boot/kexec: honour #address-cells and #size-cells in the FDT memory map — device trees with 32-bit cells, as on 32-bit Arm, could not be read at all.
- integration: run kexec_load tests on riscv64
- kexec: explain kexec_file_load failures
- bootcmd: show the menu again when the shell exits
- pkg/boot/zimage: accept a longer kernel size entry
- cmds/core/reboot: add reboot command
- integration: attach socket NICs with -netdev/-device
Android Generic Bootloader (AOSP libbootloader)
Fixes to the documented QEMU flows for GBL, each one a command that failed as written on a current distribution:
- Attach virtio-blk in riscv64 QEMU example — the example only worked on one side of QEMU 9.0’s change to default drive attachment; checked on QEMU 8.2 and 10.2.
- Fix OVMF firmware path in standalone QEMU instructions
- Fix rust-gdb prebuilt path in launch_qemu_gdb.sh
Platform security
DMTF libspdm
libspdm is DMTF’s reference implementation of SPDM, the protocol devices use to authenticate and establish secure sessions with the platform.
- Fix key update rollback for Specula cluster A.1 and A.3
— a failed
KEY_UPDATEcould leave a session with half-updated keys and no way back. The fix marks the backup valid before deriving new keys and rolls back every failure arm, with unit tests that fail against the old code. - Assert the exact key update callback sequence in KEY_UPDATE tests
OpenPRoT pldm-lib
pldm-lib is OpenPRoT’s Rust implementation of PLDM, the protocol a platform root of trust uses for firmware updates and device management. My changes make its decoders safe against malformed messages from a peer:
- pldm-common: bound wire version-string lengths by the destination
- pldm-common: bound descriptor and downstream string lengths — with a test that feeds all 20 decoders malformed buffers and fails if any of them panics.
- pldm-interface: answer requests that fail to decode — fifteen request handlers sent no response at all, leaving the update agent waiting for its timeout.
LLM inference on RISC-V
llama.cpp
Matrix kernels for the SpacemiT X60’s IME matrix extension:
- ggml-cpu: add Q8_0 IME1 matrix kernel for SpacemiT X60 — prefill on Qwen2.5-0.5B went from 10.7 to 95.3 tokens/s on a Milk-V Jupiter board.
- ggml-cpu: conditionally add SpacemiT IME kernel sources
Triton CPU backend
triton-cpu compiles Triton GPU kernels for CPUs:
- Round fp32 to bf16 to nearest even without native support
— on x86 without
avx512bf16, the conversion truncated, and about half of the elements in the bf16 tests came out wrong. - Enable 43 more test_core.py tests on the CPU backend
- Honor the mask in tl.histogram
Android kernel
Documentation fixes in the Android Common Kernel (kernel/common), for the
binder, dma-buf, dma-heap and UFS interfaces:
- binder: fix kernel-doc for struct binder_priority
- dma-buf: fix kernel-doc for dma_buf_set_name()
- dma-heap: document the return values of the exported helpers
- dma-heap: restore struct dma_heap kernel-doc lost in a merge
- scsi: ufs: fix kernel-doc for the UPIU prepare helpers
Systems tools
- elfuse (7 merged) — runs Arm64 and
x86-64 Linux ELF binaries on macOS. My changes bring its Linux syscall
emulation closer to the kernel: futex refusals,
CLONE_THREADexit signalling,AT_EMPTY_PATH, deferred stack unmapping. - codetrial (6 merged) — a live technical interview simulator.
- frama-c-mcp (3 merged) — an MCP server that gives AI agents the Frama-C formal verification tools.
- shecc — a regression test for the self-hosting, educational C compiler.
- sse2neon — dropped a
<fenv.h>dependency that leakedFE_*macros into every includer, and added an SVE2 fast path for the string compare EQUAL_ANY mode. - UCAgent (2 merged) — a CI workflow
that runs the unit tests on pull requests, and skill scripts run with the
Python that runs UCAgent instead of whichever is first on
PATH.