]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm: Add hypervisor/boot protocol configuration
authorMarco Schlumpp <marco@unikraft.io>
Thu, 9 Feb 2023 13:38:27 +0000 (14:38 +0100)
committerUnikraft <monkey@unikraft.io>
Mon, 8 May 2023 19:49:15 +0000 (19:49 +0000)
This allows the configuration of a target hypervisor. Depending on the
hypervisor a suitable boot protocol is selected.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #760

plat/kvm/Config.uk
plat/kvm/Linker.uk
plat/kvm/Makefile.uk

index b028fba15729d8523d265fb47b668b1951e92866..8452edef2ef8a4b9fba60a0c2f7d9c2237438ba9 100644 (file)
@@ -12,6 +12,22 @@ menuconfig PLAT_KVM
 
 if (PLAT_KVM)
 
+if (ARCH_X86_64)
+
+config KVM_BOOT_PROTO_MULTIBOOT
+       bool
+
+choice
+       prompt "Hypervisor"
+       default KVM_HYPERVISOR_QEMU
+
+config KVM_HYPERVISOR_QEMU
+       bool "QEMU"
+       select KVM_BOOT_PROTO_MULTIBOOT
+
+endchoice
+endif
+
 menu "Console Options"
 
 config KVM_KERNEL_SERIAL_CONSOLE
@@ -85,7 +101,7 @@ config KVM_MAX_IRQ_HANDLER_ENTRIES
 config KVM_PCI
        bool "PCI Bus Driver"
        default y
-       depends on (ARCH_X86_64 || ARCH_ARM_64)
+       depends on (ARCH_X86_64 || ARCH_ARM_64) && KVM_HYPERVISOR_QEMU
        select LIBUKBUS
        help
                 PCI bus driver for probing and operating PCI devices
index 720e39ef85254deaaf2de6dcfaa9ea78c630ffe4..c1ddc84a3a36ceda68307f22616b5cbe8489e3f6 100644 (file)
@@ -1,7 +1,9 @@
 ifeq (x86_64,$(CONFIG_UK_ARCH))
+ifeq ($(CONFIG_KVM_BOOT_PROTO_MULTIBOOT),y)
 KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
 KVM_LDFLAGS-y += -Wl,--entry=_multiboot_entry
 KVM_STRIPFLAGS += --output-target elf32-i386
+endif
 else ifeq (arm64,$(CONFIG_UK_ARCH))
 KVM_LDFLAGS-y += -Wl,-m,aarch64elf
 KVM_LINK_LIBGCC_FLAG := -lgcc
index 8a132efd97967931a69bb326727a03ef5e19da64..120ba54f5135f8ca7ff616a260f837d7f23bce28 100644 (file)
@@ -60,8 +60,10 @@ LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/x86/acpi.c|commo
 endif
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/bootinfo.c|common
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(UK_PLAT_COMMON_BASE)/bootinfo.lds.S|common
+ifeq ($(CONFIG_KVM_BOOT_PROTO_MULTIBOOT),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/multiboot.S|x86
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/multiboot.c
+endif
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/pagetable64.S
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/traps.c
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/cpu_vectors_x86_64.S