Skip to content

add TDX support #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
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
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ KERNEL_FLAGS += KBUILD_BUILD_HOST=libkrunfw

ifeq ($(SEV),1)
VARIANT = -sev
KERNEL_PATCHES += $(shell find patches-sev/ -name "0*.patch" | sort)
KERNEL_PATCHES += $(shell find patches-tee/ -name "0*.patch" | sort)
endif
ifeq ($(TDX),1)
VARIANT = -tdx
KERNEL_PATCHES += $(shell find patches-tee/ -name "0*.patch" | sort)
endif

HOSTARCH = $(shell uname -m)
Expand Down Expand Up @@ -57,7 +61,13 @@ ifeq ($(PREFIX),)
endif

ifeq ($(SEV),1)
QBOOT_BINARY = qboot/bios.bin
QBOOT_BINARY = qboot/sev/bios.bin
QBOOT_C_BUNDLE = qboot.c
INITRD_BINARY = initrd/initrd.gz
INITRD_C_BUNDLE = initrd.c
endif
ifeq ($(TDX),1)
QBOOT_BINARY = qboot/tdx/bios.bin
QBOOT_C_BUNDLE = qboot.c
INITRD_BINARY = initrd/initrd.gz
INITRD_C_BUNDLE = initrd.c
Expand Down Expand Up @@ -100,6 +110,16 @@ $(INITRD_C_BUNDLE): $(INITRD_BINARY)
@python3 bin2cbundle.py -t initrd $(INITRD_BINARY) initrd.c
endif

ifeq ($(TDX),1)
$(QBOOT_C_BUNDLE): $(QBOOT_BINARY)
@echo "Generating $(QBOOT_C_BUNDLE) from $(QBOOT_BINARY)..."
@python3 bin2cbundle.py -t qboot $(QBOOT_BINARY) qboot.c

$(INITRD_C_BUNDLE): $(INITRD_BINARY)
@echo "Generating $(INITRD_C_BUNDLE) from $(INITRD_BINARY)..."
@python3 bin2cbundle.py -t initrd $(INITRD_BINARY) initrd.c
endif

$(KRUNFW_BINARY_$(OS)): $(KERNEL_C_BUNDLE) $(QBOOT_C_BUNDLE) $(INITRD_C_BUNDLE)
$(CC) -fPIC -DABI_VERSION=$(ABI_VERSION) -shared $(SONAME_$(OS)) -o $@ $(KERNEL_C_BUNDLE) $(QBOOT_C_BUNDLE) $(INITRD_C_BUNDLE)
ifeq ($(OS),Linux)
Expand Down
Loading