Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/build-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,25 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev

- name: Cache kernel build
uses: actions/cache@v4
with:
path: |
linux-*/arch/arm64/boot/Image
linux-*/.config
linux-*/Module.symvers
linux-*/include/config
linux-*/include/generated
linux-*/arch/arm64/include/generated
linux-*/scripts
linux-*/tools
kernel.c
key: kernel-aarch64-${{ hashFiles('Makefile', 'config-common', 'config-arch-aarch64', 'config-libkrunfw_aarch64', 'patches/**') }}

- name: Build aarch64 kernel
run: make
23 changes: 0 additions & 23 deletions .github/workflows/build-sev.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/build-tdx.yml

This file was deleted.

23 changes: 16 additions & 7 deletions .github/workflows/build-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@ jobs:
if: github.event_name == 'pull_request'
name: Build x86_64 kernel
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- x86_64-unknown-linux-gnu
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev

- name: Cache kernel build
uses: actions/cache@v4
with:
path: |
linux-*/vmlinux
linux-*/.config
linux-*/Module.symvers
linux-*/include/config
linux-*/include/generated
linux-*/arch/x86/include/generated
linux-*/scripts
linux-*/tools
kernel.c
key: kernel-x86_64-${{ hashFiles('Makefile', 'config-common', 'config-arch-x86_64', 'config-libkrunfw_x86_64', 'patches/**') }}

- name: Build x86_64 kernel
run: make
17 changes: 0 additions & 17 deletions .github/workflows/cross-build-riscv64.yml

This file was deleted.

82 changes: 59 additions & 23 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev gcc-aarch64-linux-gnu gcc-riscv64-linux-gnu
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev

- name: Cache kernel build
uses: actions/cache@v4
with:
path: |
linux-*/vmlinux
linux-*/.config
linux-*/Module.symvers
linux-*/include/config
linux-*/include/generated
linux-*/arch/x86/include/generated
linux-*/scripts
linux-*/tools
kernel.c
key: kernel-x86_64-${{ hashFiles('Makefile', 'config-common', 'config-arch-x86_64', 'config-libkrunfw_x86_64', 'patches/**') }}

- name: Build x86_64 package
run: |
make
make PREFIX=tmp install
cd tmp
tar czf ../libkrunfw-x86_64.tgz lib64
tar czf ../libkrunfw-linux-x86_64.tar.gz lib64
cd ..
rm -fr tmp
gh release upload ${{github.event.release.tag_name}} libkrunfw-x86_64.tgz
make clean
gh release upload ${{github.event.release.tag_name}} libkrunfw-linux-x86_64.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
Expand All @@ -35,50 +49,72 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev

- name: Cache kernel build
uses: actions/cache@v4
with:
path: |
linux-*/arch/arm64/boot/Image
linux-*/.config
linux-*/Module.symvers
linux-*/include/config
linux-*/include/generated
linux-*/arch/arm64/include/generated
linux-*/scripts
linux-*/tools
kernel.c
key: kernel-aarch64-${{ hashFiles('Makefile', 'config-common', 'config-arch-aarch64', 'config-libkrunfw_aarch64', 'patches/**') }}

- name: Build aarch64 package
run: |
make
make PREFIX=tmp install
mkdir libkrunfw
cp Makefile LICENSE-* kernel.c bin2cbundle.py libkrunfw
tar czf libkrunfw-prebuilt-aarch64.tgz libkrunfw
tar czf libkrunfw-linux-prebuilt-aarch64.tar.gz libkrunfw
rm -fr libkrunfw
cd tmp
tar czf ../libkrunfw-aarch64.tgz lib64
tar czf ../libkrunfw-linux-aarch64.tar.gz lib64
cd ..
rm -fr tmp
gh release upload ${{github.event.release.tag_name}} libkrunfw-prebuilt-aarch64.tgz
gh release upload ${{github.event.release.tag_name}} libkrunfw-aarch64.tgz
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- clean
gh release upload ${{github.event.release.tag_name}} libkrunfw-linux-prebuilt-aarch64.tar.gz
gh release upload ${{github.event.release.tag_name}} libkrunfw-linux-aarch64.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash

build-riscv64:
name: Build package for riscv64
runs-on: ubuntu-latest
- name: Upload kernel.c for macOS build
uses: actions/upload-artifact@v4
with:
name: kernel-c-aarch64
path: kernel.c

build-darwin-aarch64:
name: Build dylib for macOS aarch64
needs: build-aarch64
runs-on: macos-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make gcc bc bison flex elfutils python3-pyelftools curl patch libelf-dev gcc-riscv64-linux-gnu
- name: Download kernel.c
uses: actions/download-artifact@v4
with:
name: kernel-c-aarch64

- name: Build riscv64 package
- name: Build macOS dylib
run: |
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- PREFIX=tmp install
make
make PREFIX=tmp install
cd tmp
tar czf ../libkrunfw-riscv64.tgz lib64
tar czf ../libkrunfw-darwin-aarch64.tar.gz lib
cd ..
rm -fr tmp
gh release upload ${{github.event.release.tag_name}} libkrunfw-riscv64.tgz
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- clean
gh release upload ${{github.event.release.tag_name}} libkrunfw-darwin-aarch64.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
KERNEL_VERSION = linux-6.12.62
KERNEL_VERSION = linux-6.12.68
KERNEL_REMOTE = https://cdn.kernel.org/pub/linux/kernel/v6.x/$(KERNEL_VERSION).tar.xz
KERNEL_TARBALL = tarballs/$(KERNEL_VERSION).tar.xz
KERNEL_SOURCES = $(KERNEL_VERSION)
KERNEL_PATCHES = $(shell find patches/ -name "0*.patch" | sort)
KERNEL_C_BUNDLE = kernel.c

ABI_VERSION = 5
FULL_VERSION = 5.1.0
TIMESTAMP = "Mon Dec 15 19:43:20 CET 2025"
FULL_VERSION = 5.2.1
TIMESTAMP = "Tue Feb 17 16:15:12 CET 2026"

KERNEL_FLAGS = KBUILD_BUILD_TIMESTAMP=$(TIMESTAMP)
KERNEL_FLAGS += KBUILD_BUILD_USER=root
Expand Down Expand Up @@ -57,7 +57,7 @@ SONAME_Linux = -Wl,-soname,$(KRUNFW_SONAME_Linux)
KRUNFW_BINARY_Darwin = libkrunfw.$(ABI_VERSION).dylib
KRUNFW_SONAME_Darwin = libkrunfw.$(ABI_VERSION).dylib
KRUNFW_BASE_Darwin = libkrunfw.dylib
SONAME_Darwin =
SONAME_Darwin = -Wl,-current_version,$(FULL_VERSION) -Wl,-compatibility_version,$(ABI_VERSION).0.0

LIBDIR_Linux = lib64
LIBDIR_Darwin = lib
Expand Down Expand Up @@ -90,7 +90,16 @@ $(KERNEL_TARBALL):
$(KERNEL_SOURCES): $(KERNEL_TARBALL)
tar xf $(KERNEL_TARBALL)
for patch in $(KERNEL_PATCHES); do patch -p1 -d $(KERNEL_SOURCES) < "$$patch"; done
cp config-libkrunfw$(VARIANT)_$(GUESTARCH) $(KERNEL_SOURCES)/.config
@if [ -f config-common ] && [ -f config-arch-$(GUESTARCH) ]; then \
echo "Merging config fragments: config-common + config-arch-$(GUESTARCH)"; \
cd $(KERNEL_SOURCES) && KCONFIG_CONFIG=.config \
scripts/kconfig/merge_config.sh -m \
../config-common \
../config-arch-$(GUESTARCH); \
else \
echo "Using monolithic config: config-libkrunfw$(VARIANT)_$(GUESTARCH)"; \
cp config-libkrunfw$(VARIANT)_$(GUESTARCH) $(KERNEL_SOURCES)/.config; \
fi
cd $(KERNEL_SOURCES) ; $(MAKE) olddefconfig

$(KERNEL_BINARY_$(GUESTARCH)): $(KERNEL_SOURCES)
Expand Down
58 changes: 58 additions & 0 deletions config-arch-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# Architecture-specific options for aarch64.
# Merged with config-common at build time.
#

CONFIG_ARM64=y
CONFIG_ARCH_VEXPRESS=y

# ARMv8.x features
CONFIG_ARM64_HW_AFDBM=y
CONFIG_ARM64_PAN=y
CONFIG_ARM64_LSE_ATOMICS=y
CONFIG_ARM64_PMEM=y
CONFIG_ARM64_RAS_EXTN=y
CONFIG_ARM64_CNP=y
CONFIG_ARM64_PTR_AUTH=y
CONFIG_ARM64_AMU_EXTN=y
CONFIG_ARM64_TLB_RANGE=y
CONFIG_ARM64_BTI=y
CONFIG_ARM64_E0PD=y
CONFIG_ARM64_MTE=y
CONFIG_ARM64_EPAN=y
CONFIG_ARM64_SVE=y
CONFIG_ARM64_SME=y

# Memory layout
CONFIG_ARM64_4K_PAGES=y
CONFIG_ARM64_VA_BITS_48=y
CONFIG_ARM64_PA_BITS_48=y
CONFIG_PGTABLE_LEVELS=4

# KVM (nested virtualization host support)
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y

# Vhost (host-side virtio acceleration)
CONFIG_VHOST=y
CONFIG_VHOST_NET=y
CONFIG_VHOST_VSOCK=y

# GIC (interrupt controller)
CONFIG_ARM_GIC=y
CONFIG_ARM_GIC_V3=y

# Serial
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y

# Timer
CONFIG_ARM_ARCH_TIMER=y

# Firmware
CONFIG_ARM_PSCI_FW=y
CONFIG_HAVE_ARM_SMCCC=y

# box64 compat
CONFIG_COMPAT=y
CONFIG_KUSER_HELPERS=y
Loading
Loading