]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm: Make Kconfig boot protocol option naming consistent
authorMichalis Pappas <michalis@unikraft.io>
Fri, 11 Aug 2023 14:08:58 +0000 (16:08 +0200)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 19:49:38 +0000 (19:49 +0000)
Rename the Kconfig options for QEMU virt and EFI stub to align them
with the rest of boot protocol options.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #988

plat/Config.uk
plat/kvm/Config.uk
plat/kvm/Linker.uk
plat/kvm/Makefile.uk
plat/kvm/efi.c
plat/kvm/shutdown.c

index f477e683418dc3fdd264ef8b3f3a8ddae7a24bb2..f3984aa52e0592cb596f7158e06c6a90c7804336 100644 (file)
@@ -15,7 +15,7 @@ config UKPLAT_MEMREGION_MAX_COUNT
                the amount of statically allocated space in the image made available
                for storing memory region descriptors' metadata.
 
-if ARCH_X86_64 || (KVM_BOOT_EFI_STUB && ARCH_ARM_64)
+if ARCH_X86_64 || (KVM_BOOT_PROTO_EFI_STUB && ARCH_ARM_64)
 
 config UKPLAT_ACPI
        bool "Enable parsing of ACPI structures"
index 7ac949a271be001ed51ff97e744d689fc709a294..337944068d1f2f5a949ebd3f7d009dc5be668cec 100644 (file)
@@ -29,13 +29,13 @@ config KVM_BOOT_PROTO_LXBOOT
        help
                Linux 64-bit Boot Protocol
 
-config KVM_BOOT_PROTOCOL_QEMU_VIRT
+config KVM_BOOT_PROTO_QEMU_VIRT
        bool "QEMU virt"
        depends on KVM_VMM_QEMU && !KVM_VMM_FIRECRACKER && ARCH_ARM_64
        help
                Default QEMU virt environment
 
-config KVM_BOOT_EFI_STUB
+config KVM_BOOT_PROTO_EFI_STUB
        bool "EFI stub"
        depends on KVM_VMM_QEMU && !KVM_VMM_FIRECRACKER
        depends on OPTIMIZE_PIE
@@ -47,25 +47,25 @@ comment "Hint: EFI stub depends on OPTIMIZE_PIE"
        depends on !OPTIMIZE_PIE && !KVM_VMM_FIRECRACKER
 endchoice
 
-if KVM_BOOT_EFI_STUB
+if KVM_BOOT_PROTO_EFI_STUB
 
-config KVM_BOOT_EFI_STUB_DEBUG
+config KVM_BOOT_PROTO_EFI_STUB_DEBUG
        bool "Enable EFI stub crash messages"
        default n
 
-config KVM_BOOT_EFI_STUB_CMDLINE_FNAME
+config KVM_BOOT_PROTO_EFI_STUB_CMDLINE_FNAME
        string "Name of the command line arguments file"
        default "$(UK_NAME).cmdl"
 
-config KVM_BOOT_EFI_STUB_INITRD_FNAME
+config KVM_BOOT_PROTO_EFI_STUB_INITRD_FNAME
        string "Name of the initial RAM disk file"
        default "$(UK_NAME).initrd"
 
-config KVM_BOOT_EFI_STUB_DTB_FNAME
+config KVM_BOOT_PROTO_EFI_STUB_DTB_FNAME
        string "Name of the Devicetree Blob file"
        default "$(UK_NAME).dtb"
 
-config KVM_BOOT_EFI_STUB_RST_ATK_MITIGATION
+config KVM_BOOT_PROTO_EFI_STUB_RST_ATK_MITIGATION
        bool "TCG Reset Attack Mitigation"
        default n
        help
index b2c5196b874cd12619e0174c72cb9763ef2336b6..fa58cab638762d4067882c7f1c79487fdea77132 100644 (file)
@@ -5,7 +5,7 @@ KVM_LDFLAGS-y += -Wl,--entry=_multiboot_entry
 ELF64_TO_32 = y
 else ifeq ($(CONFIG_KVM_BOOT_PROTO_LXBOOT),y)
 KVM_LDFLAGS-y += -Wl,--entry=_lxboot_entry
-else ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+else ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 KVM_LDFLAGS-y += -Wl,--entry=uk_efi_entry64
 KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
 endif
@@ -14,7 +14,7 @@ ifeq ($(CONFIG_KVM_BOOT_PROTOCOL_QEMU_VIRT),y)
 KVM_LDFLAGS-y += -Wl,--entry=_libkvmplat_entry
 KVM_LDFLAGS-y += -Wl,-m,aarch64elf
 KVM_LINK_LIBGCC_FLAG := -lgcc
-else ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+else ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 KVM_LDFLAGS-y += -Wl,--entry=uk_efi_entry64
 KVM_LDFLAGS-y += -Wl,-m,aarch64elf
 KVM_LINK_LIBGCC_FLAG := -lgcc
@@ -74,7 +74,7 @@ $(KVM_IMAGE): $(KVM_IMAGE).dbg
 ifeq ($(ELF64_TO_32),y)
        $(call build_elf64_to_32,$@)
 endif
-ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
        $(call build_efi,$@)
 endif
 
index 55a00779e5bafd55c2d4a9d9dcec3a577c482bbb..9048d0a156b29176bff5c9f38832c1248d4fe13d 100644 (file)
@@ -61,7 +61,7 @@ LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/multiboot.c
 else ifeq ($(CONFIG_KVM_BOOT_PROTO_LXBOOT),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/lxboot.S|x86
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/lxboot.c
-else ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+else ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/efi_entry64.S|x86
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/efi_post.c
 endif
@@ -111,7 +111,7 @@ ifeq ($(CONFIG_HAVE_SMP),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/arm/lcpu_start.S
 endif
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(LIBKVMPLAT_BASE)/arm/bpt64.S|arm
-ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(LIBKVMPLAT_BASE)/arm/efi_post.c
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(LIBKVMPLAT_BASE)/arm/efi_entry64.S|arm
 else
@@ -131,7 +131,7 @@ LIBKVMPLAT_SRCS-y                          += $(UK_PLAT_COMMON_BASE)/lcpu.c|comm
 LIBKVMPLAT_SRCS-y                          += $(UK_PLAT_COMMON_BASE)/memory.c|common
 LIBKVMPLAT_SRCS-y                          += $(UK_PLAT_KVM_DEF_LDS)
 LIBKVMPLAT_SRCS-$(CONFIG_UKPLAT_ACPI)      += $(UK_PLAT_COMMON_BASE)/acpi.c|common
-ifeq ($(CONFIG_KVM_BOOT_EFI_STUB),y)
+ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 LIBKVMPLAT_SRCS-y                          += $(LIBKVMPLAT_BASE)/efi.c|common
 endif
 
index a58f126248050f3874ff6c2e76be77a4c7560525..b6ec443829ade849829891d794b2dd784a115d41 100644 (file)
@@ -23,6 +23,10 @@ static __u8 uk_efi_mat_present;
 #define UK_EFI_ABS_FNAME(f)                                    "\\EFI\\BOOT\\"f
 #define UK_EFI_SURPLUS_MEM_DESC_COUNT                          10
 
+#define EFI_STUB_CMDLINE_FNAME CONFIG_KVM_BOOT_PROTO_EFI_STUB_CMDLINE_FNAME
+#define EFI_STUB_INITRD_FNAME  CONFIG_KVM_BOOT_PROTO_EFI_STUB_INITRD_FNAME
+#define EFI_STUB_DTB_FNAME     CONFIG_KVM_BOOT_PROTO_EFI_STUB_DTB_FNAME
+
 void uk_efi_jmp_to_kern(void) __noreturn;
 
 /* Overlysimplified conversion from ASCII to UTF-16 */
@@ -70,7 +74,7 @@ static void _uk_efi_crash(void)
                                sizeof(reset_data), (void *)reset_data);
 }
 
-#ifdef CONFIG_KVM_BOOT_EFI_STUB_DEBUG
+#ifdef CONFIG_KVM_BOOT_PROTO_EFI_STUB_DEBUG
 #define UK_EFI_MAX_CRASH_STR_LEN                               256
 /* UEFI for proper \n, we must also use CRLF */
 #define uk_efi_crash(str)                                              \
@@ -444,7 +448,8 @@ static void uk_efi_setup_bootinfo_cmdl(struct ukplat_bootinfo *bi)
        /* We can either have the command line provided by the user when this
         * very specific instance of the image was launched, in which case this
         * one takes priority, or we can have it provided through
-        * CONFIG_KVM_BOOT_EFI_STUB_CMDLINE_PATH as a path on the same device.
+        * CONFIG_KVM_BOOT_PROTO_EFI_STUB_CMDLINE_PATH as a path on the same
+        * device.
         */
        if (uk_img_hndl->load_options && uk_img_hndl->load_options_size) {
                len = (uk_img_hndl->load_options_size >> 1) + 1;
@@ -460,9 +465,9 @@ static void uk_efi_setup_bootinfo_cmdl(struct ukplat_bootinfo *bi)
                if (unlikely(len == __SZ_MAX))
                        uk_efi_crash("Conversion from UTF-16 to ASCII of cmdl "
                                     "overflowed. This shouldn't be possible\n");
-       } else if (sizeof(CONFIG_KVM_BOOT_EFI_STUB_CMDLINE_FNAME) > 1) {
+       } else if (sizeof(EFI_STUB_CMDLINE_FNAME) > 1) {
                uk_efi_read_file(uk_img_hndl->device_handle,
-                                UK_EFI_ABS_FNAME(CONFIG_KVM_BOOT_EFI_STUB_CMDLINE_FNAME),
+                                UK_EFI_ABS_FNAME(EFI_STUB_CMDLINE_FNAME),
                                 (char **)&cmdl, &len);
        }
 
@@ -490,13 +495,13 @@ static void uk_efi_setup_bootinfo_initrd(struct ukplat_bootinfo *bi)
        __sz len;
        int rc;
 
-       if (sizeof(CONFIG_KVM_BOOT_EFI_STUB_INITRD_FNAME) <= 1)
+       if (sizeof(EFI_STUB_INITRD_FNAME) <= 1)
                return;
 
        uk_img_hndl = uk_efi_get_uk_img_hndl();
 
        uk_efi_read_file(uk_img_hndl->device_handle,
-                        UK_EFI_ABS_FNAME(CONFIG_KVM_BOOT_EFI_STUB_INITRD_FNAME),
+                        UK_EFI_ABS_FNAME(EFI_STUB_INITRD_FNAME),
                         (char **)&initrd, &len);
 
        mrd.pbase = (__paddr_t)initrd;
@@ -517,13 +522,13 @@ static void uk_efi_setup_bootinfo_dtb(struct ukplat_bootinfo *bi)
        __sz len;
        int rc;
 
-       if (sizeof(CONFIG_KVM_BOOT_EFI_STUB_DTB_FNAME) <= 1)
+       if (sizeof(EFI_STUB_DTB_FNAME) <= 1)
                return;
 
        uk_img_hndl = uk_efi_get_uk_img_hndl();
 
        uk_efi_read_file(uk_img_hndl->device_handle,
-                        UK_EFI_ABS_FNAME(CONFIG_KVM_BOOT_EFI_STUB_DTB_FNAME),
+                        UK_EFI_ABS_FNAME(EFI_STUB_DTB_FNAME),
                         (char **)&dtb, &len);
 
        mrd.pbase = (__paddr_t)dtb;
@@ -572,7 +577,7 @@ static void uk_efi_exit_bs(void)
  */
 static void uk_efi_reset_attack_mitigation_enable(void)
 {
-#ifdef CONFIG_KVM_BOOT_EFI_STUB_RST_ATK_MITIGATION
+#ifdef CONFIG_KVM_BOOT_PROTO_EFI_STUB_RST_ATK_MITIGATION
        /* The UTF-16 encoding of the "MemoryOverwriteRequestControl" string */
        char var_name[] = "M\0e\0m\0o\0r\0y\0O\0v\0e\0r\0w\0r\0i\0t\0e\0R\0e"
                          "\0q\0u\0e\0s\0t\0C\0o\0n\0t\0r\0o\0l\0";
index 1f677674c37a8b971432ef0594368f64c6f433c5..a4f7a972528e7135101b27066617e59f5cbe7825 100644 (file)
@@ -31,7 +31,7 @@
 
 static void cpu_halt(void) __noreturn;
 
-#ifdef CONFIG_KVM_BOOT_EFI_STUB
+#ifdef CONFIG_KVM_BOOT_PROTO_EFI_STUB
 static void uk_efi_rs_reset_system(enum uk_efi_reset_type reset_type)
 {
        const char reset_data[] = "UK EFI SYSTEM RESET";