ia64/xen-unstable

changeset 3702:d3e70af90f15

bitkeeper revision 1.1159.212.115 (4207c574hv18R_VTm-3a9w_AZzNBWw)

Force hypercall continuation arguments to size of longs.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Mon Feb 07 19:45:56 2005 +0000 (2005-02-07)
parents b11e02124f71
children 5f2499c315cd
files xen/arch/x86/domain.c xen/arch/x86/memory.c xen/arch/x86/traps.c xen/common/dom_mem_ops.c xen/common/multicall.c xen/include/xen/sched.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Mon Feb 07 19:12:35 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Mon Feb 07 19:45:56 2005 +0000
     1.3 @@ -628,7 +628,7 @@ long do_iopl(domid_t domain, unsigned in
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -unsigned long hypercall_create_continuation(
     1.8 +unsigned long __hypercall_create_continuation(
     1.9      unsigned int op, unsigned int nr_args, ...)
    1.10  {
    1.11      struct mc_state *mcs = &mc_state[smp_processor_id()];
     2.1 --- a/xen/arch/x86/memory.c	Mon Feb 07 19:12:35 2005 +0000
     2.2 +++ b/xen/arch/x86/memory.c	Mon Feb 07 19:45:56 2005 +0000
     2.3 @@ -1378,8 +1378,8 @@ int do_mmu_update(
     2.4      {
     2.5          if ( hypercall_preempt_check() )
     2.6          {
     2.7 -            rc = hypercall_create_continuation(
     2.8 -                __HYPERVISOR_mmu_update, 3, ureqs, 
     2.9 +            rc = hypercall3_create_continuation(
    2.10 +                __HYPERVISOR_mmu_update, ureqs, 
    2.11                  (count - i) |
    2.12                  (FOREIGNDOM->id << MMU_UPDATE_PREEMPT_FDOM_SHIFT) | 
    2.13                  MMU_UPDATE_PREEMPTED, pdone);
     3.1 --- a/xen/arch/x86/traps.c	Mon Feb 07 19:12:35 2005 +0000
     3.2 +++ b/xen/arch/x86/traps.c	Mon Feb 07 19:45:56 2005 +0000
     3.3 @@ -791,8 +791,8 @@ long do_set_trap_table(trap_info_t *trap
     3.4          if ( hypercall_preempt_check() )
     3.5          {
     3.6              UNLOCK_BIGLOCK(current->domain);
     3.7 -            return hypercall_create_continuation(
     3.8 -                __HYPERVISOR_set_trap_table, 1, traps);
     3.9 +            return hypercall1_create_continuation(
    3.10 +                __HYPERVISOR_set_trap_table, traps);
    3.11          }
    3.12  
    3.13          if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT;
     4.1 --- a/xen/common/dom_mem_ops.c	Mon Feb 07 19:12:35 2005 +0000
     4.2 +++ b/xen/common/dom_mem_ops.c	Mon Feb 07 19:45:56 2005 +0000
     4.3 @@ -25,8 +25,8 @@
     4.4  
     4.5  #define PREEMPT_CHECK(_op)                          \
     4.6      if ( hypercall_preempt_check() )                \
     4.7 -        return hypercall_create_continuation(       \
     4.8 -            __HYPERVISOR_dom_mem_op, 5,             \
     4.9 +        return hypercall5_create_continuation(      \
    4.10 +            __HYPERVISOR_dom_mem_op,                \
    4.11              (_op) | (i << START_EXTENT_SHIFT),      \
    4.12              extent_list, nr_extents, extent_order,  \
    4.13              (d == current->domain) ? DOMID_SELF : d->id);
     5.1 --- a/xen/common/multicall.c	Mon Feb 07 19:12:35 2005 +0000
     5.2 +++ b/xen/common/multicall.c	Mon Feb 07 19:45:56 2005 +0000
     5.3 @@ -67,8 +67,8 @@ long do_multicall(multicall_entry_t *cal
     5.4              if ( i < nr_calls )
     5.5              {
     5.6                  mcs->flags = 0;
     5.7 -                return hypercall_create_continuation(
     5.8 -                    __HYPERVISOR_multicall, 2, &call_list[i], nr_calls-i);
     5.9 +                return hypercall2_create_continuation(
    5.10 +                    __HYPERVISOR_multicall, &call_list[i], nr_calls-i);
    5.11              }
    5.12          }
    5.13      }
     6.1 --- a/xen/include/xen/sched.h	Mon Feb 07 19:12:35 2005 +0000
     6.2 +++ b/xen/include/xen/sched.h	Mon Feb 07 19:45:56 2005 +0000
     6.3 @@ -262,8 +262,32 @@ int idle_cpu(int cpu); /* Is CPU 'cpu' i
     6.4  
     6.5  void startup_cpu_idle_loop(void);
     6.6  
     6.7 -unsigned long hypercall_create_continuation(
     6.8 +unsigned long __hypercall_create_continuation(
     6.9      unsigned int op, unsigned int nr_args, ...);
    6.10 +#define hypercall0_create_continuation(_op)                               \
    6.11 +    __hypercall_create_continuation((_op), 0)
    6.12 +#define hypercall1_create_continuation(_op, _a1)                          \
    6.13 +    __hypercall_create_continuation((_op), 1,                             \
    6.14 +        (unsigned long)(_a1))
    6.15 +#define hypercall2_create_continuation(_op, _a1, _a2)                     \
    6.16 +    __hypercall_create_continuation((_op), 2,                             \
    6.17 +        (unsigned long)(_a1), (unsigned long)(_a2))
    6.18 +#define hypercall3_create_continuation(_op, _a1, _a2, _a3)                \
    6.19 +    __hypercall_create_continuation((_op), 3,                             \
    6.20 +        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3))
    6.21 +#define hypercall4_create_continuation(_op, _a1, _a2, _a3, _a4)           \
    6.22 +    __hypercall_create_continuation((_op), 4,                             \
    6.23 +        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
    6.24 +        (unsigned long)(_a4))
    6.25 +#define hypercall5_create_continuation(_op, _a1, _a2, _a3, _a4, _a5)      \
    6.26 +    __hypercall_create_continuation((_op), 5,                             \
    6.27 +        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
    6.28 +        (unsigned long)(_a4), (unsigned long)(_a5))
    6.29 +#define hypercall6_create_continuation(_op, _a1, _a2, _a3, _a4, _a5, _a6) \
    6.30 +    __hypercall_create_continuation((_op), 6,                             \
    6.31 +        (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \
    6.32 +        (unsigned long)(_a4), (unsigned long)(_a5), (unsigned long)(_a6))
    6.33 +
    6.34  #define hypercall_preempt_check() \
    6.35      (unlikely(softirq_pending(smp_processor_id())))
    6.36