RFC kernel: Introduce multikernel architecture support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 RFC Latest16 patches 0 repliesNew
- v1 RFC7 patches 35 repliesSuperseded
Changes in v2 from the cover letter
- Switched from kexec_load() to kexec_file_load()
- Introduced generic multikernel physical memory allocation and per-instance virtual memory allocation
- Introduced kernfs interface for managing kernel instances
- Introduced device-tree and KHO framework for resource management and sharing
- Introduced messaging over IPI framework, preparing for dynamic resource allocation and zero-downtime upgrade
- Grouped multikernel code in the kernel/multikernel/ directory
- Reorganized and rebased all the patches
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/16 | kexec: Introduce multikernel support via kexecarch/ arch/ include/ +4 more | +230 | 0 replies | |
| 2/16 | x86: Introduce SMP INIT trampoline for multikernel CPU bootstraparch/ arch/ arch/ +3 more | +373 | 0 replies | |
| 3/16 | multikernel: Introduce basic multikernel subsystem infrastructurekernel/ kernel/ kernel/ +2 more | +46 | 0 replies | |
| 4/16 | x86: Introduce MULTIKERNEL_VECTOR for inter-kernel communicationarch/ arch/ arch/ +1 more | +15 | 0 replies | |
| 5/16 | x86: Introduce arch_cpu_physical_id() to obtain physical CPU IDarch/ arch/ | +12 | 0 replies | |
| 6/16 | multikernel: Introduce physical memory reservation and allocationinclude/ kernel/ kernel/ | +399 | 0 replies | |
| 7/16 | kexec: Implement dynamic kimage trackingarch/ arch/ include/ +3 more | +187 | 0 replies | |
| 8/16 | multikernel: Introduce device-tree based kernfs interfaceinclude/ kernel/ kernel/ +4 more | +1979 | 0 replies | |
| 9/16 | kexec: Integrate multikernel instance management with kexec subsysteminclude/ include/ include/ +2 more | +85 | 0 replies | |
| 10/16 | Documentation: Add multikernel usageDocumentation/ | +215 | 0 replies | |
| 11/16 | kexec: Add /proc/kimage interface for kimage trackingkernel/ | +63 | 0 replies | |
| 12/16 | multikernel: Introduce per-instance memory allocation interfaceinclude/ kernel/ | +104 | 0 replies | |
| 13/16 | kernel: Introduce generic multikernel IPI communication frameworkarch/ include/ kernel/ +1 more | +541 | 0 replies | |
| 14/16 | multikernel: Add messaging layer for inter-kernel communicationinclude/ kernel/ kernel/ +1 more | +486 | 0 replies | |
| 15/16 | kexec: Integrate multikernel support with kexec_file_load()include/ kernel/ kernel/ | +177 | 0 replies | |
| 16/16 | multikernel: Integrate Kexec HandOver framework for DTB preservationarch/ arch/ drivers/ +9 more | +691 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC Patch v2 00/16] kernel: Introduce multikernel architecture support
This patch series introduces multikernel architecture support, enabling multiple independent kernel instances to coexist and communicate on a single physical machine. Each kernel instance can run on dedicated CPU cores while sharing the underlying hardware resources.
The multikernel architecture provides several key benefits:
- Better resource utilization than traditional VM (KVM, Xen etc.)
- Better performance than containers without noisy neighbor issues
- Improved fault isolation between different kernels
- Potential zero-down kernel update with KHO (Kernel HandOver)
Architecture Overview:
The implementation leverages kexec infrastructure to load and manage multiple kernel images, with each kernel instance assigned to specific CPU cores. Inter-kernel communication is facilitated through a dedicated IPI framework that allows kernels to coordinate and share information when necessary.
Key Components:
1. Enhanced kexec subsystem with dynamic kimage tracking
2. Generic physical memory allocation for multikernel and kernel instances
3. Multikernel-specific kernfs for managing kernel instances
4. Device-tree based mechanism for static resource allocation
5. Device-tree overlay based mechanism for dynamic resource allation
6. KHO based mechanism for device-tree sharing between kernels
7. Generic IPI communication framework for inter-kernel messaging
8. Proc interface (/proc/kimage) for monitoring loaded kernel images
The implementation maintains full backward compatibility with existing kexec functionality while adding the new multikernel capabilities.
For the complete roadmap, please see:
https://docs.google.com/document/d/1yneO6O6C_z0Lh3A2QyT8XsH7ZrQ7-naGQT-rpdjWa_g/
For the Proof-of-Concept demo (prior to device-tree), please see:
https://www.youtube.com/watch?v=bmC4JRTSDKE
For user-space components, especially device-tree specification, please check kerf project: https://github.com/multikernel/kerf
IMPORTANT NOTES:
1) This is a Request for Comments (RFC) submission. While the core architecture is functional, there are numerous implementation details that need improvement. The primary goal is to gather feedback on the high-level design and overall approach rather than focus on specific coding details at this stage.
2) This patch series represents only the foundational framework for multikernel support. It establishes the basic infrastructure and communication mechanisms. We welcome the community to build upon this foundation and develop their own solutions based on this framework.
3) Testing has been limited to the author's development machine using hard-coded boot parameters and specific hardware configurations. Community testing across different hardware platforms, configurations, and use cases would be greatly appreciated to identify potential issues and improve robustness. Obviously, don't use this code beyond testing.
Changes since RFC V1:
- Switched from kexec_load() to kexec_file_load()
- Introduced generic multikernel physical memory allocation and per-instance virtual memory allocation
- Introduced kernfs interface for managing kernel instances
- Introduced device-tree and KHO framework for resource management and sharing
- Introduced messaging over IPI framework, preparing for dynamic resource allocation and zero-downtime upgrade
- Grouped multikernel code in the kernel/multikernel/ directory
- Reorganized and rebased all the patches
---
Cong Wang (16):
kexec: Introduce multikernel support via kexec
x86: Introduce SMP INIT trampoline for multikernel CPU bootstrap
multikernel: Introduce basic multikernel subsystem infrastructure
x86: Introduce MULTIKERNEL_VECTOR for inter-kernel communication
x86: Introduce arch_cpu_physical_id() to obtain physical CPU ID
multikernel: Introduce physical memory reservation and allocation
kexec: Implement dynamic kimage tracking
multikernel: Introduce device-tree based kernfs interface
kexec: Integrate multikernel instance management with kexec subsystem
Documentation: Add multikernel usage
kexec: Add /proc/kimage interface for kimage tracking
multikernel: Introduce per-instance memory allocation interface
kernel: Introduce generic multikernel IPI communication framework
multikernel: Add messaging layer for inter-kernel communication
kexec: Integrate multikernel support with kexec_file_load()
multikernel: Integrate Kexec HandOver framework for DTB preservation
Documentation/multikernel/usage.rst | 215 ++++++++ arch/powerpc/kexec/crash.c | 8 +- arch/x86/include/asm/idtentry.h | 3 + arch/x86/include/asm/irq_vectors.h | 1 + arch/x86/include/asm/smp.h | 7 + arch/x86/kernel/Makefile | 1 + arch/x86/kernel/crash.c | 4 +- arch/x86/kernel/head64.c | 5 + arch/x86/kernel/idt.c | 3 + arch/x86/kernel/kexec-bzimage64.c | 16 +- arch/x86/kernel/setup.c | 11 +- arch/x86/kernel/smp.c | 17 + arch/x86/kernel/smpboot.c | 159 ++++++ arch/x86/kernel/trampoline_64_bsp.S | 288 +++++++++++ arch/x86/kernel/vmlinux.lds.S | 6 + drivers/of/kexec.c | 20 +- include/linux/kexec.h | 30 +- include/linux/kexec_handover.h | 40 ++ include/linux/multikernel.h | 659 ++++++++++++++++++++++++ include/uapi/linux/kexec.h | 5 + include/uapi/linux/reboot.h | 2 +- kernel/Kconfig.kexec | 2 + kernel/Makefile | 1 + kernel/kexec.c | 60 ++- kernel/kexec_core.c | 384 ++++++++++++++ kernel/kexec_file.c | 158 +++++- kernel/kexec_handover.c | 197 ++++++- kernel/multikernel/Kconfig | 26 + kernel/multikernel/Makefile | 9 + kernel/multikernel/core.c | 532 +++++++++++++++++++ kernel/multikernel/dts.c | 466 +++++++++++++++++ kernel/multikernel/internal.h | 4 + kernel/multikernel/ipi.c | 471 +++++++++++++++++ kernel/multikernel/kernfs.c | 772 ++++++++++++++++++++++++++++ kernel/multikernel/kho.c | 356 +++++++++++++ kernel/multikernel/mem.c | 376 ++++++++++++++ kernel/multikernel/messaging.c | 278 ++++++++++ kernel/reboot.c | 10 + 38 files changed, 5572 insertions(+), 30 deletions(-) create mode 100644 Documentation/multikernel/usage.rst create mode 100644 arch/x86/kernel/trampoline_64_bsp.S create mode 100644 include/linux/multikernel.h create mode 100644 kernel/multikernel/Kconfig create mode 100644 kernel/multikernel/Makefile create mode 100644 kernel/multikernel/core.c create mode 100644 kernel/multikernel/dts.c create mode 100644 kernel/multikernel/internal.h create mode 100644 kernel/multikernel/ipi.c create mode 100644 kernel/multikernel/kernfs.c create mode 100644 kernel/multikernel/kho.c create mode 100644 kernel/multikernel/mem.c create mode 100644 kernel/multikernel/messaging.c
Signature · 1 line
2.34.1