dm: add API to set vcpu regs of guest

Add ioctl parameter and API to set vcpu regs. The guest software
loader will call this API to set guest vcpu registers.

Tracked-On: #1231
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei
2018-09-26 11:13:33 +08:00
committed by wenlingz
parent 3cfbc004f5
commit 853b1c74cb
5 changed files with 84 additions and 0 deletions

View File

@@ -269,6 +269,8 @@ add_cpu(struct vmctx *ctx, int guest_ncpus)
mt_vmm_info[i].mt_vcpu = i;
}
vm_set_vcpu_regs(ctx, &ctx->bsp_regs);
error = pthread_create(&mt_vmm_info[0].mt_thr, NULL,
start_thread, &mt_vmm_info[0]);

View File

@@ -612,6 +612,12 @@ vm_create_vcpu(struct vmctx *ctx, uint16_t vcpu_id)
return error;
}
int
vm_set_vcpu_regs(struct vmctx *ctx, struct acrn_set_vcpu_regs *vcpu_regs)
{
return ioctl(ctx->fd, IC_SET_VCPU_REGS, vcpu_regs);
}
int
vm_get_device_fd(struct vmctx *ctx)
{