direct-io.hg

changeset 3780:f368e743fc2e

bitkeeper revision 1.1159.1.568 (420ba33bo4Ly13qI5cHgZttHha5_-g)

Change do_set_callbacks hypercall for x86/64 to not take any selector
values, but to take a syscall_entry point.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 10 18:08:59 2005 +0000 (2005-02-10)
parents e03bd6b89965
children 1d13ed9582e0
files xen/arch/x86/traps.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/asm-offsets.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/traps.c xen/include/asm-x86/domain.h
line diff
     1.1 --- a/xen/arch/x86/traps.c	Thu Feb 10 18:08:11 2005 +0000
     1.2 +++ b/xen/arch/x86/traps.c	Thu Feb 10 18:08:59 2005 +0000
     1.3 @@ -808,25 +808,6 @@ long do_set_trap_table(trap_info_t *trap
     1.4  }
     1.5  
     1.6  
     1.7 -long do_set_callbacks(unsigned long event_selector,
     1.8 -                      unsigned long event_address,
     1.9 -                      unsigned long failsafe_selector,
    1.10 -                      unsigned long failsafe_address)
    1.11 -{
    1.12 -    struct exec_domain *d = current;
    1.13 -
    1.14 -    if ( !VALID_CODESEL(event_selector) || !VALID_CODESEL(failsafe_selector) )
    1.15 -        return -EPERM;
    1.16 -
    1.17 -    d->arch.event_selector    = event_selector;
    1.18 -    d->arch.event_address     = event_address;
    1.19 -    d->arch.failsafe_selector = failsafe_selector;
    1.20 -    d->arch.failsafe_address  = failsafe_address;
    1.21 -
    1.22 -    return 0;
    1.23 -}
    1.24 -
    1.25 -
    1.26  long do_fpu_taskswitch(void)
    1.27  {
    1.28      set_bit(EDF_GUEST_STTS, &current->ed_flags);
     2.1 --- a/xen/arch/x86/x86_32/traps.c	Thu Feb 10 18:08:11 2005 +0000
     2.2 +++ b/xen/arch/x86/x86_32/traps.c	Thu Feb 10 18:08:59 2005 +0000
     2.3 @@ -274,3 +274,21 @@ long do_set_fast_trap(int idx)
     2.4  {
     2.5      return set_fast_trap(current, idx);
     2.6  }
     2.7 +
     2.8 +long do_set_callbacks(unsigned long event_selector,
     2.9 +                      unsigned long event_address,
    2.10 +                      unsigned long failsafe_selector,
    2.11 +                      unsigned long failsafe_address)
    2.12 +{
    2.13 +    struct exec_domain *d = current;
    2.14 +
    2.15 +    if ( !VALID_CODESEL(event_selector) || !VALID_CODESEL(failsafe_selector) )
    2.16 +        return -EPERM;
    2.17 +
    2.18 +    d->arch.event_selector    = event_selector;
    2.19 +    d->arch.event_address     = event_address;
    2.20 +    d->arch.failsafe_selector = failsafe_selector;
    2.21 +    d->arch.failsafe_address  = failsafe_address;
    2.22 +
    2.23 +    return 0;
    2.24 +}
     3.1 --- a/xen/arch/x86/x86_64/asm-offsets.c	Thu Feb 10 18:08:11 2005 +0000
     3.2 +++ b/xen/arch/x86/x86_64/asm-offsets.c	Thu Feb 10 18:08:59 2005 +0000
     3.3 @@ -43,10 +43,9 @@ void __dummy__(void)
     3.4  
     3.5      OFFSET(EDOMAIN_processor, struct exec_domain, processor);
     3.6      OFFSET(EDOMAIN_vcpu_info, struct exec_domain, vcpu_info);
     3.7 -    OFFSET(EDOMAIN_event_sel, struct exec_domain, arch.event_selector);
     3.8      OFFSET(EDOMAIN_event_addr, struct exec_domain, arch.event_address);
     3.9 -    OFFSET(EDOMAIN_failsafe_sel, struct exec_domain, arch.failsafe_selector);
    3.10      OFFSET(EDOMAIN_failsafe_addr, struct exec_domain, arch.failsafe_address);
    3.11 +    OFFSET(EDOMAIN_syscall_addr, struct exec_domain, arch.syscall_address);
    3.12      OFFSET(EDOMAIN_trap_bounce, struct exec_domain, arch.trap_bounce);
    3.13      OFFSET(EDOMAIN_thread_flags, struct exec_domain, arch.flags);
    3.14      OFFSET(EDOMAIN_kernel_sp, struct exec_domain, arch.kernel_sp);
     4.1 --- a/xen/arch/x86/x86_64/entry.S	Thu Feb 10 18:08:11 2005 +0000
     4.2 +++ b/xen/arch/x86/x86_64/entry.S	Thu Feb 10 18:08:59 2005 +0000
     4.3 @@ -104,12 +104,15 @@ ENTRY(syscall_enter)
     4.4          movl  $TRAP_syscall,4(%rsp)
     4.5          SAVE_ALL
     4.6          GET_CURRENT(%rbx)
     4.7 -        bts   $_TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
     4.8 -        jc    hypercall
     4.9 -        swapgs
    4.10 -        movq  %rbx,%rdi
    4.11 -        call  SYMBOL_NAME(write_ptbase)
    4.12 -        jmp   restore_all_guest
    4.13 +        testb $TF_kernel_mode,EDOMAIN_thread_flags(%rbx)
    4.14 +        jnz   hypercall
    4.15 +
    4.16 +        leaq  EDOMAIN_trap_bounce(%rbx),%rdx
    4.17 +        movq  EDOMAIN_syscall_addr(%rbx),%rax
    4.18 +        movq  %rax,TRAPBOUNCE_eip(%rdx)
    4.19 +        movw  $0,TRAPBOUNCE_flags(%rdx)
    4.20 +        pushq restore_all_guest(%rip)
    4.21 +        jmp   create_bounce_frame
    4.22  
    4.23  hypercall:
    4.24          sti
     5.1 --- a/xen/arch/x86/x86_64/traps.c	Thu Feb 10 18:08:11 2005 +0000
     5.2 +++ b/xen/arch/x86/x86_64/traps.c	Thu Feb 10 18:08:59 2005 +0000
     5.3 @@ -256,3 +256,16 @@ void *decode_reg(struct xen_regs *regs, 
     5.4  
     5.5      return NULL;
     5.6  }
     5.7 +
     5.8 +long do_set_callbacks(unsigned long event_address,
     5.9 +                      unsigned long failsafe_address,
    5.10 +                      unsigned long syscall_address)
    5.11 +{
    5.12 +    struct exec_domain *d = current;
    5.13 +
    5.14 +    d->arch.event_address    = event_address;
    5.15 +    d->arch.failsafe_address = failsafe_address;
    5.16 +    d->arch.syscall_address  = syscall_address;
    5.17 +
    5.18 +    return 0;
    5.19 +}
     6.1 --- a/xen/include/asm-x86/domain.h	Thu Feb 10 18:08:11 2005 +0000
     6.2 +++ b/xen/include/asm-x86/domain.h	Thu Feb 10 18:08:59 2005 +0000
     6.3 @@ -68,12 +68,15 @@ struct arch_exec_domain
     6.4       * for segment registers %ds, %es, %fs and %gs:
     6.5       * 	%ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss]
     6.6       */
     6.7 -    unsigned long event_selector;    /* entry CS  */
     6.8 +
     6.9 +    unsigned long event_selector;    /* entry CS  (x86/32 only) */
    6.10      unsigned long event_address;     /* entry EIP */
    6.11  
    6.12 -    unsigned long failsafe_selector; /* entry CS  */
    6.13 +    unsigned long failsafe_selector; /* entry CS  (x86/32 only) */
    6.14      unsigned long failsafe_address;  /* entry EIP */
    6.15  
    6.16 +    unsigned long syscall_address;   /* entry EIP (x86/64 only) */
    6.17 +
    6.18      /* Bounce information for propagating an exception to guest OS. */
    6.19      struct trap_bounce trap_bounce;
    6.20