Skip to content

riscv: OpenSBI domains, diagnose unreachable harts and document static-partition mode #33

Description

@congwang-mk

Part of the RISC-V port.

OpenSBI domains are firmware-level partitions (harts + PMP-protected memory + allowed MMIO) configured in the DTB at firmware boot. A hart in domain X cannot HART_START a hart outside X, and PMP blocks its memory access. Stronger isolation than x86 or arm64 offer, but static (fixed at boot, at most ~16 PMP regions), so it does not fit the dynamic pool model directly.

Two pieces:

  1. Diagnose: when HART_START returns SBI_ERR_INVALID_PARAM/SBI_ERR_DENIED for a pool hart, check /chosen/opensbi-domains (or the opensbi,domain-instance nodes) and print "hart N is outside this kernel's OpenSBI domain; cannot be pooled" instead of a bare error. Also refuse to add such harts to the pool up front when the DTB describes the domains.
  2. Design note (no code yet): an opt-in "static partition" mode that maps instances onto pre-configured domains, gaining firmware-enforced memory isolation between instances. Write up constraints (PMP count, no dynamic resize, memory grant must equal the domain's region) under Documentation/multikernel/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    riscvriscv port

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions