ia64/xen-unstable

changeset 11225:5fc1fe790835

[XEN] Clarify x86 hypercall ABI in public header comments.
In particular: x86/64 *does* clobber its ragument registers
(just like i386). This happens in debug builds, and if a
continuation is created.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Sat Aug 19 17:07:54 2006 +0100 (2006-08-19)
parents 26576f1dbadb
children 45a84091144e
files xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/xen.h
line diff
     1.1 --- a/xen/include/public/arch-x86_32.h	Sat Aug 19 14:28:10 2006 +0100
     1.2 +++ b/xen/include/public/arch-x86_32.h	Sat Aug 19 17:07:54 2006 +0100
     1.3 @@ -9,6 +9,25 @@
     1.4  #ifndef __XEN_PUBLIC_ARCH_X86_32_H__
     1.5  #define __XEN_PUBLIC_ARCH_X86_32_H__
     1.6  
     1.7 +/*
     1.8 + * Hypercall interface:
     1.9 + *  Input:  %ebx, %ecx, %edx, %esi, %edi (arguments 1-5)
    1.10 + *  Output: %eax
    1.11 + * Access is via hypercall page (set up by guest loader or via a Xen MSR):
    1.12 + *  call hypercall_page + hypercall-number * 32
    1.13 + * Clobbered: Argument registers (e.g., 2-arg hypercall clobbers %ebx,%ecx)
    1.14 + */
    1.15 +
    1.16 +#if __XEN_INTERFACE_VERSION__ < 0x00030203
    1.17 +/*
    1.18 + * Legacy hypercall interface:
    1.19 + * As above, except the entry sequence to the hypervisor is:
    1.20 + *  mov $hypercall-number*32,%eax ; int $0x82
    1.21 + */
    1.22 +#define TRAP_INSTR "int $0x82"
    1.23 +#endif
    1.24 +
    1.25 +
    1.26  /* Structural guest handles introduced in 0x00030201. */
    1.27  #if __XEN_INTERFACE_VERSION__ >= 0x00030201
    1.28  #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    1.29 @@ -71,9 +90,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    1.30  #define FLAT_USER_DS    FLAT_RING3_DS
    1.31  #define FLAT_USER_SS    FLAT_RING3_SS
    1.32  
    1.33 -/* And the trap vector is... */
    1.34 -#define TRAP_INSTR "int $0x82"
    1.35 -
    1.36  /*
    1.37   * Virtual addresses beyond this are not modifiable by guest OSes. The 
    1.38   * machine->physical mapping table starts at this address, read-only.
     2.1 --- a/xen/include/public/arch-x86_64.h	Sat Aug 19 14:28:10 2006 +0100
     2.2 +++ b/xen/include/public/arch-x86_64.h	Sat Aug 19 17:07:54 2006 +0100
     2.3 @@ -9,6 +9,25 @@
     2.4  #ifndef __XEN_PUBLIC_ARCH_X86_64_H__
     2.5  #define __XEN_PUBLIC_ARCH_X86_64_H__
     2.6  
     2.7 +/*
     2.8 + * Hypercall interface:
     2.9 + *  Input:  %rdi, %rsi, %rdx, %r10, %r8 (arguments 1-5)
    2.10 + *  Output: %rax
    2.11 + * Access is via hypercall page (set up by guest loader or via a Xen MSR):
    2.12 + *  call hypercall_page + hypercall-number * 32
    2.13 + * Clobbered: argument registers (e.g., 2-arg hypercall clobbers %rdi,%rsi)
    2.14 + */
    2.15 +
    2.16 +#if __XEN_INTERFACE_VERSION__ < 0x00030203
    2.17 +/*
    2.18 + * Legacy hypercall interface:
    2.19 + * As above, except the entry sequence to the hypervisor is:
    2.20 + *  mov $hypercall-number*32,%eax ; syscall
    2.21 + * Clobbered: %rcx, %r11, argument registers (as above)
    2.22 + */
    2.23 +#define TRAP_INSTR "syscall"
    2.24 +#endif
    2.25 +
    2.26  /* Structural guest handles introduced in 0x00030201. */
    2.27  #if __XEN_INTERFACE_VERSION__ >= 0x00030201
    2.28  #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
    2.29 @@ -86,9 +105,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
    2.30  #define FLAT_USER_SS32 FLAT_RING3_SS32
    2.31  #define FLAT_USER_SS   FLAT_USER_SS64
    2.32  
    2.33 -/* And the trap vector is... */
    2.34 -#define TRAP_INSTR "syscall"
    2.35 -
    2.36  #define __HYPERVISOR_VIRT_START 0xFFFF800000000000
    2.37  #define __HYPERVISOR_VIRT_END   0xFFFF880000000000
    2.38  #define __MACH2PHYS_VIRT_START  0xFFFF800000000000
     3.1 --- a/xen/include/public/xen.h	Sat Aug 19 14:28:10 2006 +0100
     3.2 +++ b/xen/include/public/xen.h	Sat Aug 19 17:07:54 2006 +0100
     3.3 @@ -24,17 +24,9 @@
     3.4  #endif
     3.5  
     3.6  /*
     3.7 - * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
     3.8 + * HYPERCALLS
     3.9   */
    3.10  
    3.11 -/*
    3.12 - * x86_32: EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5.
    3.13 - *         EAX = return value
    3.14 - *         (argument registers may be clobbered on return)
    3.15 - * x86_64: RAX = vector; RDI, RSI, RDX, R10, R8, R9 = args 1, 2, 3, 4, 5, 6. 
    3.16 - *         RAX = return value
    3.17 - *         (argument registers not clobbered on return; RCX, R11 are)
    3.18 - */
    3.19  #define __HYPERVISOR_set_trap_table        0
    3.20  #define __HYPERVISOR_mmu_update            1
    3.21  #define __HYPERVISOR_set_gdt               2