Skip to content

riscv: Kconfig, asm/multikernel.h (hartid maps) and arch stubs #22

Open

Description

@congwang-mk

Part of the RISC-V port (see tracking issue). Depends on #8 (generic core cleanups).

  • arch/riscv/Kconfig: select ARCH_SUPPORTS_MULTIKERNEL (depends on RISCV_SBI, KEXEC_FILE, HOTPLUG_CPU, !RISCV_M_MODE).
  • arch/riscv/include/asm/multikernel.h: arch_cpu_physical_id() = cpuid_to_hartid_map(cpu), arch_cpu_from_physical_id() = riscv_hartid_to_cpuid(hartid). Hartids are sparse and may exceed NR_CPUS; never index arrays by hartid (the spinwait code does, cpu_ops_spinwait.c:26, and that is why it is not a model).
  • MK_CTRL_BLOCK_SIZE: spawn context record + DTB + the fence.i entry stub page. No page tables, no trampoline pages.
  • arch/riscv/multikernel/Makefile + spawn.c with stubs for every function in the "Architecture interface" section of include/linux/multikernel.h.

Goal: an rv64 build with CONFIG_MULTIKERNEL=y that links. Functionality follows.

Activity

  1. nickolaev commented on Aug 26, 2026

    @nickolaev

    @congwang-mk I would like to take this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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