Skip to content

Add initial LoongArch guest kernel support#118

Open
yzewei wants to merge 1 commit intocontainers:mainfrom
yzewei:loongarch-single-vcpu-libkrunfw-pr1
Open

Add initial LoongArch guest kernel support#118
yzewei wants to merge 1 commit intocontainers:mainfrom
yzewei:loongarch-single-vcpu-libkrunfw-pr1

Conversation

@yzewei
Copy link
Copy Markdown

@yzewei yzewei commented Apr 13, 2026

This PR adds the minimum libkrunfw changes required to support LoongArch in the current single-vCPU libkrun configuration.

Changes in this PR:

  • Make the build process recognize ARCH=loongarch, use loongarch64 as the guest architecture, and bundle arch/loongarch/boot/vmlinux.efi.

  • Extend bin2cbundle.py to add the linux_pe bundle type so that the LoongArch EFI kernel image is embedded with the correct load and entry addresses.

  • Add config-libkrunfw_loongarch64 to the bundled Linux 6.12.76 guest kernel.

This PR is specifically limited to the initial enabling of LoongArch for single-vCPU guests.

LoongArch SMP support still relies on additional host-side KVM IPI processing and client-side interrupt/SMP startup, but as of the current kernel version used by libkrunfw, it is not supported and will require separate patches or waiting for the kernel version to be updated to 6.13. These will be handled separately.

@yzewei
Copy link
Copy Markdown
Author

yzewei commented Apr 13, 2026

PTAL! @slp

Signed-off-by: Zewei Yang <yangzewei@loongson.cn>
@yzewei yzewei force-pushed the loongarch-single-vcpu-libkrunfw-pr1 branch from 08b003c to 160cc18 Compare April 13, 2026 07:16
@slp
Copy link
Copy Markdown
Collaborator

slp commented Apr 13, 2026

Changes look good to me, but please also extend the CI to do a cross-build for LoongArch. The RISCV test can be used as a reference: https://github.com/containers/libkrunfw/blob/main/.github/workflows/cross-build-riscv64.yml

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants