ia64/xen-unstable

changeset 16208:185a13c03255

x86: Remove CALLBACKTYPE_sysexit.

Looking at the Linux patch as an example, it adds more code and
complexity than it removes, for no obvious performance benefit.

Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Wed Oct 24 17:15:54 2007 +0100 (2007-10-24)
parents aeebd173c3fa
children 2b11cb52f6a0
files xen/arch/x86/domain.c xen/arch/x86/x86_64/asm-offsets.c xen/arch/x86/x86_64/compat/traps.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/traps.c xen/include/asm-x86/domain.h xen/include/public/callback.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Oct 24 15:22:57 2007 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Wed Oct 24 17:15:54 2007 +0100
     1.3 @@ -418,10 +418,6 @@ int vcpu_initialise(struct vcpu *v)
     1.4      v->arch.perdomain_ptes =
     1.5          d->arch.mm_perdomain_pt + (v->vcpu_id << GDT_LDT_VCPU_SHIFT);
     1.6  
     1.7 -#ifdef __x86_64__
     1.8 -    v->arch.sysexit_cs = 3;
     1.9 -#endif
    1.10 -
    1.11      return (is_pv_32on64_vcpu(v) ? setup_compat_l4(v) : 0);
    1.12  }
    1.13  
     2.1 --- a/xen/arch/x86/x86_64/asm-offsets.c	Wed Oct 24 15:22:57 2007 +0100
     2.2 +++ b/xen/arch/x86/x86_64/asm-offsets.c	Wed Oct 24 17:15:54 2007 +0100
     2.3 @@ -79,8 +79,6 @@ void __dummy__(void)
     2.4      OFFSET(VCPU_sysenter_sel, struct vcpu, arch.sysenter_callback_cs);
     2.5      OFFSET(VCPU_sysenter_disables_events, struct vcpu,
     2.6             arch.sysenter_disables_events);
     2.7 -    OFFSET(VCPU_sysexit_addr, struct vcpu, arch.sysexit_eip);
     2.8 -    OFFSET(VCPU_sysexit_sel, struct vcpu, arch.sysexit_cs);
     2.9      OFFSET(VCPU_gp_fault_addr, struct vcpu,
    2.10             arch.guest_context.trap_ctxt[TRAP_gp_fault].address);
    2.11      OFFSET(VCPU_gp_fault_sel, struct vcpu,
     3.1 --- a/xen/arch/x86/x86_64/compat/traps.c	Wed Oct 24 15:22:57 2007 +0100
     3.2 +++ b/xen/arch/x86/x86_64/compat/traps.c	Wed Oct 24 17:15:54 2007 +0100
     3.3 @@ -179,11 +179,6 @@ static long compat_register_guest_callba
     3.4              (reg->flags & CALLBACKF_mask_events) != 0;
     3.5          break;
     3.6  
     3.7 -    case CALLBACKTYPE_sysexit:
     3.8 -        v->arch.sysexit_cs  = reg->address.cs | 3;
     3.9 -        v->arch.sysexit_eip = reg->address.eip;
    3.10 -        break;
    3.11 -
    3.12      case CALLBACKTYPE_nmi:
    3.13          ret = register_guest_nmi_callback(reg->address.eip);
    3.14          break;
    3.15 @@ -207,7 +202,6 @@ static long compat_unregister_guest_call
    3.16      case CALLBACKTYPE_failsafe:
    3.17      case CALLBACKTYPE_syscall32:
    3.18      case CALLBACKTYPE_sysenter:
    3.19 -    case CALLBACKTYPE_sysexit:
    3.20          ret = -EINVAL;
    3.21          break;
    3.22  
     4.1 --- a/xen/arch/x86/x86_64/entry.S	Wed Oct 24 15:22:57 2007 +0100
     4.2 +++ b/xen/arch/x86/x86_64/entry.S	Wed Oct 24 17:15:54 2007 +0100
     4.3 @@ -264,11 +264,9 @@ sysenter_eflags_saved:
     4.4          movl  $TRAP_syscall,4(%rsp)
     4.5          SAVE_ALL
     4.6          GET_CURRENT(%rbx)
     4.7 -        movq  VCPU_sysexit_addr(%rbx),%rax
     4.8 -        movzwl VCPU_sysexit_sel(%rbx),%edx
     4.9          cmpb  $0,VCPU_sysenter_disables_events(%rbx)
    4.10 -        movq  %rax,UREGS_rip(%rsp)
    4.11 -        movl  %edx,UREGS_cs(%rsp)
    4.12 +        movq  $0,UREGS_rip(%rsp) /* null rip */
    4.13 +        movl  $3,UREGS_cs(%rsp)  /* ring 3 null cs */
    4.14          movq  VCPU_sysenter_addr(%rbx),%rax
    4.15          setne %cl
    4.16          leaq  VCPU_trap_bounce(%rbx),%rdx
     5.1 --- a/xen/arch/x86/x86_64/traps.c	Wed Oct 24 15:22:57 2007 +0100
     5.2 +++ b/xen/arch/x86/x86_64/traps.c	Wed Oct 24 17:15:54 2007 +0100
     5.3 @@ -431,11 +431,6 @@ static long register_guest_callback(stru
     5.4              !!(reg->flags & CALLBACKF_mask_events);
     5.5          break;
     5.6  
     5.7 -    case CALLBACKTYPE_sysexit:
     5.8 -        v->arch.sysexit_eip = reg->address;
     5.9 -        v->arch.sysexit_cs = FLAT_USER_CS32;
    5.10 -        break;
    5.11 -
    5.12      case CALLBACKTYPE_nmi:
    5.13          ret = register_guest_nmi_callback(reg->address);
    5.14          break;
    5.15 @@ -459,7 +454,6 @@ static long unregister_guest_callback(st
    5.16      case CALLBACKTYPE_syscall:
    5.17      case CALLBACKTYPE_syscall32:
    5.18      case CALLBACKTYPE_sysenter:
    5.19 -    case CALLBACKTYPE_sysexit:
    5.20          ret = -EINVAL;
    5.21          break;
    5.22  
     6.1 --- a/xen/include/asm-x86/domain.h	Wed Oct 24 15:22:57 2007 +0100
     6.2 +++ b/xen/include/asm-x86/domain.h	Wed Oct 24 17:15:54 2007 +0100
     6.3 @@ -303,10 +303,8 @@ struct arch_vcpu
     6.4      struct trap_bounce int80_bounce;
     6.5      unsigned long      syscall32_callback_eip;
     6.6      unsigned long      sysenter_callback_eip;
     6.7 -    unsigned long      sysexit_eip;
     6.8      unsigned short     syscall32_callback_cs;
     6.9      unsigned short     sysenter_callback_cs;
    6.10 -    unsigned short     sysexit_cs;
    6.11      bool_t             syscall32_disables_events;
    6.12      bool_t             sysenter_disables_events;
    6.13  #endif
     7.1 --- a/xen/include/public/callback.h	Wed Oct 24 15:22:57 2007 +0100
     7.2 +++ b/xen/include/public/callback.h	Wed Oct 24 17:15:54 2007 +0100
     7.3 @@ -65,13 +65,6 @@
     7.4  #define CALLBACKTYPE_sysenter              5
     7.5  
     7.6  /*
     7.7 - * x86/64 hypervisor: used to fill a sysenter frame's return address, if the
     7.8 - * guest desires to have a non-NULL value there. If the guest kernel is
     7.9 - * 64-bit then the sysexit code selector is always set to FLAT_USER_CS32.
    7.10 - */
    7.11 -#define CALLBACKTYPE_sysexit               6
    7.12 -
    7.13 -/*
    7.14   * x86/64 hypervisor: Syscall by 32-bit guest app on AMD CPUs
    7.15   *                    ('32-on-32-on-64', '32-on-64-on-64')
    7.16   */