mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 09:06:30 +00:00
Add a API to sanitize vm_configs[] array, in this API, we will do sanity check for VM configurations and refill some fields in vm_configs[]. If sanity check is failed, the HV would reject to boot. About pcpu_bitmap of SOS_VM: We should not hard code pcpu_bitmap for SOS_VM, this is not convenient for unconfigured boards. The pcpu_bitmap follows a very simple rule: All physical CPUs except ocuppied by Pre-launched VMs are all belong to SOS_VM. In this way, the pcpu_bitmap of a SOS_VM is decided by pcpu_bitmap status in PRE_LAUNCHED_VMs. To get the correct pcpu_bitmap of SOS_VM, We need to setup another rule, that the vm_configs[] array should follow the order of PRE_LAUNCHED_VM - SOS_VM strictly. With this patch enabled, the pcpu_bitmap field of sos vm config is not needed to configure; Tracked-On: #2291 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
24 lines
471 B
C
24 lines
471 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <hypervisor.h>
|
|
#include <sos_vm.h>
|
|
|
|
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] __aligned(PAGE_SIZE) = {
|
|
{
|
|
.type = SOS_VM,
|
|
.name = SOS_VM_CONFIG_NAME,
|
|
.guest_flags = SOS_VM_CONFIG_GUEST_FLAGS,
|
|
.memory = {
|
|
.start_hpa = 0x0UL,
|
|
.size = SOS_VM_CONFIG_MEM_SIZE,
|
|
},
|
|
.os_config = {
|
|
.name = SOS_VM_CONFIG_OS_NAME,
|
|
},
|
|
},
|
|
};
|