Repository navigation
kerf: Run on RISC-V hosts and handle CPUs the host never booted - #24
Merged
Merged
Conversation
riscv64 uses the generic syscall table, as arm64 does, so kexec_file_load is 294 and reboot 142 there too; kerf fell back to the x86_64 numbers with a warning. A hart's physical ID is its hart ID, which /proc/cpuinfo only has for online harts. Its device tree node keeps it in reg for a hart given to the pool as well, which is where kerf already reads an arm64 MPIDR from, so only the name in messages changes. Signed-off-by: Cong Wang <cwang@multikernel.io>
A machine can have CPUs the host's device tree leaves out, the cores of another kind where there are two. The kernel finds them when the pool is first set up and keeps them in the pool from then on, listed under cpus-unclaimed in the root device tree. Where the CPUs are not all alike, /cpu-kinds says which are of which kind. Read both. The unclaimed CPUs need not be asked for and cannot be given back, so --cpus keeps meaning host CPUs: every request carries the unclaimed ones along, and so does a replayed dump, which lists those of the machine it was taken on. A pool with none of the host's CPUs is no longer an error, as it can still hold unclaimed ones, which kerf only learns of once the pool exists. One kernel runs on one kind of CPU only. Refuse an instance whose CPUs are of more than one kind, which the kernel would refuse as well, with less to say about why. kerf show lists the unclaimed CPUs and, where there is more than one kind, the CPUs of each. Signed-off-by: Cong Wang <cwang@multikernel.io>
congwang-mk
force-pushed
the
riscv-porting
branch
from
November 24, 2026 20:49
9bd2d17 to
bae13af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two commits that let kerf run on RISC-V hosts, including machines whose device tree leaves some CPUs out of the host.
Support RISC-V hosts
kexec_file_loadis 294 andrebootis 142. kerf used to fall back to the x86_64 numbers with a warning./proc/cpuinfoonly has it for online harts, but the device tree node keeps it inregfor a hart given to the pool, which is where kerf already reads an arm64 MPIDR from. Only the name in messages changes.Show and keep the pool's CPUs the host never booted
cpus-unclaimedin the root device tree. Where the CPUs are not all alike,/cpu-kindssays which are of which kind. kerf now reads both.--cpuskeeps meaning host CPUs: every request carries the unclaimed ones along, and so does a replayed dump.kerf showlists the unclaimed CPUs and, where there is more than one kind, the CPUs of each.Testing
pytest tests: 618 passed, 1 skippedtest_parser_pool.py,test_validator.py,test_init_reconcile.pyandtest_topology.py🤖 Generated with Claude Code