mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-13 13:56:19 +00:00
hv: Move the guest_sw_loader() call from vcpu to vm
guest software loading is per VM instead of vcpu. So we move it from prepare_vcpu to prepare_vm. And make sure it's called for all VMs for partition mode. Tracked-On: #1565 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
4f19b3b875
commit
85bec0d0d1
@ -598,14 +598,6 @@ int prepare_vcpu(struct vm *vm, uint16_t pcpu_id)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vm_sw_loader) {
|
|
||||||
vm_sw_loader = general_sw_loader;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_vm0(vm)) {
|
|
||||||
vm_sw_loader(vm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* init_vmcs is delayed to vcpu vmcs launch first time */
|
/* init_vmcs is delayed to vcpu vmcs launch first time */
|
||||||
/* initialize the vcpu tsc aux */
|
/* initialize the vcpu tsc aux */
|
||||||
vcpu->msr_tsc_aux_guest = vcpu->vcpu_id;
|
vcpu->msr_tsc_aux_guest = vcpu->vcpu_id;
|
||||||
|
@ -272,7 +272,7 @@ int reset_vm(struct vm *vm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_vm0(vm)) {
|
if (is_vm0(vm)) {
|
||||||
vm_sw_loader(vm);
|
(void )vm_sw_loader(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
vioapic_reset(vm_ioapic(vm));
|
vioapic_reset(vm_ioapic(vm));
|
||||||
@ -372,6 +372,12 @@ int prepare_vm(uint16_t pcpu_id)
|
|||||||
for (i = 1U; i < vm_desc->vm_hw_num_cores; i++)
|
for (i = 1U; i < vm_desc->vm_hw_num_cores; i++)
|
||||||
prepare_vcpu(vm, vm_desc->vm_pcpu_ids[i]);
|
prepare_vcpu(vm, vm_desc->vm_pcpu_ids[i]);
|
||||||
|
|
||||||
|
if (!vm_sw_loader) {
|
||||||
|
vm_sw_loader = general_sw_loader;
|
||||||
|
}
|
||||||
|
|
||||||
|
(void )vm_sw_loader(vm);
|
||||||
|
|
||||||
/* start vm BSP automatically */
|
/* start vm BSP automatically */
|
||||||
start_vm(vm);
|
start_vm(vm);
|
||||||
|
|
||||||
@ -407,6 +413,14 @@ int prepare_vm0(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!vm_sw_loader) {
|
||||||
|
vm_sw_loader = general_sw_loader;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_vm0(vm)) {
|
||||||
|
(void )vm_sw_loader(vm);
|
||||||
|
}
|
||||||
|
|
||||||
/* start vm0 BSP automatically */
|
/* start vm0 BSP automatically */
|
||||||
err = start_vm(vm);
|
err = start_vm(vm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user