WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] 32-on-64: pvfb issue

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] 32-on-64: pvfb issue
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Fri, 19 Jan 2007 16:31:13 +0100
Cc: Xen devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>
Delivery-date: Fri, 19 Jan 2007 07:30:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1D69299.7E50%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C1D69299.7E50%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (X11/20060911)
Keir Fraser wrote:
> You missed out the patch.

Oops, attached.

> I'm sure however that I'll argue you should make
> the enumeration local to the backend. It will always support his native
> architecture. Where it supports cross-architecture (i386-on-x64) he can
> *privately* have a numeric assignment for that situation which it uses on
> data paths. Then we don't have redundant info in xenstore and we don't get
> tied to particular magic numbers.

I don't want to put numbers into xenstore.  But there are multiple
backends affected (pvfb, blktab, blkback, tpm, maybe more) and thus it
would be useful to share the infrastructure IMHO ...

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@xxxxxxx>
---
 linux-2.6-xen-sparse/include/xen/protocols.h |   57 +++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

Index: build-32-unstable-13495/linux-2.6-xen-sparse/include/xen/protocols.h
===================================================================
--- /dev/null
+++ build-32-unstable-13495/linux-2.6-xen-sparse/include/xen/protocols.h
@@ -0,0 +1,57 @@
+#ifndef __XEN_PROTOCOLS_H__
+#define __XEN_PROTOCOLS_H__
+
+enum xen_io_proto_id {
+       /* For all front/backends */
+       XEN_IO_PROTO_ABI_X86_32    = 1,
+       XEN_IO_PROTO_ABI_X86_64    = 2,
+       XEN_IO_PROTO_ABI_IA64      = 3,
+       XEN_IO_PROTO_ABI_POWERPC64 = 4,
+
+       /* framebuffer via grant tables on little endian machines */
+       XEN_IO_PROTO_FB_LE_GRANT   = 5,
+};
+
+static const char *xen_io_proto_names[] = {
+       [ XEN_IO_PROTO_ABI_X86_32 ]    = "x86_32-abi",
+       [ XEN_IO_PROTO_ABI_X86_64 ]    = "x86_64-abi",
+       [ XEN_IO_PROTO_ABI_IA64 ]      = "ia64-abi",
+       [ XEN_IO_PROTO_ABI_POWERPC64 ] = "powerpc64-abi",
+
+       [ XEN_IO_PROTO_FB_LE_GRANT ]   = "fb-le-grant",
+};
+#define XEN_IO_PROTO_COUNT 
(sizeof(xen_io_proto_names)/sizeof(xen_io_proto_names[0]))
+
+static enum xen_io_proto_id xen_io_proto_name2id(const char *name)
+{
+       int id;
+
+       for (id = 0; id < XEN_IO_PROTO_COUNT; id++) {
+               if (!xen_io_proto_names[id])
+                       continue;
+               if (0 != strcmp(name, xen_io_proto_names[id]))
+                       continue;
+               return i;
+       }
+}
+
+static const char *xen_io_proto_id2name(enum xen_io_proto_id id)
+{
+       if (id >= XEN_IO_PROTO_COUNT)
+               return NULL;
+       return xen_io_proto_names[id];
+}
+
+#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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel