mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 16:15:00 +00:00
hv: move panic out of hv_main
We cleanup ASSERT. This serial try to only panic when create SOS failed. Signed-off-by: Li, Fei1 <fei1.li@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
@@ -138,18 +138,28 @@ static bool is_vm0_bsp(int pcpu_id)
|
||||
|
||||
int hv_main(int cpu_id)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret;
|
||||
|
||||
pr_info("%s, Starting common entry point for CPU %d",
|
||||
__func__, cpu_id);
|
||||
ASSERT(cpu_id < phy_cpu_num, "cpu_id out of range");
|
||||
|
||||
ASSERT((uint64_t) cpu_id == get_cpu_id(),
|
||||
"cpu_id/tsc_aux mismatch");
|
||||
if (cpu_id >= phy_cpu_num) {
|
||||
pr_err("%s, cpu_id %d out of range %d\n",
|
||||
__func__, cpu_id, phy_cpu_num);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((uint32_t) cpu_id != get_cpu_id()) {
|
||||
pr_err("%s, cpu_id %d mismatch\n", __func__, cpu_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Enable virtualization extensions */
|
||||
ret = exec_vmxon_instr();
|
||||
ASSERT(ret == 0, "Unable to enable VMX!");
|
||||
if (ret != 0) {
|
||||
pr_err("%s, Unable to enable VMX!\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* X2APIC mode is disabled by default. */
|
||||
x2apic_enabled = false;
|
||||
@@ -159,7 +169,7 @@ int hv_main(int cpu_id)
|
||||
|
||||
default_idle();
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_vmexit_profile(char *str, int str_max)
|
||||
|
||||
Reference in New Issue
Block a user