From d4e56e84f2cdc68aa3c3fa30f43ed54d63681131 Mon Sep 17 00:00:00 2001 From: Yifan Liu Date: Thu, 30 Oct 2025 08:27:57 +0000 Subject: [PATCH] hv: seed: Conditionally expose seed module in vboot We may not need this for every architecture. Conditionally wraps it. Tracked-On: #8830 Signed-off-by: Yifan Liu Acked-by: Wang Yu1 --- hypervisor/boot/guest/vboot_info.c | 9 ++++++++- hypervisor/include/arch/x86/asm/guest/vm.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hypervisor/boot/guest/vboot_info.c b/hypervisor/boot/guest/vboot_info.c index 635c80379..f833d1122 100644 --- a/hypervisor/boot/guest/vboot_info.c +++ b/hypervisor/boot/guest/vboot_info.c @@ -11,13 +11,15 @@ #include #include #include -#include #include #include #include #include #include #include +#ifdef ARCH_VBOOT_SEED_SUPPORT +#include +#endif #define DBG_LEVEL_BOOT 6U @@ -89,6 +91,10 @@ static void init_vm_bootargs_info(struct acrn_vm *vm, const struct acrn_boot_inf if (vm_config->load_order == SERVICE_VM) { if (strncat_s((char *)vm->sw.bootargs_info.src_addr, MAX_BOOTARGS_SIZE, " ", 1U) == 0) { +/* TODO: For now the seed module is used only in x86. + * we may need a cleanup later. + */ +#ifdef ARCH_VBOOT_SEED_SUPPORT char seed_args[MAX_SEED_ARG_SIZE] = ""; fill_seed_arg(seed_args, MAX_SEED_ARG_SIZE); @@ -99,6 +105,7 @@ static void init_vm_bootargs_info(struct acrn_vm *vm, const struct acrn_boot_inf seed_args, (MAX_BOOTARGS_SIZE - 1U)) != 0) { pr_err("failed to fill seed arg to Service VM bootargs!"); } +#endif /* If there is cmdline from abi->cmdline, merge it with configured Service VM bootargs. * This is very helpful when one of configured bootargs need to be revised at GRUB runtime diff --git a/hypervisor/include/arch/x86/asm/guest/vm.h b/hypervisor/include/arch/x86/asm/guest/vm.h index b2bb12a92..3cb596d72 100644 --- a/hypervisor/include/arch/x86/asm/guest/vm.h +++ b/hypervisor/include/arch/x86/asm/guest/vm.h @@ -34,6 +34,8 @@ #include #endif +#define ARCH_VBOOT_SEED_SUPPORT + enum reset_mode { POWER_ON_RESET, /* reset by hardware Power-on */ COLD_RESET, /* hardware cold reset */