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] Allow direct hypercalls

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Allow direct hypercalls
From: john.levon@xxxxxxx
Date: Wed, 30 Apr 2008 05:56:31 -0700
Delivery-date: Thu, 01 May 2008 07:53:17 -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
# HG changeset patch
# User john.levon@xxxxxxx
# Date 1209521783 25200
# Node ID 9a5c6e3620d83f9354e3eedbc4ef24a7a5ad752e
# Parent  f477f895f78752bb9fa2e6ee6c1d09b6a8cd3230
Allow direct hypercalls

For PV guests, there's no reason to force use of the indirect hypercall
mechanism. Allow it. Also allow TRAP_INSTR to be used from assembly.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/xen/include/public/arch-x86/xen-x86_32.h 
b/xen/include/public/arch-x86/xen-x86_32.h
--- a/xen/include/public/arch-x86/xen-x86_32.h
+++ b/xen/include/public/arch-x86/xen-x86_32.h
@@ -36,13 +36,15 @@
  * Clobbered: Argument registers (e.g., 2-arg hypercall clobbers %ebx,%ecx)
  */
 
-#if __XEN_INTERFACE_VERSION__ < 0x00030203
 /*
- * Legacy hypercall interface:
+ * Direct hypercall interface:
  * As above, except the entry sequence to the hypervisor is:
  *  mov $hypercall-number*32,%eax ; int $0x82
  */
+#if !defined(_ASM)
 #define TRAP_INSTR "int $0x82"
+#else
+#define TRAP_INSTR int $0x82
 #endif
 
 /*
diff --git a/xen/include/public/arch-x86/xen-x86_64.h 
b/xen/include/public/arch-x86/xen-x86_64.h
--- a/xen/include/public/arch-x86/xen-x86_64.h
+++ b/xen/include/public/arch-x86/xen-x86_64.h
@@ -36,16 +36,18 @@
  * Clobbered: argument registers (e.g., 2-arg hypercall clobbers %rdi,%rsi)
  */
 
-#if __XEN_INTERFACE_VERSION__ < 0x00030203
 /*
- * Legacy hypercall interface:
+ * Direct hypercall interface:
  * As above, except the entry sequence to the hypervisor is:
  *  mov $hypercall-number*32,%eax ; syscall
  * Clobbered: %rcx, %r11, argument registers (as above)
  */
+#if !defined(_ASM)
 #define TRAP_INSTR "syscall"
+#else
+#define TRAP_INSTR syscall
 #endif
-
+  
 /*
  * 64-bit segment selectors
  * These flat segments are in the Xen-private section of every GDT. Since these

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

<Prev in Thread] Current Thread [Next in Thread>