From: john.levon@sun.com Subject: [PATCH] Allow direct hypercalls Date: Wed, 30 Apr 2008 05:56:31 -0700 Message-ID: <9a5c6e3620d83f9354e3.1209560191@xenbld> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User john.levon@sun.com # 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 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