LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: virtualization@lists.osdl.org, xen-devel@lists.xensource.com,
	linux-fbdev-devel@lists.sourceforge.net, adaplas@pol.net,
	linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	akpm@linux-foundation.org, jayakumar.lkml@gmail.com
Subject: [PATCH 1/3] xen: Make xen-blkfront write its protocol ABI to xenstore
Date: Mon, 25 Feb 2008 14:02:24 +0100	[thread overview]
Message-ID: <87mypp6vfj.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <87tzjx6vj3.fsf@pike.pond.sub.org>

Frontends are expected to write their protocol ABI to xenstore.  Since
the protocol ABI defaults to the backend's native ABI, things work
fine without that as long as the frontend's native ABI is identical to
the backend's native ABI.  This is not the case for xen-blkfront
running 32-on-64, because its ABI differs between 32 and 64 bit, and
thus needs this fix.

Based on http://xenbits.xensource.com/xen-unstable.hg?rev/c545932a18f3
and http://xenbits.xensource.com/xen-unstable.hg?rev/ffe52263b430 by
Gerd Hoffmann <kraxel@suse.de>

Signed-off-by: Markus Armbruster <armbru@redhat.com>

---
 drivers/block/xen-blkfront.c         |    7 +++++++
 include/xen/interface/io/protocols.h |   21 +++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 include/xen/interface/io/protocols.h

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 8afce67..e69164a 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -46,6 +46,7 @@
 
 #include <xen/interface/grant_table.h>
 #include <xen/interface/io/blkif.h>
+#include <xen/interface/io/protocols.h>
 
 #include <asm/xen/hypervisor.h>
 
@@ -597,6 +598,12 @@ again:
 		message = "writing event-channel";
 		goto abort_transaction;
 	}
+	err = xenbus_printf(xbt, dev->nodename, "protocol", "%s",
+			    XEN_IO_PROTO_ABI_NATIVE);
+	if (err) {
+		message = "writing protocol";
+		goto abort_transaction;
+	}
 
 	err = xenbus_transaction_end(xbt, 0);
 	if (err) {
diff --git a/include/xen/interface/io/protocols.h b/include/xen/interface/io/protocols.h
new file mode 100644
index 0000000..01fc8ae
--- /dev/null
+++ b/include/xen/interface/io/protocols.h
@@ -0,0 +1,21 @@
+#ifndef __XEN_PROTOCOLS_H__
+#define __XEN_PROTOCOLS_H__
+
+#define XEN_IO_PROTO_ABI_X86_32     "x86_32-abi"
+#define XEN_IO_PROTO_ABI_X86_64     "x86_64-abi"
+#define XEN_IO_PROTO_ABI_IA64       "ia64-abi"
+#define XEN_IO_PROTO_ABI_POWERPC64  "powerpc64-abi"
+
+#if defined(__i386__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
+#elif defined(__x86_64__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
+#elif defined(__ia64__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
+#elif defined(__powerpc64__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64
+#else
+# error arch fixup needed here
+#endif
+
+#endif
-- 
1.5.3.3


  reply	other threads:[~2008-02-25 13:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 13:00 [PATCH 0/3] xen pvfb: Para-virtual framebuffer, keyboard and pointer Markus Armbruster
2008-02-25 13:02 ` Markus Armbruster [this message]
2008-02-25 13:03 ` [PATCH 2/3] fbdev: Make deferred I/O work as advertized Markus Armbruster
2008-02-26 14:11   ` Jaya Kumar
2008-02-26 14:45     ` Markus Armbruster
2008-02-26 15:01       ` Jaya Kumar
2008-03-19 10:45         ` Markus Armbruster
2008-03-19 11:24           ` Jaya Kumar
2008-03-19 18:37             ` Andrew Morton
2008-03-19 22:30               ` Jaya Kumar
2008-03-19 22:39                 ` Andrew Morton
2008-03-19 22:55                   ` Jaya Kumar
2008-02-25 13:06 ` [PATCH 3/3] xen pvfb: Para-virtual framebuffer, keyboard and pointer driver Markus Armbruster

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=87mypp6vfj.fsf@pike.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=adaplas@pol.net \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.com \
    --subject='Re: [PATCH 1/3] xen: Make xen-blkfront write its protocol ABI to xenstore' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).