ia64/xen-unstable

changeset 4471:38d7ac8f210f

bitkeeper revision 1.1236.1.215 (42526b63vLzmU02tqgo2T5K1cqfpBQ)

Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/vh249/xen-unstable.bk
author vh249@arcadians.cl.cam.ac.uk
date Tue Apr 05 10:41:39 2005 +0000 (2005-04-05)
parents cedeb2bbe015 3bfb0d7a5f6c
children 9840c24f5803 6bbac0aca316 ab31a05fc9e6 d6ceb5c6bfd8
files linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgalloc.h tools/python/xen/xm/main.py xen/arch/x86/domain_build.c xen/common/kernel.c xen/include/xen/init.h
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Tue Apr 05 08:04:51 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Tue Apr 05 10:41:39 2005 +0000
     1.3 @@ -167,7 +167,7 @@ void show_regs(struct pt_regs * regs)
     1.4  	if (regs->xcs & 2)
     1.5  		printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
     1.6  	printk(" EFLAGS: %08lx    %s  (%s)\n",
     1.7 -	       regs->eflags, print_tainted(),UTS_RELEASE);
     1.8 +	       regs->eflags, print_tainted(), system_utsname.release);
     1.9  	printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
    1.10  		regs->eax,regs->ebx,regs->ecx,regs->edx);
    1.11  	printk("ESI: %08lx EDI: %08lx EBP: %08lx",
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Tue Apr 05 08:04:51 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/mm/init.c	Tue Apr 05 10:41:39 2005 +0000
     2.3 @@ -194,7 +194,7 @@ static void __init kernel_physical_mappi
     2.4  			}
     2.5  		}
     2.6  		pmd_idx = 0;
     2.7 -	}	
     2.8 +	}
     2.9  }
    2.10  
    2.11  static inline int page_kills_ppro(unsigned long pagenr)
     3.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Tue Apr 05 08:04:51 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Tue Apr 05 10:41:39 2005 +0000
     3.3 @@ -9,13 +9,12 @@
     3.4  #include <asm/io.h>		/* for phys_to_virt and page_to_pseudophys */
     3.5  
     3.6  #define pmd_populate_kernel(mm, pmd, pte) \
     3.7 -	set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
     3.8 +		set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
     3.9  
    3.10 -#define pmd_populate(mm, pmd, pte) do {				\
    3.11 +#define pmd_populate(mm, pmd, pte) 				\
    3.12  	set_pmd(pmd, __pmd(_PAGE_TABLE +			\
    3.13  		((unsigned long long)page_to_pfn(pte) <<	\
    3.14 -			(unsigned long long) PAGE_SHIFT)));	\
    3.15 -} while (0)
    3.16 +			(unsigned long long) PAGE_SHIFT)))
    3.17  /*
    3.18   * Allocate and free page tables.
    3.19   */
     4.1 --- a/tools/python/xen/xm/main.py	Tue Apr 05 08:04:51 2005 +0000
     4.2 +++ b/tools/python/xen/xm/main.py	Tue Apr 05 10:41:39 2005 +0000
     4.3 @@ -14,6 +14,31 @@ from xen.xend.XendClient import main as 
     4.4  from xen.xm import create, destroy, migrate, shutdown, sysrq
     4.5  from xen.xm.opts import *
     4.6  
     4.7 +def unit(c):
     4.8 +    if not c.isalpha():
     4.9 +        return 0
    4.10 +    base = 1
    4.11 +    if c == 'G' or c == 'g': base = 1024 * 1024 * 1024
    4.12 +    elif c == 'M' or c == 'm': base = 1024 * 1024
    4.13 +    elif c == 'K' or c == 'k': base = 1024
    4.14 +    else:
    4.15 +        print 'ignoring unknown unit'
    4.16 +    return base
    4.17 +
    4.18 +def int_unit(str, dest):
    4.19 +    base = unit(str[-1])
    4.20 +    if not base:
    4.21 +        return int(str)
    4.22 +
    4.23 +    value = int(str[:-1])
    4.24 +    dst_base = unit(dest)
    4.25 +    if dst_base == 0:
    4.26 +        dst_base = 1
    4.27 +    if dst_base > base:
    4.28 +        return value / (dst_base / base)
    4.29 +    else:
    4.30 +        return value * (base / dst_base)
    4.31 +
    4.32  class Group:
    4.33  
    4.34      name = ""
    4.35 @@ -475,7 +500,7 @@ class ProgMaxmem(Prog):
    4.36      def main(self, args):
    4.37          if len(args) != 3: self.err("%s: Invalid argument(s)" % args[0])
    4.38          dom = args[1]
    4.39 -        mem = int(args[2])
    4.40 +        mem = int_unit(args[2], 'm')
    4.41          server.xend_domain_maxmem_set(dom, mem)
    4.42  
    4.43  xm.prog(ProgMaxmem)
    4.44 @@ -493,7 +518,7 @@ MEMORY_TARGET megabytes"""
    4.45      def main(self, args):
    4.46          if len(args) != 3: self.err("%s: Invalid argument(s)" % args[0])
    4.47          dom = args[1]
    4.48 -        mem_target = int(args[2])
    4.49 +        mem_target = int_unit(args[2], 'm')
    4.50          server.xend_domain_mem_target_set(dom, mem_target)
    4.51  
    4.52  xm.prog(ProgBalloon)
     5.1 --- a/xen/arch/x86/domain_build.c	Tue Apr 05 08:04:51 2005 +0000
     5.2 +++ b/xen/arch/x86/domain_build.c	Tue Apr 05 10:41:39 2005 +0000
     5.3 @@ -23,7 +23,7 @@
     5.4  
     5.5  /* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
     5.6  static unsigned int opt_dom0_mem = 0;
     5.7 -integer_param("dom0_mem", opt_dom0_mem);
     5.8 +integer_unit_param("dom0_mem", opt_dom0_mem);
     5.9  
    5.10  #if defined(__i386__)
    5.11  /* No ring-3 access in initial leaf page tables. */
     6.1 --- a/xen/common/kernel.c	Tue Apr 05 08:04:51 2005 +0000
     6.2 +++ b/xen/common/kernel.c	Tue Apr 05 10:41:39 2005 +0000
     6.3 @@ -55,6 +55,24 @@ void cmdline_parse(char *cmdline)
     6.4                      *(unsigned int *)param->var =
     6.5                          simple_strtol(opt, (char **)&opt, 0);
     6.6                  break;
     6.7 +            case OPT_UINT_UNIT:
     6.8 +                if ( opt != NULL )
     6.9 +                {
    6.10 +                    int base = 1;
    6.11 +                    unsigned int value;
    6.12 +
    6.13 +                    value = simple_strtoul(opt, (char **)&opt, 0);
    6.14 +                    if (*opt == 'G' || *opt == 'g') {
    6.15 +                        base = 1024 * 1024;
    6.16 +                        opt++;
    6.17 +                    } if (*opt == 'M' || *opt == 'm') {
    6.18 +                        base = 1024;
    6.19 +                        opt++;
    6.20 +                    } else if (*opt == 'K' || *opt == 'k')
    6.21 +                        opt++;
    6.22 +                    *(unsigned int *) param->var = value * base;
    6.23 +                }
    6.24 +                break;
    6.25              case OPT_BOOL:
    6.26                  *(int *)param->var = 1;
    6.27                  break;
     7.1 --- a/xen/include/xen/init.h	Tue Apr 05 08:04:51 2005 +0000
     7.2 +++ b/xen/include/xen/init.h	Tue Apr 05 10:41:39 2005 +0000
     7.3 @@ -59,7 +59,7 @@ extern initcall_t __initcall_start, __in
     7.4   */
     7.5  struct kernel_param {
     7.6      const char *name;
     7.7 -    enum { OPT_STR, OPT_UINT, OPT_BOOL } type;
     7.8 +    enum { OPT_STR, OPT_UINT, OPT_UINT_UNIT, OPT_BOOL } type;
     7.9      void *var;
    7.10      unsigned int len;
    7.11  };
    7.12 @@ -74,6 +74,10 @@ extern struct kernel_param __setup_start
    7.13      static char __setup_str_##_var[] __initdata = _name; \
    7.14      static struct kernel_param __setup_##_var __attribute_used__ \
    7.15          __initsetup = { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) }
    7.16 +#define integer_unit_param(_name, _var) \
    7.17 +    static char __setup_str_##_var[] __initdata = _name; \
    7.18 +    static struct kernel_param __setup_##_var __attribute_used__ \
    7.19 +        __initsetup = { __setup_str_##_var, OPT_UINT_UNIT, &_var, sizeof(_var) }
    7.20  #define string_param(_name, _var) \
    7.21      static char __setup_str_##_var[] __initdata = _name; \
    7.22      static struct kernel_param __setup_##_var __attribute_used__ \