vm: add severity for vm_config

Add severity definitions for different scenarios. The static
guest severity is defined according to guest configurations.

Also add sanity check to make sure the severity for all guests
are correct.

Tracked-On: #4270
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Yin Fengwei
2019-12-16 13:31:01 +08:00
committed by wenlingz
parent f7df43e7cd
commit e5117bf19a
6 changed files with 81 additions and 12 deletions

View File

@@ -24,6 +24,12 @@
#define PCI_DEV_TYPE_HVEMUL (1U << 1U)
#define PCI_DEV_TYPE_SOSEMUL (1U << 2U)
#define RTVM_UUID1 {0x49U, 0x5aU, 0xe2U, 0xe5U, 0x26U, 0x03U, 0x4dU, 0x64U, \
0xafU, 0x76U, 0xd4U, 0xbcU, 0x5aU, 0x8eU, 0xc0U, 0xe5U}
#define SAFETY_VM_UUID1 {0xfcU, 0x83U, 0x69U, 0x01U, 0x86U, 0x85U, 0x4bU, 0xc0U, \
0x8bU, 0x71U, 0x6eU, 0x31U, 0xdcU, 0x36U, 0xfaU, 0x47U}
/*
* PRE_LAUNCHED_VM is launched by ACRN hypervisor, with LAPIC_PT;
* SOS_VM is launched by ACRN hypervisor, without LAPIC_PT;
@@ -35,6 +41,14 @@ enum acrn_vm_load_order {
POST_LAUNCHED_VM /* Launched by Devicemodel in SOS_VM */
};
/* ACRN guest severity */
enum acrn_vm_severity {
SEVERITY_SAFETY_VM = 0x40U,
SEVERITY_RTVM = 0x30U,
SEVERITY_SOS = 0x20U,
SEVERITY_STANDARD_VM = 0x10U,
};
struct acrn_vm_mem_config {
uint64_t start_hpa; /* the start HPA of VM memory configuration, for pre-launched VMs only */
uint64_t size; /* VM memory size configuration */
@@ -99,6 +113,7 @@ struct acrn_vm_config {
char name[MAX_VM_OS_NAME_LEN]; /* VM name identifier, useful for debug. */
const uint8_t uuid[16]; /* UUID of the VM */
uint16_t vcpu_num; /* Number of vCPUs for the VM */
uint8_t severity; /* severity of the VM */
uint64_t vcpu_affinity[MAX_VCPUS_PER_VM];/* bitmaps for vCPUs' affinity */
uint64_t guest_flags; /* VM flags that we want to configure for guest