mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: add GUEST_FLAG_STATELESS flag
GUEST_FLAG_STATELESS indicates guest is running a stateless operating system and need to be shutdown forcefully without data loss. This flag is only appalicable to pre-launched VM. For TEE_VM, this flag will be set implicitly. Tracked-On: #8671 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
c4ea248bc9
commit
2dc56a8f23
@@ -177,10 +177,8 @@ bool is_stateful_vm(const struct acrn_vm *vm)
|
||||
{
|
||||
struct acrn_vm_config *vm_config = get_vm_config(vm->vm_id);
|
||||
|
||||
/* TEE VM doesn't has its own state. The TAs will do the content
|
||||
* flush by themselves, HV and OS doesn't need to care about the state.
|
||||
*/
|
||||
return ((vm_config->guest_flags & GUEST_FLAG_TEE) == 0U);
|
||||
/* TEE VM has GUEST_FLAG_STATELESS set implicitly */
|
||||
return ((vm_config->guest_flags & GUEST_FLAG_STATELESS) == 0U);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -65,6 +65,7 @@
|
||||
#define GUEST_FLAG_PMU_PASSTHROUGH (1UL << 11U) /* Whether PMU is passed through */
|
||||
#define GUEST_FLAG_VHWP (1UL << 12U) /* Whether the VM supports vHWP */
|
||||
#define GUEST_FLAG_VTM (1UL << 13U) /* Whether the VM supports virtual thermal monitor */
|
||||
#define GUEST_FLAG_STATELESS (1UL << 14U) /* Whether the VM is stateless (can be forcefully shutdown with no data loss) */
|
||||
|
||||
/* TODO: We may need to get this addr from guest ACPI instead of hardcode here */
|
||||
#define VIRTUAL_SLEEP_CTL_ADDR 0x400U /* Pre-launched VM uses ACPI reduced HW mode and sleep control register */
|
||||
|
Reference in New Issue
Block a user