mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
hv: use vcpu_affinity[] in vm_config to support vcpu assignment
Add this vcpu_affinity[] for each VM to indicate the assignment policy. With it, pcpu_bitmap is not needed, so remove it from vm_config. Instead, vcpu_affinity is a must for each VM. This patch also add some sanitize check of vcpu_affinity[]. Here are some rules: 1) only one bit can be set for each vcpu_affinity of vcpu. 2) two vcpus in same VM cannot be set with same vcpu_affinity. 3) vcpu_affinity cannot be set to the pcpu which used by pre-launched VM. v4: config SDC with CONFIG_MAX_KATA_VM_NUM v5: config SDC with CONFIG_MAX_PCPU_NUM Tracked-On: #3663 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Signed-off-by: Yu Wang <yu1.wang@intel.com> Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
ca2540fe8c
commit
1c526e6d16
@@ -47,6 +47,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
0x86U, 0x4eU, 0xcbU, 0x7aU, 0x18U, 0xb3U, 0x46U, 0x43U},
|
||||
/* d2795438-25d6-11e8-864e-cb7a18b34643 */
|
||||
.vcpu_num = 1U,
|
||||
.vcpu_affinity = VM1_CONFIG_VCPU_AFFINITY,
|
||||
.vuart[0] = {
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = INVALID_COM_BASE,
|
||||
@@ -63,6 +64,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
0xafU, 0x76U, 0xd4U, 0xbcU, 0x5aU, 0x8eU, 0xc0U, 0xe5U},
|
||||
/* 495ae2e5-2603-4d64-af76-d4bc5a8ec0e5 */
|
||||
.vcpu_num = 1U,
|
||||
.vcpu_affinity = VM2_CONFIG_VCPU_AFFINITY,
|
||||
.vuart[0] = {
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = INVALID_COM_BASE,
|
||||
@@ -79,6 +81,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
|
||||
0xb7U, 0x2aU, 0x8aU, 0x60U, 0x9eU, 0x41U, 0x90U, 0xd0U},
|
||||
/* 38158821-5208-4005-b72a-8a609e4190d0 */
|
||||
.vcpu_num = 1U,
|
||||
.vcpu_affinity = VM3_CONFIG_VCPU_AFFINITY,
|
||||
.vuart[0] = {
|
||||
.type = VUART_LEGACY_PIO,
|
||||
.addr.port_base = INVALID_COM_BASE,
|
||||
|
||||
Reference in New Issue
Block a user