Skip to contentSkip to conversation

kvm: Document KVM_IOEVENTFD

PATCH Applied Sasha Levin 6 participants 7 messages May 28, 2011 – Jun 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: Document KVM_IOEVENTFD

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Cc Avi Kivity <[email protected]>
Cc Marcelo Tosatti <[email protected]>
---
 Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
Documentation/virtual/kvm/api.txt +30 -0
index 42542eb..80c5fcd 100644
@@ -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
Signature · 1 line
1.7.5.rc3
#1 lore raw
Quoted 18 lines · On Sat, 28 May 2011 14:12:30 +0300 Sasha Levin <[email protected]> wrote:

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Cc Avi Kivity <[email protected]>
Cc Marcelo Tosatti <[email protected]>
---
 Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
Documentation/virtual/kvm/api.txt +0 -0
index 42542eb..80c5fcd 100644
@@ -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.

Documentation/virtual/kvm/api.txt Returns the tsc frequency of the guest. The unit of the return value is · line 1302

Quoted 10 lines
Documentation/virtual/kvm/api.txt +9 -0
 
+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

Typo: attach -- detach (probably, I'm not a native)

Thanks,
Takuya

Quoted 31 lines
Documentation/virtual/kvm/api.txt +21 -0
+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
Signature · 6 lines
1.7.5.rc3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Takuya Yoshikawa <[email protected]>
#3 lore raw
Quoted 5 lines · Marcelo Tosatti
Quoted 4 lines · Sasha Levin

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Quoted 8 lines
Quoted 6 lines
Cc Avi Kivity <[email protected]>
Cc Marcelo Tosatti <[email protected]>
---
 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

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Marcelo Tosatti
Quoted 10 lines · Sasha Levin

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Cc Avi Kivity<[email protected]>
Cc Marcelo Tosatti<[email protected]>

---

  Documentation/virtual/kvm/api.txt |   30 ++++++++++++++++++++++++++++++
  1 files changed, 30 insertions(+), 0 deletions(-)
Quoted 3 lines
Quoted 1 line

Applied (with wording fix), thanks.

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

The usual fix is to cut a 5.0 release.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Jan Kiszka
Quoted 10 lines · Marcelo Tosatti
Quoted 9 lines · Sasha Levin

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Cc Avi Kivity<[email protected]>
Cc Marcelo Tosatti<[email protected]>

---

  Documentation/virtual/kvm/api.txt |   30
Quoted 8 lines
Quoted 6 lines

++++++++++++++++++++++++++++++

Quoted 3 lines
Quoted 1 line
  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.

Too bad that we already have one ("5. The kvm_run structure"). :)

Jan

------8<------

From: Jan Kiszka <[email protected]>

KVM: Fixup documentation section numbering

---
 Documentation/virtual/kvm/api.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/virtual/kvm/api.txt +1 -1
index 3755a39..2bd06b0 100644
@@ -1323,7 +1323,7 @@ struct kvm_lapic_state {
 Copies the input argument into the the Local APIC registers.  The data format
 and layout are the same as documented in the architecture manual.
 
-4.56 KVM_IOEVENTFD
+4.58 KVM_IOEVENTFD
 
 Capability: KVM_CAP_IOEVENTFD
 Architectures: all
Signature · 1 line
1.7.1
#6 lore raw
Quoted 26 lines · Jan Kiszka
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Jan Kiszka
Quoted 10 lines · Marcelo Tosatti
Quoted 9 lines · Sasha Levin

Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit.

Cc Avi Kivity<[email protected]>
Cc Marcelo Tosatti<[email protected]>

---

  Documentation/virtual/kvm/api.txt |   30
Quoted 8 lines
Quoted 6 lines

++++++++++++++++++++++++++++++

Quoted 3 lines
Quoted 1 line
  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.

Too bad that we already have one ("5. The kvm_run structure"). :)

Jan

Quoted 7 lines

------8<------

From: Jan Kiszka <[email protected]>

KVM: Fixup documentation section numbering

Applied, thanks.