Re: [PATCH v2] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-03 Thread Jinhao Fan
at 12:04 AM, Keith Busch wrote: > On Thu, Jun 30, 2022 at 11:22:31AM +0800, Jinhao Fan wrote: >> +static int nvme_init_sq_ioeventfd(NvmeSQueue *sq) >> +{ >> +NvmeCtrl *n = sq->ctrl; >> +uint16_t offset = sq->sqid << 3; >> +int ret; >> + >> +ret = event_notifier_init(&sq->notifier,

Re: [PATCH v2] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-01 Thread Keith Busch
On Thu, Jun 30, 2022 at 11:22:31AM +0800, Jinhao Fan wrote: > +static int nvme_init_sq_ioeventfd(NvmeSQueue *sq) > +{ > +NvmeCtrl *n = sq->ctrl; > +uint16_t offset = sq->sqid << 3; > +int ret; > + > +ret = event_notifier_init(&sq->notifier, 0); > +if (ret < 0) { > +retur

[PATCH v2] hw/nvme: Use ioeventfd to handle doorbell updates

2022-06-29 Thread Jinhao Fan
Add property "ioeventfd" which is enabled by default. When this is enabled, updates on the doorbell registers will cause KVM to signal an event to the QEMU main loop to handle the doorbell updates. Therefore, instead of letting the vcpu thread run both guest VM and IO emulation, we now use the main