public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
To: Will Deacon <will.deacon@arm.com>
Cc: <kvm@vger.kernel.org>,
	Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Subject: [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event
Date: Mon, 15 Jun 2015 13:49:45 +0200	[thread overview]
Message-ID: <1434368986-14963-5-git-send-email-andreas.herrmann@caviumnetworks.com> (raw)
In-Reply-To: <1434368986-14963-1-git-send-email-andreas.herrmann@caviumnetworks.com>

W/o dedicated endianess it's impossible to find reliably a match
e.g. in kernel/virt/kvm/eventfd.c ioeventfd_in_range.

Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
---
 ioeventfd.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ioeventfd.c b/ioeventfd.c
index bce6861..a724baa 100644
--- a/ioeventfd.c
+++ b/ioeventfd.c
@@ -8,6 +8,7 @@
 #include <linux/kernel.h>
 #include <linux/kvm.h>
 #include <linux/types.h>
+#include <linux/byteorder.h>
 
 #include "kvm/ioeventfd.h"
 #include "kvm/kvm.h"
@@ -140,7 +141,7 @@ int ioeventfd__add_event(struct ioevent *ioevent, int flags)
 	kvm_ioevent = (struct kvm_ioeventfd) {
 		.addr		= ioevent->io_addr,
 		.len		= ioevent->io_len,
-		.datamatch	= ioevent->datamatch,
+		.datamatch	= cpu_to_le64(ioevent->datamatch),
 		.fd		= event,
 		.flags		= KVM_IOEVENTFD_FLAG_DATAMATCH,
 	};
@@ -199,7 +200,7 @@ int ioeventfd__del_event(u64 addr, u64 datamatch)
 	kvm_ioevent = (struct kvm_ioeventfd) {
 		.addr			= ioevent->io_addr,
 		.len			= ioevent->io_len,
-		.datamatch		= ioevent->datamatch,
+		.datamatch		= cpu_to_le64(ioevent->datamatch),
 		.flags			= KVM_IOEVENTFD_FLAG_PIO
 					| KVM_IOEVENTFD_FLAG_DEASSIGN
 					| KVM_IOEVENTFD_FLAG_DATAMATCH,
-- 
1.7.9.5


  parent reply	other threads:[~2015-06-15 12:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 11:49 [PATCH 0/5] kvmtool: Misc fixes Andreas Herrmann
2015-06-15 11:49 ` [PATCH 1/5] kvmtool: Fix compile error on MIPS Andreas Herrmann
2015-06-15 11:49 ` [PATCH 2/5] kvmtool: Fix regression introduced with d2a7ddff4 Andreas Herrmann
2015-06-15 11:49 ` [PATCH 3/5] kvmtool: Register each guest memory bank as vhost_memory_region Andreas Herrmann
2015-06-15 11:49 ` Andreas Herrmann [this message]
2015-06-16 17:17   ` [PATCH 4/5] kvmtool: Save datamatch as little endian in {add,del}_event Will Deacon
2015-06-17  7:17     ` Andreas Herrmann
2015-06-17 10:03       ` Will Deacon
2015-06-15 11:49 ` [PATCH 5/5] kvmtool: Fix length of ioevent for VIRTIO_PCI_QUEUE_NOTIFY Andreas Herrmann
2015-06-16 17:29 ` [PATCH 0/5] kvmtool: Misc fixes Will Deacon

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=1434368986-14963-5-git-send-email-andreas.herrmann@caviumnetworks.com \
    --to=andreas.herrmann@caviumnetworks.com \
    --cc=kvm@vger.kernel.org \
    --cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox