ia64/xen-unstable

changeset 5701:707fcf42a5ae

Merge.
author sos22@douglas.cl.cam.ac.uk
date Fri Jul 08 12:22:18 2005 +0000 (2005-07-08)
parents f3f845297821 1a7383f84989
children 579d1e771025
files .hgignore buildconfigs/mk.linux-2.6-xen docs/misc/hg-cheatsheet.txt extras/mini-os/Makefile extras/mini-os/events.c extras/mini-os/hypervisor.c extras/mini-os/include/events.h extras/mini-os/include/hypervisor.h extras/mini-os/include/lib.h extras/mini-os/include/mm.h extras/mini-os/include/os.h extras/mini-os/include/time.h extras/mini-os/include/traps.h extras/mini-os/include/types.h extras/mini-os/kernel.c extras/mini-os/time.c extras/mini-os/traps.c extras/mini-os/x86_32.S linux-2.6.11-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32 linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 linux-2.6.11-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 linux-2.6.11-xen-sparse/arch/xen/configs/xen_defconfig_x86_64 linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6.11-xen-sparse/drivers/xen/blkback/interface.c patches/linux-2.6.11/smp-alts.patch tools/Rules.mk tools/firmware/vmxassist/Makefile tools/libxc/xc_linux_build.c tools/misc/cpuperf/Makefile tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/main.py tools/xenstore/Makefile xen/Makefile xen/common/event_channel.c xen/common/schedule.c xen/include/public/event_channel.h
line diff
     3.1 --- a/docs/misc/hg-cheatsheet.txt	Thu Jul 07 09:27:25 2005 +0000
     3.2 +++ b/docs/misc/hg-cheatsheet.txt	Fri Jul 08 12:22:18 2005 +0000
     3.3 @@ -96,6 +96,8 @@ repository from:
     3.4   
     3.5    http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-unstable.hg.tar.gz
     3.6  
     3.7 +  (or copy from /usr/groups/netos/html/xen/downloads/xen-unstable.hg.tar.gz)
     3.8 +
     3.9  Untar the repository on your disk, cd into it, and then pull the most
    3.10  recent changes:
    3.11  
    3.12 @@ -430,4 +432,7 @@ Show the parents of a changeset:
    3.13   you have two parents.  Otherwise, the single parent is the changeset
    3.14   which you most recently checked out.
    3.15  
    3.16 +Show the revision history for a single file
    3.17  
    3.18 +   hg [-v] log <filename>
    3.19 +
    20.1 --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Jul 07 09:27:25 2005 +0000
    20.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Fri Jul 08 12:22:18 2005 +0000
    20.3 @@ -1,7 +1,7 @@
    20.4  #
    20.5  # Automatically generated make config: don't edit
    20.6  # Linux kernel version: 2.6.11.12-xenU
    20.7 -# Wed Jul  6 17:44:54 2005
    20.8 +# Wed Jul  6 22:40:19 2005
    20.9  #
   20.10  CONFIG_XEN=y
   20.11  CONFIG_ARCH_XEN=y
   20.12 @@ -28,7 +28,6 @@ CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
   20.13  #
   20.14  CONFIG_EXPERIMENTAL=y
   20.15  CONFIG_CLEAN_COMPILE=y
   20.16 -CONFIG_BROKEN_ON_SMP=y
   20.17  CONFIG_LOCK_KERNEL=y
   20.18  
   20.19  #
   20.20 @@ -69,6 +68,7 @@ CONFIG_OBSOLETE_MODPARM=y
   20.21  # CONFIG_MODVERSIONS is not set
   20.22  # CONFIG_MODULE_SRCVERSION_ALL is not set
   20.23  CONFIG_KMOD=y
   20.24 +CONFIG_STOP_MACHINE=y
   20.25  
   20.26  #
   20.27  # X86 Processor Configuration
   20.28 @@ -114,7 +114,10 @@ CONFIG_X86_INTEL_USERCOPY=y
   20.29  CONFIG_X86_USE_PPRO_CHECKSUM=y
   20.30  # CONFIG_HPET_TIMER is not set
   20.31  # CONFIG_HPET_EMULATE_RTC is not set
   20.32 -# CONFIG_SMP is not set
   20.33 +CONFIG_SMP=y
   20.34 +CONFIG_SMP_ALTERNATIVES=y
   20.35 +CONFIG_NR_CPUS=8
   20.36 +# CONFIG_SCHED_SMT is not set
   20.37  CONFIG_PREEMPT=y
   20.38  CONFIG_PREEMPT_BKL=y
   20.39  CONFIG_X86_CPUID=y
   20.40 @@ -128,6 +131,7 @@ CONFIG_HIGHMEM4G=y
   20.41  CONFIG_HIGHMEM=y
   20.42  CONFIG_HAVE_DEC_LOCK=y
   20.43  # CONFIG_REGPARM is not set
   20.44 +CONFIG_HOTPLUG_CPU=y
   20.45  
   20.46  #
   20.47  # Kernel hacking
   20.48 @@ -153,7 +157,9 @@ CONFIG_EARLY_PRINTK=y
   20.49  # CONFIG_4KSTACKS is not set
   20.50  CONFIG_GENERIC_HARDIRQS=y
   20.51  CONFIG_GENERIC_IRQ_PROBE=y
   20.52 +CONFIG_X86_SMP=y
   20.53  CONFIG_X86_BIOS_REBOOT=y
   20.54 +CONFIG_X86_TRAMPOLINE=y
   20.55  CONFIG_PC=y
   20.56  
   20.57  #
    23.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c	Thu Jul 07 09:27:25 2005 +0000
    23.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Jul 08 12:22:18 2005 +0000
    23.3 @@ -274,7 +274,7 @@ void fixup_irqs(cpumask_t map)
    23.4  		}
    23.5  		if (irq_desc[irq].handler->set_affinity)
    23.6  			irq_desc[irq].handler->set_affinity(irq, mask);
    23.7 -		else if (irq_desc[irq].action && !(warned++))
    23.8 +		else if (irq_desc[irq].action)
    23.9  			printk("Cannot set affinity for irq %i\n", irq);
   23.10  	}
   23.11  
    24.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Thu Jul 07 09:27:25 2005 +0000
    24.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Fri Jul 08 12:22:18 2005 +0000
    24.3 @@ -103,6 +103,11 @@ static int trampoline_exec;
    24.4  DEFINE_PER_CPU(int, cpu_state) = { 0 };
    24.5  #endif
    24.6  
    24.7 +static DEFINE_PER_CPU(int, resched_irq);
    24.8 +static DEFINE_PER_CPU(int, callfunc_irq);
    24.9 +static char resched_name[NR_CPUS][15];
   24.10 +static char callfunc_name[NR_CPUS][15];
   24.11 +
   24.12  #if 0
   24.13  /*
   24.14   * Currently trivial. Write the real->protected mode
   24.15 @@ -1328,6 +1333,10 @@ static int __devinit cpu_enable(unsigned
   24.16  	while (!cpu_online(cpu))
   24.17  		cpu_relax();
   24.18  
   24.19 +   /* re-route bound IRQs 0 to cpu */
   24.20 +   rebind_evtchn_from_irq(0, cpu,  per_cpu(resched_irq, cpu));
   24.21 +   rebind_evtchn_from_irq(0, cpu, per_cpu(callfunc_irq, cpu));
   24.22 +
   24.23  	fixup_irqs(cpu_online_map);
   24.24  	/* counter the disable in fixup_irqs() */
   24.25  	local_irq_enable();
   24.26 @@ -1357,6 +1366,11 @@ int __cpu_disable(void)
   24.27  
   24.28  	cpu_clear(cpu, map);
   24.29  	fixup_irqs(map);
   24.30 +
   24.31 +   /* re-route IRQs from dead vcpu to another */
   24.32 +   rebind_evtchn_from_irq(cpu, 0,  per_cpu(resched_irq, cpu));
   24.33 +   rebind_evtchn_from_irq(cpu, 0, per_cpu(callfunc_irq, cpu));
   24.34 +
   24.35  	/* It's now safe to remove this processor from the online map */
   24.36  	cpu_clear(cpu, cpu_online_map);
   24.37  
   24.38 @@ -1514,11 +1528,6 @@ void __init smp_cpus_done(unsigned int m
   24.39  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
   24.40  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
   24.41  
   24.42 -static DEFINE_PER_CPU(int, resched_irq);
   24.43 -static DEFINE_PER_CPU(int, callfunc_irq);
   24.44 -static char resched_name[NR_CPUS][15];
   24.45 -static char callfunc_name[NR_CPUS][15];
   24.46 -
   24.47  void __init smp_intr_init(void)
   24.48  {
   24.49  	int cpu = smp_processor_id();
    25.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Thu Jul 07 09:27:25 2005 +0000
    25.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Fri Jul 08 12:22:18 2005 +0000
    25.3 @@ -271,6 +271,38 @@ int bind_ipi_on_cpu_to_irq(int cpu, int 
    25.4      return irq;
    25.5  }
    25.6  
    25.7 +void rebind_evtchn_from_ipi(int cpu, int newcpu, int ipi)
    25.8 +{
    25.9 +    evtchn_op_t op;
   25.10 +    int evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi];
   25.11 +
   25.12 +    spin_lock(&irq_mapping_update_lock);
   25.13 +
   25.14 +    op.cmd          = EVTCHNOP_rebind;
   25.15 +    op.u.rebind.port = evtchn;
   25.16 +    op.u.rebind.vcpu = newcpu;
   25.17 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
   25.18 +       printk(KERN_INFO "Failed to rebind IPI%d to CPU%d\n",ipi,newcpu);
   25.19 +
   25.20 +    spin_unlock(&irq_mapping_update_lock);
   25.21 +}
   25.22 +
   25.23 +void rebind_evtchn_from_irq(int cpu, int newcpu, int irq)
   25.24 +{
   25.25 +    evtchn_op_t op;
   25.26 +    int evtchn = irq_to_evtchn[irq];
   25.27 +
   25.28 +    spin_lock(&irq_mapping_update_lock);
   25.29 +
   25.30 +    op.cmd          = EVTCHNOP_rebind;
   25.31 +    op.u.rebind.port = evtchn;
   25.32 +    op.u.rebind.vcpu = newcpu;
   25.33 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
   25.34 +       printk(KERN_INFO "Failed to rebind IRQ%d to CPU%d\n",irq,newcpu);
   25.35 +
   25.36 +    spin_unlock(&irq_mapping_update_lock);
   25.37 +}
   25.38 +
   25.39  void unbind_ipi_on_cpu_from_irq(int cpu, int ipi)
   25.40  {
   25.41      evtchn_op_t op;
    28.1 --- a/tools/Rules.mk	Thu Jul 07 09:27:25 2005 +0000
    28.2 +++ b/tools/Rules.mk	Fri Jul 08 12:22:18 2005 +0000
    28.3 @@ -7,12 +7,12 @@ XEN_LIBXC          = $(XEN_ROOT)/tools/l
    28.4  
    28.5  ifeq ($(XEN_TARGET_ARCH),x86_32)
    28.6  CFLAGS  += -m32 -march=i686
    28.7 -LDFLAGS += -m elf_i386
    28.8 +LDFLAGS += -m32
    28.9  endif
   28.10  
   28.11  ifeq ($(XEN_TARGET_ARCH),x86_64)
   28.12  CFLAGS  += -m64
   28.13 -LDFLAGS += -m elf_x86_64
   28.14 +LDFLAGS += -m64
   28.15  endif
   28.16  
   28.17  X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
    29.1 --- a/tools/firmware/vmxassist/Makefile	Thu Jul 07 09:27:25 2005 +0000
    29.2 +++ b/tools/firmware/vmxassist/Makefile	Fri Jul 08 12:22:18 2005 +0000
    29.3 @@ -29,16 +29,13 @@ XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN
    29.4  #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
    29.5  #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
    29.6  
    29.7 -LD=ld
    29.8 -CC=gcc
    29.9 -CPP=cpp -P
   29.10 -OBJCOPY=objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
   29.11 -CFLAGS=${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
   29.12 -
   29.13 -ifeq ($(XEN_COMPILE_ARCH),x86_64)
   29.14 +LD       = ld
   29.15 +CC       = gcc
   29.16 +CPP      = cpp -P
   29.17 +OBJCOPY  = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
   29.18 +CFLAGS   = ${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
   29.19  CFLAGS  += -m32 -march=i686
   29.20 -LDFLAGS += -m elf_i386
   29.21 -endif
   29.22 +LDFLAGS  = -m elf_i386
   29.23  
   29.24  OBJECTS = head.o trap.o vm86.o setup.o util.o
   29.25  
    31.1 --- a/tools/misc/cpuperf/Makefile	Thu Jul 07 09:27:25 2005 +0000
    31.2 +++ b/tools/misc/cpuperf/Makefile	Fri Jul 08 12:22:18 2005 +0000
    31.3 @@ -17,8 +17,7 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
    31.4  XEN_ROOT=../../..
    31.5  include $(XEN_ROOT)/tools/Rules.mk
    31.6  
    31.7 -CC           = gcc
    31.8 -CFLAGS       = -Wall -O3 
    31.9 +CFLAGS      += -Wall -O3 
   31.10  
   31.11  HDRS         = $(wildcard *.h)
   31.12  SRCS         = $(wildcard *.c)
    32.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Jul 07 09:27:25 2005 +0000
    32.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Jul 08 12:22:18 2005 +0000
    32.3 @@ -423,8 +423,10 @@ class XendDomainInfo:
    32.4              sxpr.append(['cpu_time', self.info['cpu_time']/1e9])    
    32.5              sxpr.append(['vcpus', self.info['vcpus']])
    32.6              sxpr.append(['cpumap', self.info['cpumap']])
    32.7 -            sxpr.append(['vcpu_to_cpu', ''.join(map(lambda x: str(x),
    32.8 -                        self.info['vcpu_to_cpu'][0:self.info['vcpus']]))])
    32.9 +            # build a string, using '|' to seperate items, show only up
   32.10 +            # to number of vcpus in domain, and trim the trailing '|'
   32.11 +            sxpr.append(['vcpu_to_cpu', ''.join(map(lambda x: str(x)+'|',
   32.12 +                        self.info['vcpu_to_cpu'][0:self.info['vcpus']]))[:-1]])
   32.13              
   32.14          if self.start_time:
   32.15              up_time =  time.time() - self.start_time  
    33.1 --- a/tools/python/xen/xm/main.py	Thu Jul 07 09:27:25 2005 +0000
    33.2 +++ b/tools/python/xen/xm/main.py	Fri Jul 08 12:22:18 2005 +0000
    33.3 @@ -410,8 +410,7 @@ class ProgList(Prog):
    33.4          print 'Name              Id  VCPU  CPU  CPUMAP'
    33.5          for dom in doms:
    33.6              info = server.xend_domain(dom)
    33.7 -            # XXX this is quite broken for cpu's > 9
    33.8 -            vcpu_to_cpu = sxp.child_value(info, 'vcpu_to_cpu', '?').replace('-1','#')
    33.9 +            vcpu_to_cpu = sxp.child_value(info, 'vcpu_to_cpu', '-1').split('|')
   33.10              cpumap = sxp.child_value(info, 'cpumap', [])
   33.11              mask = ((int(sxp.child_value(info, 'vcpus', '0')))**2) - 1
   33.12              count = 0
   33.13 @@ -420,10 +419,7 @@ class ProgList(Prog):
   33.14                  d['name']   = sxp.child_value(info, 'name', '??')
   33.15                  d['dom']    = int(sxp.child_value(info, 'id', '-1'))
   33.16                  d['vcpu']   = int(count)
   33.17 -                if cpu == "#":
   33.18 -                    d['cpu']    = int("-1")
   33.19 -                else:
   33.20 -                    d['cpu']    = int(cpu)
   33.21 +                d['cpu']    = int(cpu)
   33.22                  d['cpumap'] = int(cpumap[count])&mask
   33.23                  count = count + 1
   33.24                  print ("%(name)-16s %(dom)3d  %(vcpu)4d  %(cpu)3d  0x%(cpumap)x" % d)
   33.25 @@ -593,15 +589,7 @@ domain DOM"""
   33.26          state = int(args[3])
   33.27          dom = server.xend_domain(name)
   33.28          id = sxp.child_value(dom, 'id')
   33.29 -        vcpu_to_cpu = sxp.child_value(dom, 'vcpu_to_cpu', '-1')
   33.30 -        # only send state change if states differ 
   33.31 -        try:
   33.32 -            # (down going up) or (up going down)
   33.33 -            if (vcpu_to_cpu[vcpu] == "-1" and state == 1) or \
   33.34 -               (vcpu_to_cpu[vcpu] != "-1" and state == 0):
   33.35 -                server.xend_domain_vcpu_hotplug(id, vcpu, state)
   33.36 -        except IndexError:
   33.37 -            print "Invalid VCPU(%d)"%(vcpu)
   33.38 +        server.xend_domain_vcpu_hotplug(id, vcpu, state)
   33.39  
   33.40  xm.prog(ProgVcpuhotplug)
   33.41  
    34.1 --- a/tools/xenstore/Makefile	Thu Jul 07 09:27:25 2005 +0000
    34.2 +++ b/tools/xenstore/Makefile	Fri Jul 08 12:22:18 2005 +0000
    34.3 @@ -19,11 +19,11 @@ BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
    34.4  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
    34.5  BASECFLAGS+= -I.
    34.6  
    34.7 -CFLAGS += $(BASECFLAGS)
    34.8 -LDFLAGS=$(PROFILE) -L$(XEN_LIBXC)
    34.9 -TESTDIR=`pwd`/testsuite/tmp
   34.10 -TESTFLAGS=-DTESTING
   34.11 -TESTENV=XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
   34.12 +CFLAGS  += $(BASECFLAGS)
   34.13 +LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
   34.14 +TESTDIR  = `pwd`/testsuite/tmp
   34.15 +TESTFLAGS= -DTESTING
   34.16 +TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
   34.17  
   34.18  all: xen xenstored libxenstore.a libxenstore-pic.a
   34.19  
    36.1 --- a/xen/common/event_channel.c	Thu Jul 07 09:27:25 2005 +0000
    36.2 +++ b/xen/common/event_channel.c	Fri Jul 08 12:22:18 2005 +0000
    36.3 @@ -583,6 +583,29 @@ static long evtchn_status(evtchn_status_
    36.4      return rc;
    36.5  }
    36.6  
    36.7 +static long evtchn_rebind(evtchn_rebind_t *bind) 
    36.8 +{
    36.9 +    struct domain *d    = current->domain;
   36.10 +    int            port = bind->port;
   36.11 +    int            vcpu = bind->vcpu;
   36.12 +    struct evtchn *chn;
   36.13 +    long             rc = 0;
   36.14 +
   36.15 +    spin_lock(&d->evtchn_lock);
   36.16 +
   36.17 +    if ( !port_is_valid(d, port) )
   36.18 +    {
   36.19 +        rc = -EINVAL;
   36.20 +        goto out;
   36.21 +    }
   36.22 +
   36.23 +    chn = evtchn_from_port(d, port);
   36.24 +    chn->notify_vcpu_id = vcpu;
   36.25 +
   36.26 + out:
   36.27 +    spin_unlock(&d->evtchn_lock);
   36.28 +    return rc;
   36.29 +}
   36.30  
   36.31  long do_event_channel_op(evtchn_op_t *uop)
   36.32  {
   36.33 @@ -641,6 +664,12 @@ long do_event_channel_op(evtchn_op_t *uo
   36.34              rc = -EFAULT;
   36.35          break;
   36.36  
   36.37 +    case EVTCHNOP_rebind:
   36.38 +        rc = evtchn_rebind(&op.u.rebind);
   36.39 +        if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
   36.40 +            rc = -EFAULT;
   36.41 +        break;
   36.42 +
   36.43      default:
   36.44          rc = -ENOSYS;
   36.45          break;
    37.1 --- a/xen/common/schedule.c	Thu Jul 07 09:27:25 2005 +0000
    37.2 +++ b/xen/common/schedule.c	Fri Jul 08 12:22:18 2005 +0000
    37.3 @@ -38,8 +38,8 @@
    37.4  #include <xen/mm.h>
    37.5  #include <public/sched_ctl.h>
    37.6  
    37.7 -/* opt_sched: scheduler - default to Borrowed Virtual Time */
    37.8 -static char opt_sched[10] = "bvt";
    37.9 +/* opt_sched: scheduler - default to SEDF */
   37.10 +static char opt_sched[10] = "sedf";
   37.11  string_param("sched", opt_sched);
   37.12  
   37.13  #if defined(WAKE_HISTO)
    38.1 --- a/xen/include/public/event_channel.h	Thu Jul 07 09:27:25 2005 +0000
    38.2 +++ b/xen/include/public/event_channel.h	Fri Jul 08 12:22:18 2005 +0000
    38.3 @@ -158,6 +158,13 @@ typedef struct evtchn_status {
    38.4      } u;
    38.5  } evtchn_status_t;
    38.6  
    38.7 +#define EVTCHNOP_rebind        8
    38.8 +typedef struct {
    38.9 +    /* IN parameters. */
   38.10 +    u32 port;                         /*  0 */
   38.11 +    u32 vcpu;                         /*  4 */
   38.12 +} evtchn_rebind_t; /* 8 bytes */
   38.13 +
   38.14  typedef struct evtchn_op {
   38.15      u32 cmd; /* EVTCHNOP_* */
   38.16      union {
   38.17 @@ -169,6 +176,7 @@ typedef struct evtchn_op {
   38.18          evtchn_close_t            close;
   38.19          evtchn_send_t             send;
   38.20          evtchn_status_t           status;
   38.21 +        evtchn_rebind_t           rebind;
   38.22      } u;
   38.23  } evtchn_op_t;
   38.24