mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
HV: load host pm S state data while create vm0
The pm S state data is from host ACPI info and needed for S3/S5 implementation. Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -103,3 +103,21 @@ void vm_setup_cpu_state(struct vm *vm)
|
||||
vm_setup_cpu_cx(vm);
|
||||
init_cx_port(vm);
|
||||
}
|
||||
|
||||
/* This function is for power management Sx state implementation,
|
||||
* VM need to load the Sx state data to implement S3/S5.
|
||||
*/
|
||||
int vm_load_pm_s_state(struct vm *vm)
|
||||
{
|
||||
if ((boot_cpu_data.x86 == host_acpi_info.x86_family)
|
||||
&& (boot_cpu_data.x86_model == host_acpi_info.x86_model)) {
|
||||
vm->pm.sx_state_data = (struct pm_s_state_data *)
|
||||
&host_acpi_info.pm_s_state;
|
||||
pr_info("System S3/S5 is supported.");
|
||||
return 0;
|
||||
} else {
|
||||
vm->pm.sx_state_data = NULL;
|
||||
pr_err("System S3/S5 is NOT supported.");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@@ -141,10 +141,13 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
|
||||
|
||||
vm_setup_cpu_state(vm);
|
||||
|
||||
/* Create virtual uart */
|
||||
if (is_vm0(vm))
|
||||
vm->vuart = vuart_init(vm);
|
||||
if (is_vm0(vm)) {
|
||||
/* Load pm S state data */
|
||||
vm_load_pm_s_state(vm);
|
||||
|
||||
/* Create virtual uart */
|
||||
vm->vuart = vuart_init(vm);
|
||||
}
|
||||
vm->vpic = vpic_init(vm);
|
||||
|
||||
/* vpic wire_mode default is INTR */
|
||||
|
Reference in New Issue
Block a user