ia64/xen-unstable

changeset 4850:923dd9975981

bitkeeper revision 1.1389.17.1 (42823056RNtq4AlseRHL98DJV2uJgA)

Change the Xen command-line parameter syntax. 'noacpi' and
'ignorebiostables' are gone. 'dom0_mem' can optionally take a k/m/g
suffix to specify units (default units are still kilobytes).

Also added:
1. 'mem=xxx' to specify maximum physical RAM address (supports
k/m/g suffix)
2. acpi=xxx/acpi_skip_timer_override/noapic: These all have same
semantics as in Linux. They are *automatically* propagated to
the domain0 command line, as dom0 shares resposibility for
platform initialisation.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 11 16:18:30 2005 +0000 (2005-05-11)
parents 3ac0994c8240
children e40fb9ae58cf
files docs/src/user.tex xen/arch/ia64/xensetup.c xen/arch/x86/domain_build.c xen/arch/x86/e820.c xen/arch/x86/setup.c xen/arch/x86/smpboot.c xen/common/kernel.c xen/common/lib.c xen/include/asm-x86/acpi.h xen/include/xen/init.h xen/include/xen/lib.h
line diff
     1.1 --- a/docs/src/user.tex	Wed May 11 14:15:56 2005 +0000
     1.2 +++ b/docs/src/user.tex	Wed May 11 16:18:30 2005 +0000
     1.3 @@ -484,7 +484,7 @@ distribution.  The entry should look som
     1.4  {\small
     1.5  \begin{verbatim}
     1.6  title Xen 2.0 / XenLinux 2.6.9
     1.7 -  kernel /boot/xen.gz dom0_mem=131072
     1.8 +  kernel /boot/xen.gz dom0_mem=128M
     1.9    module /boot/vmlinuz-2.6.9-xen0 root=/dev/sda4 ro console=tty0
    1.10  \end{verbatim}
    1.11  }
    1.12 @@ -524,7 +524,7 @@ have problems.
    1.13  
    1.14  \subsection{Serial Console (optional)}
    1.15  
    1.16 -%%   kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1
    1.17 +%%   kernel /boot/xen.gz dom0_mem=128M com1=115200,8n1
    1.18  %%   module /boot/vmlinuz-2.6.9-xen0 root=/dev/sda4 ro 
    1.19  
    1.20  
    1.21 @@ -534,9 +534,9 @@ with:
    1.22  \begin{quote}
    1.23  {\small
    1.24  \begin{verbatim}
    1.25 -   kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1
    1.26 +   kernel /boot/xen.gz dom0_mem=128M com1=115200,8n1
    1.27  \end{verbatim}}
    1.28 -\end{quote} 
    1.29 +\end{quote}
    1.30  
    1.31  This configures Xen to output on COM1 at 115,200 baud, 8 data bits, 
    1.32  1 stop bit and no parity. Modify these parameters for your set up. 
    1.33 @@ -1680,12 +1680,6 @@ should be appended to Xen's command line
    1.34  editing \path{grub.conf}.
    1.35  
    1.36  \begin{description}
    1.37 -\item [ignorebiostables ] 
    1.38 - Disable parsing of BIOS-supplied tables. This may help with some
    1.39 - chipsets that aren't fully supported by Xen. If you specify this
    1.40 - option then ACPI tables are also ignored, and SMP support is
    1.41 - disabled. 
    1.42 -
    1.43  \item [noreboot ] 
    1.44   Don't reboot the machine automatically on errors.  This is
    1.45   useful to catch debug output if you aren't catching console messages
    1.46 @@ -1695,10 +1689,6 @@ editing \path{grub.conf}.
    1.47   Disable SMP support.
    1.48   This option is implied by `ignorebiostables'. 
    1.49  
    1.50 -\item [noacpi ] 
    1.51 - Disable ACPI tables, which confuse Xen on some chipsets.
    1.52 - This option is implied by `ignorebiostables'. 
    1.53 -
    1.54  \item [watchdog ] 
    1.55   Enable NMI watchdog which can report certain failures. 
    1.56  
    1.57 @@ -1756,8 +1746,16 @@ editing \path{grub.conf}.
    1.58   `nmi=dom0':   Inform DOM0 of the NMI. \\
    1.59   `nmi=ignore': Ignore the NMI. 
    1.60  
    1.61 +\item [mem=xxx ]
    1.62 + Set the physical RAM address limit. Any RAM appearing beyond this
    1.63 + physical address in the memory map will be ignored. This parameter
    1.64 + may be specified with a {\bf k}, {\bf m} or {\bf g} suffix. The
    1.65 + default unit, if no suffix is specified, is bytes.
    1.66 +
    1.67  \item [dom0\_mem=xxx ] 
    1.68 - Set the amount of memory (in kB) to be allocated to domain0.  
    1.69 + Set the amount of memory to be allocated to domain0. This parameter
    1.70 + may be specified with a {\bf k}, {\bf m} or {\bf g} suffix. The 
    1.71 + default unit, if no suffix is specified, is kilobytes.
    1.72  
    1.73  \item [tbuf\_size=xxx ] 
    1.74   Set the size of the per-cpu trace buffers, in pages
    1.75 @@ -1769,16 +1767,29 @@ editing \path{grub.conf}.
    1.76   Select the CPU scheduler Xen should use.  The current
    1.77   possibilities are `bvt' (default), `atropos' and `rrobin'. 
    1.78   For more information see Section~\ref{s:sched}. 
    1.79 -
    1.80 -\item [physdev\_dom0\_hide=(xx:xx.x)(yy:yy.y)\ldots ]
    1.81 -Hide selected PCI devices from domain 0 (for instance, to stop it
    1.82 -taking ownership of them so that they can be driven by another
    1.83 -domain).  Device IDs should be given in hex format.  Bridge devices do
    1.84 -not need to be hidden --- they are hidden implicitly, since guest OSes
    1.85 -do not need to configure them.
    1.86  \end{description} 
    1.87  
    1.88 -
    1.89 +In addition, the following platform-specific options may be specified
    1.90 +on the Xen command line. Since domain 0 shares responsibility for
    1.91 +booting the platform, Xen will automatically propagate these options
    1.92 +to its command line.
    1.93 +
    1.94 +These options are taken from Linux's command-line syntax with
    1.95 +unchanged semantics.
    1.96 +
    1.97 +\begin{description}
    1.98 +\item [acpi=off,force,strict,ht,noirq,\ldots ] 
    1.99 + Modify how Xen (and domain 0) parses the BIOS ACPI tables.
   1.100 +
   1.101 +\item [acpi\_skip\_timer\_override ]
   1.102 + Instruct Xen (and domain 0) to ignore timer-interrupt override
   1.103 + instructions specified by the BIOS ACPI tables.
   1.104 +
   1.105 +\item [noapic ]
   1.106 + Instruct Xen (and domain 0) to ignore any IOAPICs that are present in
   1.107 + the system, and instead continue to use the legacy PIC.
   1.108 +
   1.109 +\end{description} 
   1.110  
   1.111  \section{XenLinux Boot Options}
   1.112  
     2.1 --- a/xen/arch/ia64/xensetup.c	Wed May 11 14:15:56 2005 +0000
     2.2 +++ b/xen/arch/ia64/xensetup.c	Wed May 11 16:18:30 2005 +0000
     2.3 @@ -52,15 +52,10 @@ unsigned char opt_com1[30] = "", opt_com
     2.4  unsigned int opt_dom0_mem = 16000;
     2.5  /* opt_noht: If true, Hyperthreading is ignored. */
     2.6  int opt_noht=0;
     2.7 -/* opt_noacpi: If true, ACPI tables are not parsed. */
     2.8 -int opt_noacpi=0;
     2.9  /* opt_nosmp: If true, secondary processors are ignored. */
    2.10  int opt_nosmp=0;
    2.11  /* opt_noreboot: If true, machine will need manual reset on error. */
    2.12  int opt_noreboot=0;
    2.13 -/* opt_ignorebiostables: If true, ACPI and MP tables are ignored. */
    2.14 -/* NB. This flag implies 'nosmp' and 'noacpi'. */
    2.15 -int opt_ignorebiostables=0;
    2.16  /* opt_watchdog: If true, run a watchdog NMI on each processor. */
    2.17  int opt_watchdog=0;
    2.18  /* opt_pdb: Name of serial port for Xen pervasive debugger (and enable pdb) */
     3.1 --- a/xen/arch/x86/domain_build.c	Wed May 11 14:15:56 2005 +0000
     3.2 +++ b/xen/arch/x86/domain_build.c	Wed May 11 16:18:30 2005 +0000
     3.3 @@ -7,6 +7,7 @@
     3.4  #include <xen/config.h>
     3.5  #include <xen/init.h>
     3.6  #include <xen/lib.h>
     3.7 +#include <xen/ctype.h>
     3.8  #include <xen/sched.h>
     3.9  #include <xen/smp.h>
    3.10  #include <xen/delay.h>
    3.11 @@ -21,9 +22,18 @@
    3.12  #include <asm/i387.h>
    3.13  #include <asm/shadow.h>
    3.14  
    3.15 -/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
    3.16 -static unsigned int opt_dom0_mem = 0;
    3.17 -integer_unit_param("dom0_mem", opt_dom0_mem);
    3.18 +/* opt_dom0_mem: memory allocated to domain 0. */
    3.19 +static unsigned int opt_dom0_mem;
    3.20 +static void parse_dom0_mem(char *s)
    3.21 +{
    3.22 +    unsigned long long bytes = memparse(s);
    3.23 +    /* If no unit is specified we default to kB units, not bytes. */
    3.24 +    if ( isdigit(s[strlen(s)-1]) )
    3.25 +        opt_dom0_mem = (unsigned int)bytes;
    3.26 +    else
    3.27 +        opt_dom0_mem = (unsigned int)(bytes >> 10);
    3.28 +}
    3.29 +custom_param("dom0_mem", parse_dom0_mem);
    3.30  
    3.31  static unsigned int opt_dom0_shadow = 0;
    3.32  boolean_param("dom0_shadow", opt_dom0_shadow);
     4.1 --- a/xen/arch/x86/e820.c	Wed May 11 14:15:56 2005 +0000
     4.2 +++ b/xen/arch/x86/e820.c	Wed May 11 16:18:30 2005 +0000
     4.3 @@ -3,6 +3,11 @@
     4.4  #include <xen/lib.h>
     4.5  #include <asm/e820.h>
     4.6  
     4.7 +/* opt_mem: Limit of physical RAM. Any RAM beyond this point is ignored. */
     4.8 +unsigned long long opt_mem;
     4.9 +static void parse_mem(char *s) { opt_mem = memparse(s); }
    4.10 +custom_param("mem", parse_mem);
    4.11 +
    4.12  struct e820map e820;
    4.13  
    4.14  static void __init add_memory_region(unsigned long long start,
    4.15 @@ -341,6 +346,31 @@ static void __init clip_4gb(void)
    4.16  #define clip_4gb() ((void)0)
    4.17  #endif
    4.18  
    4.19 +static void __init clip_mem(void)
    4.20 +{
    4.21 +    int i;
    4.22 +
    4.23 +    if ( !opt_mem )
    4.24 +        return;
    4.25 +
    4.26 +    for ( i = 0; i < e820.nr_map; i++ )
    4.27 +    {
    4.28 +        if ( (e820.map[i].addr + e820.map[i].size) <= opt_mem )
    4.29 +            continue;
    4.30 +        printk("Truncating memory map to %lukB\n",
    4.31 +               (unsigned long)(opt_mem >> 10));
    4.32 +        if ( e820.map[i].addr >= opt_mem )
    4.33 +        {
    4.34 +            e820.nr_map = i;
    4.35 +        }
    4.36 +        else
    4.37 +        {
    4.38 +            e820.map[i].size = opt_mem - e820.map[i].addr;
    4.39 +            e820.nr_map = i + 1;          
    4.40 +        }
    4.41 +    }
    4.42 +}
    4.43 +
    4.44  static void __init machine_specific_memory_setup(
    4.45      struct e820entry *raw, int raw_nr)
    4.46  {
    4.47 @@ -348,6 +378,7 @@ static void __init machine_specific_memo
    4.48      sanitize_e820_map(raw, &nr);
    4.49      (void)copy_e820_map(raw, nr);
    4.50      clip_4gb();
    4.51 +    clip_mem();
    4.52  }
    4.53  
    4.54  unsigned long __init init_e820(struct e820entry *raw, int raw_nr)
     5.1 --- a/xen/arch/x86/setup.c	Wed May 11 14:15:56 2005 +0000
     5.2 +++ b/xen/arch/x86/setup.c	Wed May 11 16:18:30 2005 +0000
     5.3 @@ -33,23 +33,29 @@ integer_param("xenheap_megabytes", opt_x
     5.4  int opt_noht = 0;
     5.5  boolean_param("noht", opt_noht);
     5.6  
     5.7 -/* opt_noacpi: If true, ACPI tables are not parsed. */
     5.8 -static int opt_noacpi = 0;
     5.9 -boolean_param("noacpi", opt_noacpi);
    5.10 -
    5.11 -/* opt_nosmp: If true, secondary processors are ignored. */
    5.12 -static int opt_nosmp = 0;
    5.13 -boolean_param("nosmp", opt_nosmp);
    5.14 -
    5.15 -/* opt_ignorebiostables: If true, ACPI and MP tables are ignored. */
    5.16 -/* NB. This flag implies 'nosmp' and 'noacpi'. */
    5.17 -static int opt_ignorebiostables = 0;
    5.18 -boolean_param("ignorebiostables", opt_ignorebiostables);
    5.19 -
    5.20  /* opt_watchdog: If true, run a watchdog NMI on each processor. */
    5.21  static int opt_watchdog = 0;
    5.22  boolean_param("watchdog", opt_watchdog);
    5.23  
    5.24 +/* **** Linux config option: propagated to domain0. */
    5.25 +/* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
    5.26 +/* "acpi=force":  Override the disable blacklist.                   */
    5.27 +/* "acpi=strict": Disables out-of-spec workarounds.                 */
    5.28 +/* "acpi=ht":     Limit ACPI just to boot-time to enable HT.        */
    5.29 +/* "acpi=noirq":  Disables ACPI interrupt routing.                  */
    5.30 +static void parse_acpi_param(char *s);
    5.31 +custom_param("acpi", parse_acpi_param);
    5.32 +
    5.33 +/* **** Linux config option: propagated to domain0. */
    5.34 +/* acpi_skip_timer_override: Skip IRQ0 overrides. */
    5.35 +extern int acpi_skip_timer_override;
    5.36 +boolean_param("acpi_skip_timer_override", acpi_skip_timer_override);
    5.37 +
    5.38 +/* **** Linux config option: propagated to domain0. */
    5.39 +/* noapic: Disable IOAPIC setup. */
    5.40 +extern int skip_ioapic_setup;
    5.41 +boolean_param("noapic", skip_ioapic_setup);
    5.42 +
    5.43  int early_boot = 1;
    5.44  
    5.45  unsigned long xenheap_phys_end;
    5.46 @@ -62,7 +68,6 @@ extern void ac_timer_init(void);
    5.47  extern void initialize_keytable();
    5.48  extern int do_timer_lists_from_pit;
    5.49  
    5.50 -char ignore_irq13; /* set if exception 16 works */
    5.51  struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 };
    5.52  
    5.53  #if defined(__x86_64__)
    5.54 @@ -328,6 +333,41 @@ void __init cpu_init(void)
    5.55      init_idle_task();
    5.56  }
    5.57  
    5.58 +int acpi_force;
    5.59 +char acpi_param[10] = "";
    5.60 +static void parse_acpi_param(char *s)
    5.61 +{
    5.62 +    /* Save the parameter so it can be propagated to domain0. */
    5.63 +    strncpy(acpi_param, s, sizeof(acpi_param));
    5.64 +    acpi_param[sizeof(acpi_param)-1] = '\0';
    5.65 +
    5.66 +    /* Interpret the parameter for use within Xen. */
    5.67 +    if ( !strcmp(s, "off") )
    5.68 +    {
    5.69 +        disable_acpi();
    5.70 +    }
    5.71 +    else if ( !strcmp(s, "force") )
    5.72 +    {
    5.73 +        acpi_force = 1;
    5.74 +        acpi_ht = 1;
    5.75 +        acpi_disabled = 0;
    5.76 +    }
    5.77 +    else if ( !strcmp(s, "strict") )
    5.78 +    {
    5.79 +        acpi_strict = 1;
    5.80 +    }
    5.81 +    else if ( !strcmp(s, "ht") )
    5.82 +    {
    5.83 +        if ( !acpi_force )
    5.84 +            disable_acpi();
    5.85 +        acpi_ht = 1;
    5.86 +    }
    5.87 +    else if ( !strcmp(s, "noirq") )
    5.88 +    {
    5.89 +        acpi_noirq_set();
    5.90 +    }
    5.91 +}
    5.92 +
    5.93  static void __init do_initcalls(void)
    5.94  {
    5.95      initcall_t *call;
    5.96 @@ -355,54 +395,36 @@ static void __init start_of_day(void)
    5.97      identify_cpu(&boot_cpu_data); /* get CPU type info */
    5.98      if ( cpu_has_fxsr ) set_in_cr4(X86_CR4_OSFXSR);
    5.99      if ( cpu_has_xmm )  set_in_cr4(X86_CR4_OSXMMEXCPT);
   5.100 -#ifdef CONFIG_SMP
   5.101 -    if ( opt_ignorebiostables )
   5.102 -    {
   5.103 -        opt_nosmp  = 1;           /* No SMP without configuration          */
   5.104 -        opt_noacpi = 1;           /* ACPI will just confuse matters also   */
   5.105 -    }
   5.106 -    else
   5.107 -    {
   5.108 -        find_smp_config();
   5.109 -        smp_alloc_memory();       /* trampoline which other CPUs jump at   */
   5.110 -    }
   5.111 -#endif
   5.112 -    paging_init();                /* not much here now, but sets up fixmap */
   5.113 -    if ( !opt_noacpi )
   5.114 -    {
   5.115 -        acpi_boot_table_init();
   5.116 -        acpi_boot_init();
   5.117 -    }
   5.118 -#ifdef CONFIG_SMP
   5.119 +
   5.120 +    find_smp_config();
   5.121 +
   5.122 +    smp_alloc_memory();
   5.123 +
   5.124 +    paging_init();
   5.125 +
   5.126 +    acpi_boot_table_init();
   5.127 +    acpi_boot_init();
   5.128 +
   5.129      if ( smp_found_config ) 
   5.130          get_smp_config();
   5.131 -#endif
   5.132 -    init_apic_mappings(); /* make APICs addressable in our pagetables. */
   5.133 +
   5.134 +    init_apic_mappings();
   5.135 +
   5.136      scheduler_init();	
   5.137 -    init_IRQ();  /* installs simple interrupt wrappers. Starts HZ clock. */
   5.138 +
   5.139 +    init_IRQ();
   5.140 +
   5.141      trap_init();
   5.142 -    time_init(); /* installs software handler for HZ clock. */
   5.143 +
   5.144 +    time_init();
   5.145  
   5.146      arch_init_memory();
   5.147  
   5.148 -#ifndef CONFIG_SMP    
   5.149 -    APIC_init_uniprocessor();
   5.150 -#else
   5.151 -    if ( opt_nosmp )
   5.152 -        APIC_init_uniprocessor();
   5.153 -    else
   5.154 -    	smp_boot_cpus(); 
   5.155 -    /*
   5.156 -     * Does loads of stuff, including kicking the local
   5.157 -     * APIC, and the IO APIC after other CPUs are booted.
   5.158 -     * Each IRQ is preferably handled by IO-APIC, but
   5.159 -     * fall thru to 8259A if we have to (but slower).
   5.160 -     */
   5.161 -#endif
   5.162 +    smp_boot_cpus();
   5.163  
   5.164      __sti();
   5.165  
   5.166 -    initialize_keytable(); /* call back handling for key codes */
   5.167 +    initialize_keytable();
   5.168  
   5.169      serial_init_stage2();
   5.170  
   5.171 @@ -419,19 +441,14 @@ static void __init start_of_day(void)
   5.172  
   5.173      check_nmi_watchdog();
   5.174  
   5.175 -#ifdef CONFIG_PCI
   5.176 -    pci_init();
   5.177 -#endif
   5.178      do_initcalls();
   5.179  
   5.180 -#ifdef CONFIG_SMP
   5.181      wait_init_idle = cpu_online_map;
   5.182      clear_bit(smp_processor_id(), &wait_init_idle);
   5.183      smp_threads_ready = 1;
   5.184      smp_commence(); /* Tell other CPUs that state of the world is stable. */
   5.185      while ( wait_init_idle != 0 )
   5.186          cpu_relax();
   5.187 -#endif
   5.188  
   5.189      watchdog_on = 1;
   5.190  #ifdef __x86_64__ /* x86_32 uses low mappings when building DOM0. */
   5.191 @@ -572,13 +589,32 @@ void __init __start_xen(multiboot_info_t
   5.192  
   5.193      set_bit(DF_PRIVILEGED, &dom0->flags);
   5.194  
   5.195 -    /* Grab the DOM0 command line. Skip past the image name. */
   5.196 +    /* Grab the DOM0 command line. */
   5.197      cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
   5.198      if ( cmdline != NULL )
   5.199      {
   5.200 +        static char dom0_cmdline[256];
   5.201 +
   5.202 +        /* Skip past the image name. */
   5.203          while ( *cmdline == ' ' ) cmdline++;
   5.204          if ( (cmdline = strchr(cmdline, ' ')) != NULL )
   5.205              while ( *cmdline == ' ' ) cmdline++;
   5.206 +
   5.207 +        /* Copy the command line to a local buffer. */
   5.208 +        strcpy(dom0_cmdline, cmdline);
   5.209 +        cmdline = dom0_cmdline;
   5.210 +
   5.211 +        /* Append any extra parameters. */
   5.212 +        if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
   5.213 +            strcat(cmdline, " noapic");
   5.214 +        if ( acpi_skip_timer_override &&
   5.215 +             !strstr(cmdline, "acpi_skip_timer_override") )
   5.216 +            strcat(cmdline, " acpi_skip_timer_override");
   5.217 +        if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
   5.218 +        {
   5.219 +            strcat(cmdline, " acpi=");
   5.220 +            strcat(cmdline, acpi_param);
   5.221 +        }
   5.222      }
   5.223  
   5.224      /*
     6.1 --- a/xen/arch/x86/smpboot.c	Wed May 11 14:15:56 2005 +0000
     6.2 +++ b/xen/arch/x86/smpboot.c	Wed May 11 16:18:30 2005 +0000
     6.3 @@ -51,8 +51,11 @@
     6.4  #include <mach_apic.h>
     6.5  #include <mach_wakecpu.h>
     6.6  
     6.7 -/* Cconfigured maximum number of CPUs to activate. We name the parameter 
     6.8 -"maxcpus" rather than max_cpus to be compatible with Linux */
     6.9 +/* opt_nosmp: If true, secondary processors are ignored. */
    6.10 +static int opt_nosmp = 0;
    6.11 +boolean_param("nosmp", opt_nosmp);
    6.12 +
    6.13 +/* maxcpus: maximum number of CPUs to activate. */
    6.14  static int max_cpus = -1;
    6.15  integer_param("maxcpus", max_cpus); 
    6.16  
    6.17 @@ -797,8 +800,7 @@ void __init smp_boot_cpus(void)
    6.18       * If we couldnt find an SMP configuration at boot time,
    6.19       * get out of here now!
    6.20       */
    6.21 -    if (!smp_found_config) {
    6.22 -        printk("SMP motherboard not detected.\n");
    6.23 +    if (!smp_found_config || opt_nosmp) {
    6.24          io_apic_irqs = 0;
    6.25          phys_cpu_present_map = physid_mask_of_physid(0);
    6.26          cpu_online_map = 1;
     7.1 --- a/xen/common/kernel.c	Wed May 11 14:15:56 2005 +0000
     7.2 +++ b/xen/common/kernel.c	Wed May 11 16:18:30 2005 +0000
     7.3 @@ -55,27 +55,13 @@ void cmdline_parse(char *cmdline)
     7.4                      *(unsigned int *)param->var =
     7.5                          simple_strtol(opt, (char **)&opt, 0);
     7.6                  break;
     7.7 -            case OPT_UINT_UNIT:
     7.8 -                if ( opt != NULL )
     7.9 -                {
    7.10 -                    int base = 1;
    7.11 -                    unsigned int value;
    7.12 -
    7.13 -                    value = simple_strtoul(opt, (char **)&opt, 0);
    7.14 -                    if (*opt == 'G' || *opt == 'g') {
    7.15 -                        base = 1024 * 1024;
    7.16 -                        opt++;
    7.17 -                    } if (*opt == 'M' || *opt == 'm') {
    7.18 -                        base = 1024;
    7.19 -                        opt++;
    7.20 -                    } else if (*opt == 'K' || *opt == 'k')
    7.21 -                        opt++;
    7.22 -                    *(unsigned int *) param->var = value * base;
    7.23 -                }
    7.24 -                break;
    7.25              case OPT_BOOL:
    7.26                  *(int *)param->var = 1;
    7.27                  break;
    7.28 +            case OPT_CUSTOM:
    7.29 +                if ( opt != NULL )
    7.30 +                    ((void (*)(char *))param->var)(opt);
    7.31 +                break;
    7.32              }
    7.33          }
    7.34          cmdline = opt_end;
     8.1 --- a/xen/common/lib.c	Wed May 11 14:15:56 2005 +0000
     8.2 +++ b/xen/common/lib.c	Wed May 11 16:18:30 2005 +0000
     8.3 @@ -441,6 +441,22 @@ s64 __moddi3(s64 a, s64 b)
     8.4  
     8.5  #endif /* BITS_PER_LONG == 32 */
     8.6  
     8.7 +unsigned long long memparse(char *s)
     8.8 +{
     8.9 +	unsigned long long ret = simple_strtoull(s, &s, 0);
    8.10 +
    8.11 +	switch (*s) {
    8.12 +	case 'G': case 'g':
    8.13 +		ret <<= 10;
    8.14 +	case 'M': case 'm':
    8.15 +		ret <<= 10;
    8.16 +	case 'K': case 'k':
    8.17 +		ret <<= 10;
    8.18 +	}
    8.19 +
    8.20 +	return ret;
    8.21 +}
    8.22 +
    8.23  /*
    8.24   * Local variables:
    8.25   * mode: C
     9.1 --- a/xen/include/asm-x86/acpi.h	Wed May 11 14:15:56 2005 +0000
     9.2 +++ b/xen/include/asm-x86/acpi.h	Wed May 11 16:18:30 2005 +0000
     9.3 @@ -27,7 +27,7 @@
     9.4  #define _ASM_ACPI_H
     9.5  
     9.6  #include <xen/config.h>
     9.7 -#include <asm/system.h>
     9.8 +#include <asm/system.h>		/* defines cmpxchg */
     9.9  
    9.10  #define COMPILER_DEPENDENT_INT64   long long
    9.11  #define COMPILER_DEPENDENT_UINT64  unsigned long long
    9.12 @@ -49,8 +49,8 @@
    9.13  
    9.14  #define ACPI_ASM_MACROS
    9.15  #define BREAKPOINT3
    9.16 -#define ACPI_DISABLE_IRQS() __cli()
    9.17 -#define ACPI_ENABLE_IRQS()  __sti()
    9.18 +#define ACPI_DISABLE_IRQS() local_irq_disable()
    9.19 +#define ACPI_ENABLE_IRQS()  local_irq_enable()
    9.20  #define ACPI_FLUSH_CPU_CACHE()	wbinvd()
    9.21  
    9.22  
    9.23 @@ -100,6 +100,11 @@ static inline int
    9.24          :"=r"(n_hi), "=r"(n_lo)     \
    9.25          :"0"(n_hi), "1"(n_lo))
    9.26  
    9.27 +/*
    9.28 + * Refer Intel ACPI _PDC support document for bit definitions
    9.29 + */
    9.30 +#define ACPI_PDC_EST_CAPABILITY_SMP 	0xa
    9.31 +#define ACPI_PDC_EST_CAPABILITY_MSR	0x1
    9.32  
    9.33  #ifdef CONFIG_ACPI_BOOT 
    9.34  extern int acpi_lapic;
    9.35 @@ -108,47 +113,53 @@ extern int acpi_noirq;
    9.36  extern int acpi_strict;
    9.37  extern int acpi_disabled;
    9.38  extern int acpi_ht;
    9.39 -static inline void disable_acpi(void) { acpi_disabled = 1; acpi_ht = 0; }
    9.40 +extern int acpi_pci_disabled;
    9.41 +static inline void disable_acpi(void) 
    9.42 +{ 
    9.43 +	acpi_disabled = 1; 
    9.44 +	acpi_ht = 0;
    9.45 +	acpi_pci_disabled = 1;
    9.46 +	acpi_noirq = 1;
    9.47 +}
    9.48  
    9.49  /* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
    9.50  #define FIX_ACPI_PAGES 4
    9.51  
    9.52 -#else	/* !CONFIG_ACPI_BOOT */
    9.53 +extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
    9.54 +
    9.55 +#ifdef CONFIG_X86_IO_APIC
    9.56 +extern int skip_ioapic_setup;
    9.57 +extern int acpi_skip_timer_override;
    9.58 +
    9.59 +extern void check_acpi_pci(void);
    9.60 +
    9.61 +static inline void disable_ioapic_setup(void)
    9.62 +{
    9.63 +	skip_ioapic_setup = 1;
    9.64 +}
    9.65 +
    9.66 +static inline int ioapic_setup_disabled(void)
    9.67 +{
    9.68 +	return skip_ioapic_setup;
    9.69 +}
    9.70 +
    9.71 +#else
    9.72 +static inline void disable_ioapic_setup(void) { }
    9.73 +static inline void check_acpi_pci(void) { }
    9.74 +
    9.75 +#endif
    9.76 +
    9.77 +#else	/* CONFIG_ACPI_BOOT */
    9.78  #  define acpi_lapic 0
    9.79  #  define acpi_ioapic 0
    9.80  
    9.81 -#endif	/* !CONFIG_ACPI_BOOT */
    9.82 +#endif
    9.83  
    9.84 -#ifdef CONFIG_ACPI_PCI
    9.85  static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
    9.86 -extern int acpi_irq_balance_set(char *str);
    9.87 -#else
    9.88 -static inline void acpi_noirq_set(void) { }
    9.89  static inline int acpi_irq_balance_set(char *str) { return 0; }
    9.90 -#endif
    9.91  
    9.92  #ifdef CONFIG_ACPI_SLEEP
    9.93  
    9.94 -extern unsigned long saved_eip;
    9.95 -extern unsigned long saved_esp;
    9.96 -extern unsigned long saved_ebp;
    9.97 -extern unsigned long saved_ebx;
    9.98 -extern unsigned long saved_esi;
    9.99 -extern unsigned long saved_edi;
   9.100 -
   9.101 -static inline void acpi_save_register_state(unsigned long return_point)
   9.102 -{
   9.103 -	saved_eip = return_point;
   9.104 -	asm volatile ("movl %%esp,(%0)" : "=m" (saved_esp));
   9.105 -	asm volatile ("movl %%ebp,(%0)" : "=m" (saved_ebp));
   9.106 -	asm volatile ("movl %%ebx,(%0)" : "=m" (saved_ebx));
   9.107 -	asm volatile ("movl %%edi,(%0)" : "=m" (saved_edi));
   9.108 -	asm volatile ("movl %%esi,(%0)" : "=m" (saved_esi));
   9.109 -}
   9.110 -
   9.111 -#define acpi_restore_register_state()   do {} while (0)
   9.112 -
   9.113 -
   9.114  /* routines for saving/restoring kernel state */
   9.115  extern int acpi_save_state_mem(void);
   9.116  extern int acpi_save_state_disk(void);
   9.117 @@ -156,11 +167,11 @@ extern void acpi_restore_state_mem(void)
   9.118  
   9.119  extern unsigned long acpi_wakeup_address;
   9.120  
   9.121 -extern void do_suspend_lowlevel_s4bios(int resume);
   9.122 -
   9.123  /* early initialization routine */
   9.124  extern void acpi_reserve_bootmem(void);
   9.125  
   9.126  #endif /*CONFIG_ACPI_SLEEP*/
   9.127  
   9.128 +extern u8 x86_acpiid_to_apicid[];
   9.129 +
   9.130  #endif /*_ASM_ACPI_H*/
    10.1 --- a/xen/include/xen/init.h	Wed May 11 14:15:56 2005 +0000
    10.2 +++ b/xen/include/xen/init.h	Wed May 11 16:18:30 2005 +0000
    10.3 @@ -59,13 +59,17 @@ extern initcall_t __initcall_start, __in
    10.4   */
    10.5  struct kernel_param {
    10.6      const char *name;
    10.7 -    enum { OPT_STR, OPT_UINT, OPT_UINT_UNIT, OPT_BOOL } type;
    10.8 +    enum { OPT_STR, OPT_UINT, OPT_BOOL, OPT_CUSTOM } type;
    10.9      void *var;
   10.10      unsigned int len;
   10.11  };
   10.12  
   10.13  extern struct kernel_param __setup_start, __setup_end;
   10.14  
   10.15 +#define custom_param(_name, _var) \
   10.16 +    static char __setup_str_##_var[] __initdata = _name; \
   10.17 +    static struct kernel_param __setup_##_var __attribute_used__ \
   10.18 +        __initsetup = { __setup_str_##_var, OPT_CUSTOM, &_var, 0 }
   10.19  #define boolean_param(_name, _var) \
   10.20      static char __setup_str_##_var[] __initdata = _name; \
   10.21      static struct kernel_param __setup_##_var __attribute_used__ \
   10.22 @@ -74,10 +78,6 @@ extern struct kernel_param __setup_start
   10.23      static char __setup_str_##_var[] __initdata = _name; \
   10.24      static struct kernel_param __setup_##_var __attribute_used__ \
   10.25          __initsetup = { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
   10.26 -#define integer_unit_param(_name, _var) \
   10.27 -    static char __setup_str_##_var[] __initdata = _name; \
   10.28 -    static struct kernel_param __setup_##_var __attribute_used__ \
   10.29 -        __initsetup = { __setup_str_##_var, OPT_UINT_UNIT, &_var, sizeof(_var) }
   10.30  #define string_param(_name, _var) \
   10.31      static char __setup_str_##_var[] __initdata = _name; \
   10.32      static struct kernel_param __setup_##_var __attribute_used__ \
    11.1 --- a/xen/include/xen/lib.h	Wed May 11 14:15:56 2005 +0000
    11.2 +++ b/xen/include/xen/lib.h	Wed May 11 16:18:30 2005 +0000
    11.3 @@ -57,8 +57,15 @@ extern int snprintf(char * buf, size_t s
    11.4      __attribute__ ((format (printf, 3, 4)));
    11.5  extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
    11.6  
    11.7 -long simple_strtol(const char *cp,char **endp,unsigned int base);
    11.8 -unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
    11.9 -long long simple_strtoll(const char *cp,char **endp,unsigned int base);
   11.10 +long simple_strtol(
   11.11 +    const char *cp,char **endp, unsigned int base);
   11.12 +unsigned long simple_strtoul(
   11.13 +    const char *cp,char **endp, unsigned int base);
   11.14 +long long simple_strtoll(
   11.15 +    const char *cp,char **endp, unsigned int base);
   11.16 +unsigned long long simple_strtoull(
   11.17 +    const char *cp,char **endp, unsigned int base);
   11.18 +
   11.19 +unsigned long long memparse(char *s);
   11.20  
   11.21  #endif /* __LIB_H__ */