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

[Xen-devel] [PATCH,RFC 17/17] 32-on-64 platform ops

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH,RFC 17/17] 32-on-64 platform ops
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Wed, 04 Oct 2006 16:45:46 +0100
Delivery-date: Wed, 04 Oct 2006 08:48:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Index: 2006-10-04/xen/arch/x86/platform_hypercall.c
===================================================================
--- 2006-10-04.orig/xen/arch/x86/platform_hypercall.c   2006-09-28 
12:22:30.000000000 +0200
+++ 2006-10-04/xen/arch/x86/platform_hypercall.c        2006-10-04 
15:20:45.000000000 +0200
@@ -23,11 +23,17 @@
 #include <asm/mtrr.h>
 #include "cpu/mtrr/mtrr.h"
 
-long do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
+#ifndef COMPAT
+typedef long ret_t;
+DEFINE_SPINLOCK(xenpf_lock);
+#else
+extern spinlock_t xenpf_lock;
+#endif
+
+ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
 {
-    long ret = 0;
+    ret_t ret = 0;
     struct xen_platform_op curop, *op = &curop;
-    static DEFINE_SPINLOCK(xenpf_lock);
 
     if ( !IS_PRIV(current->domain) )
         return -EPERM;
@@ -112,8 +118,15 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
     case XENPF_microcode_update:
     {
         extern int microcode_update(XEN_GUEST_HANDLE(void), unsigned long len);
+#ifndef COMPAT
         ret = microcode_update(op->u.microcode.data,
                                op->u.microcode.length);
+#else
+        XEN_GUEST_HANDLE(void) data;
+
+        guest_from_compat_handle(data, op->u.microcode.data);
+        ret = microcode_update(data, op->u.microcode.length);
+#endif
     }
     break;
 
Index: 2006-10-04/xen/arch/x86/x86_64/Makefile
===================================================================
--- 2006-10-04.orig/xen/arch/x86/x86_64/Makefile        2006-10-04 
15:20:09.000000000 +0200
+++ 2006-10-04/xen/arch/x86/x86_64/Makefile     2006-10-04 15:20:45.000000000 
+0200
@@ -6,6 +6,7 @@ obj-y += traps.o
 obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_COMPAT) += domain.o
 obj-$(CONFIG_COMPAT) += physdev.o
+obj-$(CONFIG_COMPAT) += platform_hypercall.o
 
 ifeq ($(CONFIG_COMPAT),y)
 # extra dependencies
@@ -13,5 +14,6 @@ compat.o:     ../compat.c
 entry.o:       compat/entry.S
 mm.o:          compat/mm.c
 physdev.o:     ../physdev.c
+platform_hypercall.o: ../platform_hypercall.c
 traps.o:       compat/traps.c
 endif
Index: 2006-10-04/xen/arch/x86/x86_64/compat/entry.S
===================================================================
--- 2006-10-04.orig/xen/arch/x86/x86_64/compat/entry.S  2006-10-04 
15:20:41.000000000 +0200
+++ 2006-10-04/xen/arch/x86/x86_64/compat/entry.S       2006-10-04 
15:20:45.000000000 +0200
@@ -285,7 +285,6 @@ compat_arch_sched_op:
 
 .section .rodata, "a", @progbits
 
-#define compat_platform_op domain_crash_synchronous
 #define compat_acm_op domain_crash_synchronous
 #define compat_xenoprof_op domain_crash_synchronous
 #define compat_sysctl domain_crash_synchronous
Index: 2006-10-04/xen/arch/x86/x86_64/platform_hypercall.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ 2006-10-04/xen/arch/x86/x86_64/platform_hypercall.c 2006-10-04 
15:20:45.000000000 +0200
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * platform_hypercall.c
+ *
+ */
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <compat/platform.h>
+
+DEFINE_XEN_GUEST_HANDLE(compat_platform_op_t);
+#define xen_platform_op     compat_platform_op
+#define xen_platform_op_t   compat_platform_op_t
+#define do_platform_op(x)   compat_platform_op(_##x)
+
+#define COMPAT
+#define _XEN_GUEST_HANDLE(t) XEN_GUEST_HANDLE(t)
+typedef int ret_t;
+
+#include "../platform_hypercall.c"
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH,RFC 17/17] 32-on-64 platform ops, Jan Beulich <=