Magellan Linux

Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1004-2.6.25-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (show annotations) (download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 2601 byte(s)
-ver bump to 2.6.25-magellan-r1:
- linux-2.6.25.4
- fbcondecor-0.9.4
- squashfs-3.3
- unionfs-2.3.3
- tuxonice-3.0-rc7
- linux-phc-0.3.0
- acpi-dstd-0.9a
- reiser4
- xen-3.2.0
. ipw3945-1.2.2

1 From 3070ddb6b32a10215cc0cc4b73bb93c665bf7e78 Mon Sep 17 00:00:00 2001
2 From: Markus Armbruster <armbru@redhat.com>
3 Date: Mon, 25 Feb 2008 14:02:24 +0100
4 Subject: [PATCH] xen: Make xen-blkfront write its protocol ABI to xenstore
5
6 Frontends are expected to write their protocol ABI to xenstore. Since
7 the protocol ABI defaults to the backend's native ABI, things work
8 fine without that as long as the frontend's native ABI is identical to
9 the backend's native ABI. This is not the case for xen-blkfront
10 running 32-on-64, because its ABI differs between 32 and 64 bit, and
11 thus needs this fix.
12
13 Based on http://xenbits.xensource.com/xen-unstable.hg?rev/c545932a18f3
14 and http://xenbits.xensource.com/xen-unstable.hg?rev/ffe52263b430 by
15 Gerd Hoffmann <kraxel@suse.de>
16
17 Signed-off-by: Markus Armbruster <armbru@redhat.com>
18 ---
19 drivers/block/xen-blkfront.c | 7 +++++++
20 include/xen/interface/io/protocols.h | 21 +++++++++++++++++++++
21 2 files changed, 28 insertions(+), 0 deletions(-)
22 create mode 100644 include/xen/interface/io/protocols.h
23
24 diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
25 index 9c6f3f9..2e7c81e 100644
26 --- a/drivers/block/xen-blkfront.c
27 +++ b/drivers/block/xen-blkfront.c
28 @@ -47,6 +47,7 @@
29
30 #include <xen/interface/grant_table.h>
31 #include <xen/interface/io/blkif.h>
32 +#include <xen/interface/io/protocols.h>
33
34 #include <asm/xen/hypervisor.h>
35
36 @@ -614,6 +615,12 @@ again:
37 message = "writing event-channel";
38 goto abort_transaction;
39 }
40 + err = xenbus_printf(xbt, dev->nodename, "protocol", "%s",
41 + XEN_IO_PROTO_ABI_NATIVE);
42 + if (err) {
43 + message = "writing protocol";
44 + goto abort_transaction;
45 + }
46
47 err = xenbus_transaction_end(xbt, 0);
48 if (err) {
49 diff --git a/include/xen/interface/io/protocols.h b/include/xen/interface/io/protocols.h
50 new file mode 100644
51 index 0000000..01fc8ae
52 --- /dev/null
53 +++ b/include/xen/interface/io/protocols.h
54 @@ -0,0 +1,21 @@
55 +#ifndef __XEN_PROTOCOLS_H__
56 +#define __XEN_PROTOCOLS_H__
57 +
58 +#define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi"
59 +#define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi"
60 +#define XEN_IO_PROTO_ABI_IA64 "ia64-abi"
61 +#define XEN_IO_PROTO_ABI_POWERPC64 "powerpc64-abi"
62 +
63 +#if defined(__i386__)
64 +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
65 +#elif defined(__x86_64__)
66 +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
67 +#elif defined(__ia64__)
68 +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
69 +#elif defined(__powerpc64__)
70 +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64
71 +#else
72 +# error arch fixup needed here
73 +#endif
74 +
75 +#endif
76 --
77 1.5.4.1
78