From: Stefan Hajnoczi <stefanha@redhat.com>
To: seanjc@google.com, pbonzini@redhat.com
Cc: John Levon <john.levon@nutanix.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Thanos Makatos <thanos.makatos@nutanix.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] KVM: optionally post write on ioeventfd write
Date: Tue, 22 Sep 2026 09:51:02 -0400 [thread overview]
Message-ID: <20260922135102.GA24134@fedora> (raw)
In-Reply-To: <20260306125651.2485-1-thanos.makatos@nutanix.com>
[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]
On Fri, Mar 06, 2026 at 12:56:54PM +0000, Thanos Makatos wrote:
> Add a new flag, KVM_IOEVENTFD_FLAG_POST_WRITE, when assigning an
> ioeventfd that results in the value written by the guest to be copied
> to user-supplied memory instead of being discarded.
>
> The goal of this new mechanism is to speed up doorbell writes on NVMe
> controllers emulated outside of the VMM. Currently, a doorbell write to
> an NVMe SQ tail doorbell requires returning from ioctl(KVM_RUN) and the
> VMM communicating the event, along with the doorbell value, to the NVMe
> controller emulation task. With POST_WRITE, the NVMe emulation task is
> directly notified of the doorbell write and can find the doorbell value
> in a known location, without involving VMM.
>
> Add tests for this new functionality.
>
> LLM (claude-4.6-opus-high) was used mainly for the tests and to a
> lesser extent for pre-reviewing this patch.
>
> Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
> ---
> Documentation/virt/kvm/api.rst | 13 +-
> include/uapi/linux/kvm.h | 6 +-
> tools/testing/selftests/kvm/Makefile.kvm | 1 +
> tools/testing/selftests/kvm/ioeventfd_test.c | 624 +++++++++++++++++++
> virt/kvm/eventfd.c | 23 +
> virt/kvm/kvm_main.c | 1 +
> 6 files changed, 666 insertions(+), 2 deletions(-)
> create mode 100644 tools/testing/selftests/kvm/ioeventfd_test.c
Sean, Paolo: Ping
I would like to enable ioeventfd support in QEMU's NVMe device emulation
and this requires POST_WRITE for Windows guests (they don't support
NVMe's Doorbell Buffer Config feature so it's necessary to capture the
latest value written to the doorbell somehow).
POST_WRITE applies to any device that has a doorbell register where the
latest value needs to be captured. This looks like a reasonable
extension to ioeventfd.
I also looked into alternatives, like using userfaultfd, and didn't find
anything better.
Please consider merging this. Thanks!
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-09-22 13:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 12:56 [PATCH] KVM: optionally post write on ioeventfd write Thanos Makatos
2026-03-12 15:02 ` David Woodhouse
2026-03-12 16:12 ` Thanos Makatos
2026-04-21 14:44 ` Sean Christopherson
2026-09-19 15:59 ` David Woodhouse
2026-03-23 15:01 ` Thanos Makatos
2026-04-10 19:11 ` Thanos Makatos
2026-04-21 14:45 ` Sean Christopherson
2026-06-10 7:31 ` John Levon
2026-09-22 13:51 ` Stefan Hajnoczi [this message]
2026-09-22 15:28 ` David Woodhouse
2026-09-22 16:47 ` Sean Christopherson
2026-10-04 16:16 ` David Woodhouse
2026-10-05 5:11 ` Sean Christopherson
2026-09-22 17:03 ` Sean Christopherson
-- strict thread matches above, loose matches on Subject: below --
2026-01-13 20:00 [RFC PATCH] KVM: optionally commit " Sean Christopherson
2026-03-02 12:28 ` [PATCH] KVM: optionally post " Thanos Makatos
2026-03-05 1:26 ` Sean Christopherson
2026-03-06 11:14 ` Thanos Makatos
2026-03-05 1:49 ` kernel test robot
2026-03-05 9:39 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260922135102.GA24134@fedora \
--to=stefanha@redhat.com \
--cc=dwmw2@infradead.org \
--cc=john.levon@nutanix.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=thanos.makatos@nutanix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.