All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ioeventfd: Remove natural sized length limitation
@ 2011-07-06  4:37 Sasha Levin
  2011-07-06  4:37 ` [PATCH 2/5] ioeventfd: Add helper functions for reading and writing Sasha Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 62+ messages in thread
From: Sasha Levin @ 2011-07-06  4:37 UTC (permalink / raw)
  To: kvm
  Cc: Sasha Levin, Avi Kivity, Ingo Molnar, Marcelo Tosatti,
	Michael S. Tsirkin, Pekka Enberg

This patch removes the 8 byte length limit on ioeventfds.

The consequences are that any write in the provided region
which is contained entierly by the region and matches datamatch
(if specified) will trigger an event.

Cc: Avi Kivity <avi@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 Documentation/virtual/kvm/api.txt |    4 ++--
 include/linux/kvm.h               |    4 ++--
 virt/kvm/eventfd.c                |   15 ++-------------
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index b251136..7994840 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -1334,8 +1334,8 @@ 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    */
+	__u64 addr;
+	__u32 len;
 	__s32 fd;
 	__u32 flags;
 	__u8  pad[36];
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 9c9ca7c..81cd295 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -398,8 +398,8 @@ enum {
 
 struct kvm_ioeventfd {
 	__u64 datamatch;
-	__u64 addr;        /* legal pio/mmio address */
-	__u32 len;         /* 1, 2, 4, or 8 bytes    */
+	__u64 addr;
+	__u32 len;
 	__s32 fd;
 	__u32 flags;
 	__u8  pad[36];
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 73358d2..5fb09b4 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -449,8 +449,8 @@ ioeventfd_in_range(struct _ioeventfd *p, gpa_t addr, int len, const void *val)
 {
 	u64 _val;
 
-	if (!(addr == p->addr && len == p->length))
-		/* address-range must be precise for a hit */
+	if (!((addr >= p->addr) && ((addr + len) <= (p->addr + p->length))))
+		/* the entire address-range must be within the ioeventfd */
 		return false;
 
 	if (p->wildcard)
@@ -536,17 +536,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
 	struct eventfd_ctx       *eventfd;
 	int                       ret;
 
-	/* must be natural-word sized */
-	switch (args->len) {
-	case 1:
-	case 2:
-	case 4:
-	case 8:
-		break;
-	default:
-		return -EINVAL;
-	}
-
 	/* check for range overflow */
 	if (args->addr + args->len < args->addr)
 		return -EINVAL;
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2011-07-25 13:04 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-06  4:37 [PATCH 1/5] ioeventfd: Remove natural sized length limitation Sasha Levin
2011-07-06  4:37 ` [PATCH 2/5] ioeventfd: Add helper functions for reading and writing Sasha Levin
2011-07-06  4:37 ` [PATCH 3/5] ioeventfd: Introduce KVM_IOEVENTFD_FLAG_READ Sasha Levin
2011-07-06  4:37 ` [PATCH 4/5] ioeventfd: Introduce KVM_IOEVENTFD_FLAG_NOWRITE Sasha Levin
2011-07-06  4:37 ` [PATCH 5/5] ioeventfd: Introduce KVM_IOEVENTFD_FLAG_SOCKET Sasha Levin
2011-07-06 11:42   ` Michael S. Tsirkin
2011-07-06 15:01     ` Sasha Levin
2011-07-06 17:58       ` Michael S. Tsirkin
2011-07-10  5:34         ` Sasha Levin
2011-07-10  8:05           ` Michael S. Tsirkin
2011-07-12 11:23             ` Sasha Levin
2011-07-12 11:26               ` Avi Kivity
2011-07-13  6:37                 ` Pekka Enberg
2011-07-13  6:45                   ` Pekka Enberg
2011-07-13  7:07                     ` Avi Kivity
2011-07-13  8:02                       ` Pekka Enberg
2011-07-13 12:57                         ` Avi Kivity
2011-07-13 13:00                           ` Pekka Enberg
2011-07-13 13:32                             ` Avi Kivity
2011-07-14  7:26                               ` Pekka Enberg
2011-07-14  8:07                                 ` Sasha Levin
2011-07-14  8:09                                 ` Avi Kivity
2011-07-14  8:14                                   ` Pekka Enberg
2011-07-14  8:28                                     ` Avi Kivity
2011-07-14  8:59                                       ` Pekka Enberg
2011-07-14  9:48                                         ` Avi Kivity
     [not found]                                           ` <CAOJsxLHSeRuTOoiJssyrELRx-eXok3WinLr_+_G4dB+yHNBKdg@mail.gmai! l.com>
2011-07-14 10:30                                           ` Pekka Enberg
2011-07-14 11:54                                             ` Avi Kivity
2011-07-14 12:32                                               ` Sasha Levin
2011-07-14 12:46                                                 ` Avi Kivity
2011-07-14 13:00                                                   ` Sasha Levin
2011-07-14 13:05                                                     ` Avi Kivity
2011-07-14 13:17                                                       ` Pekka Enberg
2011-07-14 13:23                                                         ` Avi Kivity
2011-07-20  2:52                                                           ` Anthony Liguori
2011-07-20  6:16                                                             ` Sasha Levin
2011-07-20  9:42                                                               ` Pekka Enberg
2011-07-14 12:37                                               ` Pekka Enberg
2011-07-14 12:48                                                 ` Avi Kivity
2011-07-14 12:52                                                   ` Pekka Enberg
2011-07-14 12:54                                                     ` Avi Kivity
2011-07-14  8:19                                   ` Gleb Natapov
2011-07-14  8:25                                   ` Michael S. Tsirkin
2011-07-14  8:29                                     ` Avi Kivity
2011-07-20  2:49                       ` Anthony Liguori
2011-07-20  9:44                         ` Pekka Enberg
2011-07-20 21:10                           ` Anthony Liguori
2011-07-25 12:10                       ` Sasha Levin
2011-07-25 12:16                         ` Avi Kivity
2011-07-25 12:26                           ` Sasha Levin
2011-07-25 13:04                             ` Avi Kivity
2011-07-13  7:51           ` Pekka Enberg
2011-07-13 10:04             ` Pekka Enberg
2011-07-13 10:26               ` Sasha Levin
2011-07-13 10:56                 ` Pekka Enberg
2011-07-13 11:14                   ` Pekka Enberg
2011-07-06 12:39   ` Avi Kivity
2011-07-06 12:58     ` Sasha Levin
2011-07-06 13:04       ` Avi Kivity
2011-07-06 13:00   ` Avi Kivity
2011-07-20  2:42   ` Anthony Liguori
2011-07-20  8:19     ` Avi Kivity

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.