diff mbox

kvm: Document KVM_IOEVENTFD

Message ID 1306581150-23155-1-git-send-email-levinsasha928@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sasha Levin May 28, 2011, 11:12 a.m. UTC
Document KVM_IOEVENTFD that can be used to receive
notifications of PIO/MMIO events without triggering
an exit.

Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

Comments

Jan Kiszka June 1, 2011, 10:51 a.m. UTC | #1
On 2011-05-31 15:44, Marcelo Tosatti wrote:
> On Sat, May 28, 2011 at 02:12:30PM +0300, Sasha Levin wrote:
>> Document KVM_IOEVENTFD that can be used to receive
>> notifications of PIO/MMIO events without triggering
>> an exit.
>>
>> Cc: Avi Kivity <avi@redhat.com>
>> Cc: Marcelo Tosatti <mtosatti@redhat.com>
>> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>> ---
>>  Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
>>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> Applied (with wording fix), thanks.

Requires section number fix-up (4.56 -> 4.58).

Jan
Avi Kivity June 2, 2011, 1:43 p.m. UTC | #2
On 06/01/2011 01:51 PM, Jan Kiszka wrote:
> On 2011-05-31 15:44, Marcelo Tosatti wrote:
> >  On Sat, May 28, 2011 at 02:12:30PM +0300, Sasha Levin wrote:
> >>  Document KVM_IOEVENTFD that can be used to receive
> >>  notifications of PIO/MMIO events without triggering
> >>  an exit.
> >>
> >>  Cc: Avi Kivity<avi@redhat.com>
> >>  Cc: Marcelo Tosatti<mtosatti@redhat.com>
> >>  Signed-off-by: Sasha Levin<levinsasha928@gmail.com>
> >>  ---
> >>   Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
> >>   1 files changed, 30 insertions(+), 0 deletions(-)
> >
> >  Applied (with wording fix), thanks.
>
> Requires section number fix-up (4.56 ->  4.58).

The usual fix is to cut a 5.0 release.
diff mbox

Patch

diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index 42542eb..80c5fcd 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -1291,6 +1291,36 @@  Returns the tsc frequency of the guest. The unit of the return value is
 KHz. If the host has unstable tsc this ioctl returns -EIO instead as an
 error.
 
+4.56 KVM_IOEVENTFD
+
+Capability: KVM_CAP_IOEVENTFD
+Architectures: all
+Type: vm ioctl
+Parameters: struct kvm_ioeventfd (in)
+Returns: 0 on success, !0 on error
+
+This ioctl attaches or deattaches an ioeventfd to a legal pio/mmio address
+within the guest.  A guest write in the registered address will signal the
+provided event instead of triggering an exit.
+
+struct kvm_ioeventfd {
+	__u64 datamatch;
+	__u64 addr;        /* legal pio/mmio address */
+	__u32 len;         /* 1, 2, 4, or 8 bytes    */
+	__s32 fd;
+	__u32 flags;
+	__u8  pad[36];
+};
+
+The following flags are defined:
+
+#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
+#define KVM_IOEVENTFD_FLAG_PIO       (1 << kvm_ioeventfd_flag_nr_pio)
+#define KVM_IOEVENTFD_FLAG_DEASSIGN  (1 << kvm_ioeventfd_flag_nr_deassign)
+
+If datamatch flag is set, the event will be signaled only if the written value
+to the registered address is equal to datamatch in struct kvm_ioeventfd. 
+
 5. The kvm_run structure
 
 Application code obtains a pointer to the kvm_run structure by