ia64/xen-unstable

changeset 12713:5091a9a55d86

[XEN] Only parse the crashkernel command line parameter once on boot
not each time it is requested.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Thu Nov 30 18:44:55 2006 +0000 (2006-11-30)
parents f6993ff5cf49
children 2e5291248789
files xen/arch/x86/setup.c xen/common/kexec.c
line diff
     1.1 --- a/xen/arch/x86/setup.c	Thu Nov 30 18:44:54 2006 +0000
     1.2 +++ b/xen/arch/x86/setup.c	Thu Nov 30 18:44:55 2006 +0000
     1.3 @@ -299,7 +299,6 @@ void __init __start_xen(multiboot_info_t
     1.4      unsigned long nr_pages, modules_length;
     1.5      paddr_t s, e;
     1.6      int i, e820_warn = 0, e820_raw_nr = 0, bytes = 0;
     1.7 -    xen_kexec_reserve_t crash_area;
     1.8      struct ns16550_defaults ns16550 = {
     1.9          .data_bits = 8,
    1.10          .parity    = 'n',
    1.11 @@ -480,8 +479,7 @@ void __init __start_xen(multiboot_info_t
    1.12  #endif
    1.13      }
    1.14  
    1.15 -    machine_kexec_reserved(&crash_area);
    1.16 -    if ( crash_area.size > 0 )
    1.17 +    if ( kexec_crash_area.size > 0 )
    1.18      {
    1.19          unsigned long kdump_start, kdump_size, k;
    1.20  
    1.21 @@ -489,8 +487,8 @@ void __init __start_xen(multiboot_info_t
    1.22  
    1.23          init_boot_pages(initial_images_start, initial_images_end);
    1.24  
    1.25 -        kdump_start = crash_area.start;
    1.26 -        kdump_size = crash_area.size;
    1.27 +        kdump_start = kexec_crash_area.start;
    1.28 +        kdump_size = kexec_crash_area.size;
    1.29  
    1.30          printk("Kdump: %luMB (%lukB) at 0x%lx\n",
    1.31                 kdump_size >> 20,
     2.1 --- a/xen/common/kexec.c	Thu Nov 30 18:44:54 2006 +0000
     2.2 +++ b/xen/common/kexec.c	Thu Nov 30 18:44:55 2006 +0000
     2.3 @@ -22,9 +22,6 @@
     2.4  #include <xen/version.h>
     2.5  #include <public/elfnote.h>
     2.6  
     2.7 -static char opt_crashkernel[32] = "";
     2.8 -string_param("crashkernel", opt_crashkernel);
     2.9 -
    2.10  DEFINE_PER_CPU (crash_note_t, crash_notes);
    2.11  cpumask_t crash_saved_cpus;
    2.12  int crashing_cpu;
    2.13 @@ -39,6 +36,26 @@ unsigned long kexec_flags = 0; /* the lo
    2.14  
    2.15  spinlock_t kexec_lock = SPIN_LOCK_UNLOCKED;
    2.16  
    2.17 +xen_kexec_reserve_t kexec_crash_area;
    2.18 +
    2.19 +static void __init parse_crashkernel(char *str)
    2.20 +{
    2.21 +    unsigned long start, size;
    2.22 +
    2.23 +    size = parse_size_and_unit(str, &str);
    2.24 +    if ( *str == '@' )
    2.25 +        start = parse_size_and_unit(str+1, NULL);
    2.26 +    else
    2.27 +        start = 0;
    2.28 +
    2.29 +    if ( start && size )
    2.30 +    {
    2.31 +        kexec_crash_area.start = start;
    2.32 +        kexec_crash_area.size = size;
    2.33 +    }
    2.34 +}
    2.35 +custom_param("crashkernel", parse_crashkernel);
    2.36 +
    2.37  static void one_cpu_only(void)
    2.38  {
    2.39     /* Only allow the first cpu to continue - force other cpus to spin */
    2.40 @@ -134,34 +151,10 @@ static __init int register_crashdump_tri
    2.41  }
    2.42  __initcall(register_crashdump_trigger);
    2.43  
    2.44 -void machine_kexec_reserved(xen_kexec_reserve_t *reservation)
    2.45 -{
    2.46 -    unsigned long start, size;
    2.47 -    char *str = opt_crashkernel;
    2.48 -
    2.49 -    memset(reservation, 0, sizeof(*reservation));
    2.50 -
    2.51 -    size = parse_size_and_unit(str, &str);
    2.52 -    if ( *str == '@' )
    2.53 -        start = parse_size_and_unit(str+1, NULL);
    2.54 -    else
    2.55 -        start = 0;
    2.56 -
    2.57 -    if ( start && size )
    2.58 -    {
    2.59 -        reservation->start = start;
    2.60 -        reservation->size = size;
    2.61 -    }
    2.62 -}
    2.63 -
    2.64  static int kexec_get_reserve(xen_kexec_range_t *range)
    2.65  {
    2.66 -    xen_kexec_reserve_t reservation;
    2.67 -
    2.68 -    machine_kexec_reserved(&reservation);
    2.69 -
    2.70 -    range->start = reservation.start;
    2.71 -    range->size = reservation.size;
    2.72 +    range->start = kexec_crash_area.start;
    2.73 +    range->size = kexec_crash_area.size;
    2.74      return 0;
    2.75  }
    2.76