debuggers.hg

changeset 21224:6eda8033bb6d

continue_hypercall_on_cpu() always defers execution of the continuation

...even when scheduled to run on the current physical cpu. This
ensures that locks get dropped correctly before executing the
continuation code, and also allows the original caller to determine
whether the continuation has/will execute based on c_h_o_c()'s
immediate return code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 15 11:31:58 2010 +0100 (2010-04-15)
parents 93ac55cf3e40
children 85ab727868ea
files xen/common/domain.c xen/include/xen/domain.h
line diff
     1.1 --- a/xen/common/domain.c	Thu Apr 15 09:04:45 2010 +0100
     1.2 +++ b/xen/common/domain.c	Thu Apr 15 11:31:58 2010 +0100
     1.3 @@ -951,9 +951,6 @@ int continue_hypercall_on_cpu(
     1.4      if ( (cpu >= NR_CPUS) || !cpu_online(cpu) )
     1.5          return -EINVAL;
     1.6  
     1.7 -    if ( cpu == smp_processor_id() )
     1.8 -        return func(data);
     1.9 -
    1.10      info = this_cpu(continue_info);
    1.11      if ( info == NULL )
    1.12      {
     2.1 --- a/xen/include/xen/domain.h	Thu Apr 15 09:04:45 2010 +0100
     2.2 +++ b/xen/include/xen/domain.h	Thu Apr 15 11:31:58 2010 +0100
     2.3 @@ -63,7 +63,12 @@ void arch_vcpu_reset(struct vcpu *v);
     2.4  bool_t domctl_lock_acquire(void);
     2.5  void domctl_lock_release(void);
     2.6  
     2.7 -/* Continue the current hypercall via func(data) on specified cpu. */
     2.8 +/*
     2.9 + * Continue the current hypercall via func(data) on specified cpu.
    2.10 + * If this function returns 0 then the function is guaranteed to run at some
    2.11 + * point in the future. If this function returns an error code then the
    2.12 + * function has not been and will not be executed.
    2.13 + */
    2.14  int continue_hypercall_on_cpu(
    2.15      unsigned int cpu, long (*func)(void *data), void *data);
    2.16