mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-28 03:56:14 +00:00
HV: add cpu affinity info for SOS VM
Previously the CPU affinity of SOS VM is initialized at runtime during sanitize_vm_config() stage, follow the policy that all physical CPUs except ocuppied by Pre-launched VMs are all belong to SOS_VM. Now change the process that SOS CPU affinity should be initialized at build time and has the assumption that its validity is guarenteed before runtime. Tracked-On: #5077 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -45,6 +45,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
|
||||
/* Allow SOS to reboot the host since there is supposed to be the highest severity guest */
|
||||
.guest_flags = 0UL,
|
||||
.cpu_affinity = SOS_VM_CONFIG_CPU_AFFINITY,
|
||||
.memory = {
|
||||
.start_hpa = 0UL,
|
||||
.size = CONFIG_SOS_RAM_SIZE,
|
||||
|
@@ -34,6 +34,8 @@
|
||||
SOS_IDLE \
|
||||
SOS_BOOTARGS_DIFF
|
||||
|
||||
#define SOS_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U))
|
||||
|
||||
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
|
||||
|
||||
#endif /* VM_CONFIGURATIONS_H */
|
||||
|
@@ -58,6 +58,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
|
||||
/* Allow SOS to reboot the host since there is supposed to be the highest severity guest */
|
||||
.guest_flags = 0UL,
|
||||
.cpu_affinity = SOS_VM_CONFIG_CPU_AFFINITY,
|
||||
.memory = {
|
||||
.start_hpa = 0UL,
|
||||
.size = CONFIG_SOS_RAM_SIZE,
|
||||
|
@@ -34,6 +34,8 @@
|
||||
SOS_IDLE \
|
||||
SOS_BOOTARGS_DIFF
|
||||
|
||||
#define SOS_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
|
||||
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(1U))
|
||||
|
||||
#endif /* VM_CONFIGURATIONS_H */
|
||||
|
@@ -14,6 +14,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
|
||||
/* Allow SOS to reboot the host since there is supposed to be the highest severity guest */
|
||||
.guest_flags = 0UL,
|
||||
.cpu_affinity = SOS_VM_CONFIG_CPU_AFFINITY,
|
||||
.memory = {
|
||||
.start_hpa = 0UL,
|
||||
.size = CONFIG_SOS_RAM_SIZE,
|
||||
|
@@ -27,6 +27,8 @@
|
||||
SOS_IDLE \
|
||||
SOS_BOOTARGS_DIFF
|
||||
|
||||
#define SOS_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U) | AFFINITY_CPU(3U))
|
||||
|
||||
#define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U) | AFFINITY_CPU(3U))
|
||||
#define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
|
||||
|
Reference in New Issue
Block a user