vm: allocated all pcpus to vm0 at the beginning

allocated all pcpus to vm0 to handle possible AP wakeup flow for all cpus,
as we pass org ACPI table to VM0 - that means VM0 can see all CPUs.

SOS(VM0) start expected CPUs through "maxcpus=" kernel cmdline option.

During first hypercall from SOS, calling vm_fixup to free un-expect-enabled
vcpus from VM0.

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ
2018-05-15 10:57:24 +08:00
committed by lijinxia
parent d2a7a9c91d
commit a6ff3a9bdc
3 changed files with 62 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ struct vm_attr {
struct vm_hw_info {
int num_vcpus; /* Number of total virtual cores */
int exp_num_vcpus; /* Number of real expected virtual cores */
uint32_t created_vcpus; /* Number of created vcpus */
struct vcpu **vcpu_array; /* vcpu array of this VM */
uint64_t gpa_lowtop; /* top lowmem gpa of this VM */
@@ -218,6 +219,7 @@ int pause_vm(struct vm *vm);
int start_vm(struct vm *vm);
int create_vm(struct vm_description *vm_desc, struct vm **vm);
int prepare_vm0(void);
void vm_fixup(struct vm *vm);
struct vm *get_vm_from_vmid(int vm_id);
struct vm_description *get_vm_desc(int idx);