[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] linux/x86: clean up hypercall headers



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1200674124 0
# Node ID 1468ebbc3c5d7d50828251058ca229a4dce55345
# Parent  bc3e5b96d4f428b8ac03f4290bb1e38b3e4a99ea
linux/x86: clean up hypercall headers

- don't define HYPERVISOR_hvm_op() for pv guests (requiring to not
  include
  include/xen/hvm.h in non-pv-driver builds)
- remove the custome __STR/STR macros
- remove stringification where not necessary
- reduce instruction size for pv-driver case on x86-64

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 drivers/xen/xenbus/xenbus_probe.c           |    2 ++
 drivers/xen/xenbus/xenbus_probe_backend.c   |    1 -
 include/asm-i386/mach-xen/asm/hypercall.h   |   11 +++++------
 include/asm-x86_64/mach-xen/asm/hypercall.h |   11 +++++------
 4 files changed, 12 insertions(+), 13 deletions(-)

diff -r bc3e5b96d4f4 -r 1468ebbc3c5d drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c Fri Jan 18 16:19:08 2008 +0000
+++ b/drivers/xen/xenbus/xenbus_probe.c Fri Jan 18 16:35:24 2008 +0000
@@ -54,7 +54,9 @@
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
 #include <xen/features.h>
+#ifdef MODULE
 #include <xen/hvm.h>
+#endif
 
 #include "xenbus_comms.h"
 #include "xenbus_probe.h"
diff -r bc3e5b96d4f4 -r 1468ebbc3c5d drivers/xen/xenbus/xenbus_probe_backend.c
--- a/drivers/xen/xenbus/xenbus_probe_backend.c Fri Jan 18 16:19:08 2008 +0000
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c Fri Jan 18 16:35:24 2008 +0000
@@ -52,7 +52,6 @@
 #include <xen/xen_proc.h>
 #include <xen/evtchn.h>
 #include <xen/features.h>
-#include <xen/hvm.h>
 
 #include "xenbus_comms.h"
 #include "xenbus_probe.h"
diff -r bc3e5b96d4f4 -r 1468ebbc3c5d include/asm-i386/mach-xen/asm/hypercall.h
--- a/include/asm-i386/mach-xen/asm/hypercall.h Fri Jan 18 16:19:08 2008 +0000
+++ b/include/asm-i386/mach-xen/asm/hypercall.h Fri Jan 18 16:35:24 2008 +0000
@@ -40,16 +40,13 @@
 # error "please don't include this file directly"
 #endif
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #ifdef CONFIG_XEN
 #define HYPERCALL_STR(name)                                    \
-       "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
+       "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
 #else
 #define HYPERCALL_STR(name)                                    \
-       "mov "__stringify(hypercall_stubs)",%%eax; "            \
-       "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; "        \
+       "mov hypercall_stubs,%%eax; "                           \
+       "add $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
        "call *%%eax"
 #endif
 
@@ -375,12 +372,14 @@ HYPERVISOR_nmi_op(
        return _hypercall2(int, nmi_op, op, arg);
 }
 
+#ifndef CONFIG_XEN
 static inline unsigned long
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
     return _hypercall2(unsigned long, hvm_op, op, arg);
 }
+#endif
 
 static inline int
 HYPERVISOR_callback_op(
diff -r bc3e5b96d4f4 -r 1468ebbc3c5d include/asm-x86_64/mach-xen/asm/hypercall.h
--- a/include/asm-x86_64/mach-xen/asm/hypercall.h       Fri Jan 18 16:19:08 
2008 +0000
+++ b/include/asm-x86_64/mach-xen/asm/hypercall.h       Fri Jan 18 16:35:24 
2008 +0000
@@ -44,16 +44,13 @@
 # error "please don't include this file directly"
 #endif
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #ifdef CONFIG_XEN
 #define HYPERCALL_STR(name)                                    \
-       "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
+       "call hypercall_page + ("__stringify(__HYPERVISOR_##name)" * 32)"
 #else
 #define HYPERCALL_STR(name)                                    \
-       "mov "__stringify(hypercall_stubs)",%%rax; "            \
-       "add $("STR(__HYPERVISOR_##name)" * 32),%%rax; "        \
+       "mov $("__stringify(__HYPERVISOR_##name)" * 32),%%eax; "\
+       "add hypercall_stubs(%%rip),%%rax; "                    \
        "call *%%rax"
 #endif
 
@@ -376,12 +373,14 @@ HYPERVISOR_nmi_op(
        return _hypercall2(int, nmi_op, op, arg);
 }
 
+#ifndef CONFIG_XEN
 static inline unsigned long
 HYPERVISOR_hvm_op(
     int op, void *arg)
 {
     return _hypercall2(unsigned long, hvm_op, op, arg);
 }
+#endif
 
 static inline int
 HYPERVISOR_callback_op(

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.