From 1b334ec08ffa4f0b3c803df53752979f09b23194 Mon Sep 17 00:00:00 2001 From: Mingqiang Chi Date: Wed, 5 Sep 2018 15:22:04 +0800 Subject: [PATCH] hv: replace 'return' with 'panic' in bsp_boot_post If hardware_detect_support() failed,as it return to bsp_boot_init with a different stack and thus returning from bsp_boot_init becomes an undefined behavior. Tracked-On: #861 Signed-off-by: Mingqiang Chi Reviewed-by: Junjie Mao Acked-by: Eddie Dong --- hypervisor/arch/x86/cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index 7a4a2844d..1adc2c9dd 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -461,8 +461,7 @@ static void bsp_boot_post(void) pr_dbg("Core %hu is up", BOOT_CPU_ID); if (hardware_detect_support() != 0) { - pr_fatal("hardware not support!\n"); - return; + panic("hardware not support!"); } /* Warn for security feature not ready */