Skip to content

Commit 55399a0

Browse files
sashalevinavikivity
authored andcommitted
KVM: Document KVM_IOEVENTFD
Document KVM_IOEVENTFD that can be used to receive notifications of PIO/MMIO events without triggering an exit. Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
1 parent 823e396 commit 55399a0

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

‎Documentation/virtual/kvm/api.txt‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,36 @@ struct kvm_lapic_state {
13231323
Copies the input argument into the the Local APIC registers. The data format
13241324
and layout are the same as documented in the architecture manual.
13251325

1326+
4.56 KVM_IOEVENTFD
1327+
1328+
Capability: KVM_CAP_IOEVENTFD
1329+
Architectures: all
1330+
Type: vm ioctl
1331+
Parameters: struct kvm_ioeventfd (in)
1332+
Returns: 0 on success, !0 on error
1333+
1334+
This ioctl attaches or detaches an ioeventfd to a legal pio/mmio address
1335+
within the guest. A guest write in the registered address will signal the
1336+
provided event instead of triggering an exit.
1337+
1338+
struct kvm_ioeventfd {
1339+
__u64 datamatch;
1340+
__u64 addr; /* legal pio/mmio address */
1341+
__u32 len; /* 1, 2, 4, or 8 bytes */
1342+
__s32 fd;
1343+
__u32 flags;
1344+
__u8 pad[36];
1345+
};
1346+
1347+
The following flags are defined:
1348+
1349+
#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
1350+
#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
1351+
#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
1352+
1353+
If datamatch flag is set, the event will be signaled only if the written value
1354+
to the registered address is equal to datamatch in struct kvm_ioeventfd.
1355+
13261356
5. The kvm_run structure
13271357

13281358
Application code obtains a pointer to the kvm_run structure by

0 commit comments

Comments
 (0)