mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
hv: support asyncio request
Current IO emulation is synchronous. The user VM need to wait for the completion of the the I/O request before return. But Virtio Spec introduces introduces asynchronous IO with a new register in MMIO/PIO space named NOTIFY, to be used for FE driver to notify BE driver, ACRN hypervisor can emulate this register by sending a notification to vCPU in Service VM side. This way, FE side can resume to work without waiting for the full completion of BE side response. Tracked-On: #8209 Signed-off-by: Conghui <conghui.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -69,6 +69,7 @@ struct vm_sw_info {
|
||||
struct sw_module_info acpi_info;
|
||||
/* HVA to IO shared page */
|
||||
void *io_shared_page;
|
||||
void *asyncio_sbuf;
|
||||
/* If enable IO completion polling mode */
|
||||
bool is_polling_ioreq;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ struct per_cpu_region {
|
||||
uint8_t vmxon_region[PAGE_SIZE];
|
||||
void *vmcs_run;
|
||||
#ifdef HV_DEBUG
|
||||
struct shared_buf *sbuf[ACRN_SBUF_ID_MAX];
|
||||
struct shared_buf *sbuf[ACRN_SBUF_PER_PCPU_ID_MAX];
|
||||
char logbuf[LOG_MESSAGE_MAX_SIZE];
|
||||
uint32_t npk_log_ref;
|
||||
#endif
|
||||
|
||||
@@ -291,6 +291,8 @@ void register_mmio_emulation_handler(struct acrn_vm *vm,
|
||||
void unregister_mmio_emulation_handler(struct acrn_vm *vm,
|
||||
uint64_t start, uint64_t end);
|
||||
void deinit_emul_io(struct acrn_vm *vm);
|
||||
|
||||
int init_asyncio(struct acrn_vm *vm, uint64_t *hva);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -746,7 +746,9 @@ enum {
|
||||
ACRN_HVLOG,
|
||||
ACRN_SEP,
|
||||
ACRN_SOCWATCH,
|
||||
ACRN_SBUF_ID_MAX,
|
||||
/* The sbuf with above ids are created each pcpu */
|
||||
ACRN_SBUF_PER_PCPU_ID_MAX,
|
||||
ACRN_ASYNCIO = 64,
|
||||
};
|
||||
|
||||
/* Make sure sizeof(struct shared_buf) == SBUF_HEAD_SIZE */
|
||||
|
||||
Reference in New Issue
Block a user