asyncio: refine the setup ioctl

Remove the common interface for sbuf setup, as it is not accept by
kernel side. Instead, use dedicate setup function for asyncio to init
its sbuf.

Tracked-On: #8209
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Conghui
2022-11-24 13:28:23 +08:00
committed by acrnsi-robot
parent 23b36bae45
commit a715a3222b
4 changed files with 8 additions and 21 deletions

View File

@@ -852,7 +852,7 @@ vm_init_asyncio(struct vmctx *ctx, uint64_t base)
sbuf->overrun_cnt = 0;
sbuf->head = 0;
sbuf->tail = 0;
return vm_setup_sbuf(ctx, ACRN_ASYNCIO, base);
return vm_setup_asyncio(ctx, base);
}
int

View File

@@ -295,19 +295,14 @@ vm_destroy(struct vmctx *ctx)
}
int
vm_setup_sbuf(struct vmctx *ctx, uint32_t sbuf_id, uint64_t base)
vm_setup_asyncio(struct vmctx *ctx, uint64_t base)
{
int error;
struct acrn_sbuf sbuf_param;
bzero(&sbuf_param, sizeof(sbuf_param));
sbuf_param.sbuf_id = sbuf_id;
sbuf_param.base = base;
error = ioctl(ctx->fd, ACRN_IOCTL_SETUP_SBUF, &sbuf_param);
error = ioctl(ctx->fd, ACRN_IOCTL_SETUP_ASYNCIO, base);
if (error) {
pr_err("ACRN_IOCTL_SBUF_PAGE ioctl() returned an error: %s\n", errormsg(errno));
pr_err("ACRN_IOCTL_SETUP_ASYNCIO ioctl() returned an error: %s\n", errormsg(errno));
}
return error;