ia64/xen-unstable

changeset 12399:e821c15b7cfe

[HVM] vlapic: No use of domain_crash_synchronous().
The safer domain_crash() is sufficient.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Nov 10 18:27:35 2006 +0000 (2006-11-10)
parents fda15861731e
children 5bdd8b5e3a1f
files xen/arch/x86/hvm/vlapic.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vlapic.c	Fri Nov 10 18:20:49 2006 +0000
     1.2 +++ b/xen/arch/x86/hvm/vlapic.c	Fri Nov 10 18:27:35 2006 +0000
     1.3 @@ -322,7 +322,7 @@ static int vlapic_accept_irq(struct vcpu
     1.4          if ( test_and_clear_bit(_VCPUF_initialised, &v->vcpu_flags) )
     1.5          {
     1.6              gdprintk(XENLOG_ERR, "Reset hvm vcpu not supported yet\n");
     1.7 -            domain_crash_synchronous();
     1.8 +            goto exit_and_crash;
     1.9          }
    1.10          v->arch.hvm_vcpu.init_sipi_sipi_state =
    1.11              HVM_VCPU_INIT_SIPI_SIPI_STATE_WAIT_SIPI;
    1.12 @@ -340,7 +340,7 @@ static int vlapic_accept_irq(struct vcpu
    1.13          if ( test_bit(_VCPUF_initialised, &v->vcpu_flags) )
    1.14          {
    1.15              gdprintk(XENLOG_ERR, "SIPI for initialized vcpu %x\n", v->vcpu_id);
    1.16 -            domain_crash_synchronous();
    1.17 +            goto exit_and_crash;
    1.18          }
    1.19  
    1.20          if ( hvm_bringup_ap(v->vcpu_id, vector) != 0 )
    1.21 @@ -350,11 +350,14 @@ static int vlapic_accept_irq(struct vcpu
    1.22      default:
    1.23          gdprintk(XENLOG_ERR, "TODO: unsupported delivery mode %x\n",
    1.24                   delivery_mode);
    1.25 -        domain_crash_synchronous();
    1.26 -        break;
    1.27 +        goto exit_and_crash;
    1.28      }
    1.29  
    1.30      return result;
    1.31 +
    1.32 + exit_and_crash:
    1.33 +    domain_crash(v->domain);
    1.34 +    return 0;
    1.35  }
    1.36  
    1.37  /* This function is used by both ioapic and lapic.The bitmap is for vcpu_id. */
    1.38 @@ -568,14 +571,17 @@ static unsigned long vlapic_read(struct 
    1.39      default:
    1.40          gdprintk(XENLOG_ERR, "Local APIC read with len=0x%lx, "
    1.41                   "should be 4 instead.\n", len);
    1.42 -        domain_crash_synchronous();
    1.43 -        break;
    1.44 +        goto exit_and_crash;
    1.45      }
    1.46  
    1.47      HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset 0x%x with length 0x%lx, "
    1.48                  "and the result is 0x%lx.", offset, len, result);
    1.49  
    1.50      return result;
    1.51 +
    1.52 + exit_and_crash:
    1.53 +    domain_crash(v->domain);
    1.54 +    return 0;
    1.55  }
    1.56  
    1.57  static void vlapic_write(struct vcpu *v, unsigned long address,
    1.58 @@ -615,7 +621,7 @@ static void vlapic_write(struct vcpu *v,
    1.59              {
    1.60                  gdprintk(XENLOG_ERR, "Uneven alignment error for "
    1.61                           "2-byte vlapic access\n");
    1.62 -                domain_crash_synchronous();
    1.63 +                goto exit_and_crash;
    1.64              }
    1.65  
    1.66              val = (tmp & ~(0xffff << (8*alignment))) |
    1.67 @@ -625,8 +631,9 @@ static void vlapic_write(struct vcpu *v,
    1.68          default:
    1.69              gdprintk(XENLOG_ERR, "Local APIC write with len = %lx, "
    1.70                       "should be 4 instead\n", len);
    1.71 -            domain_crash_synchronous();
    1.72 -            break;
    1.73 +        exit_and_crash:
    1.74 +            domain_crash(v->domain);
    1.75 +            return;
    1.76          }
    1.77      }
    1.78