ia64/xen-unstable

changeset 3106:75f82adfcc90

bitkeeper revision 1.1159.1.447 (41a4df5fq9WruAfvB3NCsqYGHixNRg)

Merge arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen.bk-smp
into arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen.bk-smp-public
author cl349@arcadians.cl.cam.ac.uk
date Wed Nov 24 19:22:07 2004 +0000 (2004-11-24)
parents f1c44a4d4998 f7a9de9a462f
children f4334d72515e 7add91b7232b
files BitKeeper/etc/ignore xen/arch/x86/domain.c xen/arch/x86/irq.c xen/arch/x86/memory.c xen/arch/x86/traps.c xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/seg_fixup.c xen/common/dom_mem_ops.c xen/common/grant_table.c xen/include/asm-x86/processor.h xen/include/xen/sched.h
line diff
     4.1 --- a/xen/arch/x86/memory.c	Wed Nov 24 13:38:44 2004 +0000
     4.2 +++ b/xen/arch/x86/memory.c	Wed Nov 24 19:22:07 2004 +0000
     4.3 @@ -1307,7 +1307,7 @@ int do_mmu_update(mmu_update_t *ureqs, i
     4.4  
     4.5      for ( i = 0; i < count; i++ )
     4.6      {
     4.7 -        hypercall_may_preempt(
     4.8 +        locked_hypercall_may_preempt(d,
     4.9              __HYPERVISOR_mmu_update, 3, ureqs, count-i, success_count);
    4.10  
    4.11          if ( unlikely(__copy_from_user(&req, ureqs, sizeof(req)) != 0) )
     5.1 --- a/xen/arch/x86/traps.c	Wed Nov 24 13:38:44 2004 +0000
     5.2 +++ b/xen/arch/x86/traps.c	Wed Nov 24 19:22:07 2004 +0000
     5.3 @@ -814,7 +814,8 @@ long do_set_trap_table(trap_info_t *trap
     5.4  
     5.5      for ( ; ; )
     5.6      {
     5.7 -        hypercall_may_preempt(__HYPERVISOR_set_trap_table, 1, traps);
     5.8 +        locked_hypercall_may_preempt(current->domain,
     5.9 +                                     __HYPERVISOR_set_trap_table, 1, traps);
    5.10  
    5.11          if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT;
    5.12  
     7.1 --- a/xen/arch/x86/x86_32/entry.S	Wed Nov 24 13:38:44 2004 +0000
     7.2 +++ b/xen/arch/x86/x86_32/entry.S	Wed Nov 24 19:22:07 2004 +0000
     7.3 @@ -96,7 +96,7 @@ do_multicall:
     7.4  multicall_loop:
     7.5          pushl %ecx
     7.6          movl  4(%esp),%ecx               # %ecx = struct domain
     7.7 -        movl  DOMAIN_processor(%ecx),%eax
     7.8 +        movl  EDOMAIN_processor(%ecx),%eax
     7.9          shl   $6,%eax                    # sizeof(irq_cpustat) == 64
    7.10          testl $~0,SYMBOL_NAME(irq_stat)(%eax,1)
    7.11          jnz   multicall_preempt
    7.12 @@ -172,7 +172,7 @@ multicall_fixup1:
    7.13                  
    7.14          ALIGN
    7.15  restore_all_guest:
    7.16 -        testb $TF_failsafe_return,DOMAIN_thread_flags(%ebx)
    7.17 +        testb $TF_failsafe_return,EDOMAIN_thread_flags(%ebx)
    7.18          jnz  failsafe_callback
    7.19  FLT1:   movl XREGS_ds(%esp),%ds
    7.20  FLT2:   movl XREGS_es(%esp),%es
    7.21 @@ -212,9 +212,9 @@ FIX1:   SET_XEN_SEGMENTS(a)
    7.22  DBLFLT1:GET_CURRENT(%ebx)
    7.23          jmp   test_all_events
    7.24  DBLFIX1:GET_CURRENT(%ebx)
    7.25 -        testb $TF_failsafe_return,DOMAIN_thread_flags(%ebx)
    7.26 +        testb $TF_failsafe_return,EDOMAIN_thread_flags(%ebx)
    7.27          jnz   domain_crash             # cannot reenter failsafe code
    7.28 -        orb   $TF_failsafe_return,DOMAIN_thread_flags(%ebx)
    7.29 +        orb   $TF_failsafe_return,EDOMAIN_thread_flags(%ebx)
    7.30          jmp   test_all_events          # will return via failsafe code
    7.31  .previous
    7.32  .section __pre_ex_table,"a"
    7.33 @@ -251,7 +251,7 @@ FLT6:   iret
    7.34  .section .fixup,"ax"
    7.35  FIX6:   pushl %ebx
    7.36          GET_CURRENT(%ebx)
    7.37 -        orb   $TF_failsafe_return,DOMAIN_thread_flags(%ebx)
    7.38 +        orb   $TF_failsafe_return,EDOMAIN_thread_flags(%ebx)
    7.39          pop   %ebx
    7.40          jmp   FIX5
    7.41  .section __pre_ex_table,"a"
     9.1 --- a/xen/common/dom_mem_ops.c	Wed Nov 24 13:38:44 2004 +0000
     9.2 +++ b/xen/common/dom_mem_ops.c	Wed Nov 24 19:22:07 2004 +0000
     9.3 @@ -39,7 +39,7 @@ static long alloc_dom_mem(struct domain 
     9.4              __HYPERVISOR_dom_mem_op, 5,
     9.5              MEMOP_increase_reservation,
     9.6              &extent_list[i], nr_extents-i, extent_order,
     9.7 -            (d == current) ? DOMID_SELF : d->id);
     9.8 +            (d == current->domain) ? DOMID_SELF : d->id);
     9.9  
    9.10          if ( unlikely((page = alloc_domheap_pages(d, extent_order)) == NULL) )
    9.11          {
    9.12 @@ -73,7 +73,7 @@ static long free_dom_mem(struct domain *
    9.13              __HYPERVISOR_dom_mem_op, 5,
    9.14              MEMOP_decrease_reservation,
    9.15              &extent_list[i], nr_extents-i, extent_order,
    9.16 -            (d == current) ? DOMID_SELF : d->id);
    9.17 +            (d == current->domain) ? DOMID_SELF : d->id);
    9.18  
    9.19          if ( unlikely(__get_user(mpfn, &extent_list[i]) != 0) )
    9.20              return i;
    12.1 --- a/xen/include/xen/sched.h	Wed Nov 24 13:38:44 2004 +0000
    12.2 +++ b/xen/include/xen/sched.h	Wed Nov 24 19:22:07 2004 +0000
    12.3 @@ -263,6 +263,13 @@ void hypercall_create_continuation(unsig
    12.4              hypercall_create_continuation(_op , _nr_args , ##_args); \
    12.5              return _op;                                              \
    12.6      } } while ( 0 )
    12.7 +#define locked_hypercall_may_preempt(_d, _op, _nr_args, _args...)    \
    12.8 +    do {                                                             \
    12.9 +        if ( unlikely(softirq_pending(smp_processor_id())) ) {       \
   12.10 +            hypercall_create_continuation(_op , _nr_args , ##_args); \
   12.11 +            UNLOCK_BIGLOCK(_d);                                      \
   12.12 +            return _op;                                              \
   12.13 +    } } while ( 0 )
   12.14  
   12.15  /* This domain_hash and domain_list are protected by the domlist_lock. */
   12.16  #define DOMAIN_HASH_SIZE 256