acrn-dm: implement cpu_affinity command line argument

User has a chance to specify VCPU affinity through acrn-dm command line
argument. Examples of the command line:

3 PCPUs: 1/2/3
--cpu_affinity 1-3

5 PCPUs: 2/3/6/7/8
--cpu_affinity 2,3,6-8

8 PCPUs: 2/3/6/7/9/10/11/12
--cpu_affinity 2,3,6-7,9,10-12

The specified pCPUs must be included in the guest VM's statically
defined vm_config[].cpu_affinity_bitmap.

Tracked-On: #4616
Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
Zide Chen
2020-01-21 14:53:21 -08:00
committed by wenlingz
parent 3691e305c0
commit 71bdc27a0f
3 changed files with 87 additions and 0 deletions

View File

@@ -134,6 +134,7 @@ int vm_set_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf,
int vm_reset_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf,
uint16_t phys_bdf, int virt_pin, bool pic_pin);
int acrn_parse_pcpu_list(char *arg);
int vm_create_vcpu(struct vmctx *ctx, uint16_t vcpu_id);
int vm_set_vcpu_regs(struct vmctx *ctx, struct acrn_set_vcpu_regs *cpu_regs);