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
     1.1 --- a/docs/misc/hg-cheatsheet.txt	Thu Jul 07 09:27:25 2005 +0000
     1.2 +++ b/docs/misc/hg-cheatsheet.txt	Fri Jul 08 12:22:18 2005 +0000
     1.3 @@ -96,6 +96,8 @@ repository from:
     1.4   
     1.5    http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-unstable.hg.tar.gz
     1.6  
     1.7 +  (or copy from /usr/groups/netos/html/xen/downloads/xen-unstable.hg.tar.gz)
     1.8 +
     1.9  Untar the repository on your disk, cd into it, and then pull the most
    1.10  recent changes:
    1.11  
    1.12 @@ -430,4 +432,7 @@ Show the parents of a changeset:
    1.13   you have two parents.  Otherwise, the single parent is the changeset
    1.14   which you most recently checked out.
    1.15  
    1.16 +Show the revision history for a single file
    1.17  
    1.18 +   hg [-v] log <filename>
    1.19 +
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Jul 07 09:27:25 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Fri Jul 08 12:22:18 2005 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  #
     2.5  # Automatically generated make config: don't edit
     2.6  # Linux kernel version: 2.6.11.12-xenU
     2.7 -# Wed Jul  6 17:44:54 2005
     2.8 +# Wed Jul  6 22:40:19 2005
     2.9  #
    2.10  CONFIG_XEN=y
    2.11  CONFIG_ARCH_XEN=y
    2.12 @@ -28,7 +28,6 @@ CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    2.13  #
    2.14  CONFIG_EXPERIMENTAL=y
    2.15  CONFIG_CLEAN_COMPILE=y
    2.16 -CONFIG_BROKEN_ON_SMP=y
    2.17  CONFIG_LOCK_KERNEL=y
    2.18  
    2.19  #
    2.20 @@ -69,6 +68,7 @@ CONFIG_OBSOLETE_MODPARM=y
    2.21  # CONFIG_MODVERSIONS is not set
    2.22  # CONFIG_MODULE_SRCVERSION_ALL is not set
    2.23  CONFIG_KMOD=y
    2.24 +CONFIG_STOP_MACHINE=y
    2.25  
    2.26  #
    2.27  # X86 Processor Configuration
    2.28 @@ -114,7 +114,10 @@ CONFIG_X86_INTEL_USERCOPY=y
    2.29  CONFIG_X86_USE_PPRO_CHECKSUM=y
    2.30  # CONFIG_HPET_TIMER is not set
    2.31  # CONFIG_HPET_EMULATE_RTC is not set
    2.32 -# CONFIG_SMP is not set
    2.33 +CONFIG_SMP=y
    2.34 +CONFIG_SMP_ALTERNATIVES=y
    2.35 +CONFIG_NR_CPUS=8
    2.36 +# CONFIG_SCHED_SMT is not set
    2.37  CONFIG_PREEMPT=y
    2.38  CONFIG_PREEMPT_BKL=y
    2.39  CONFIG_X86_CPUID=y
    2.40 @@ -128,6 +131,7 @@ CONFIG_HIGHMEM4G=y
    2.41  CONFIG_HIGHMEM=y
    2.42  CONFIG_HAVE_DEC_LOCK=y
    2.43  # CONFIG_REGPARM is not set
    2.44 +CONFIG_HOTPLUG_CPU=y
    2.45  
    2.46  #
    2.47  # Kernel hacking
    2.48 @@ -153,7 +157,9 @@ CONFIG_EARLY_PRINTK=y
    2.49  # CONFIG_4KSTACKS is not set
    2.50  CONFIG_GENERIC_HARDIRQS=y
    2.51  CONFIG_GENERIC_IRQ_PROBE=y
    2.52 +CONFIG_X86_SMP=y
    2.53  CONFIG_X86_BIOS_REBOOT=y
    2.54 +CONFIG_X86_TRAMPOLINE=y
    2.55  CONFIG_PC=y
    2.56  
    2.57  #
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c	Thu Jul 07 09:27:25 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Jul 08 12:22:18 2005 +0000
     3.3 @@ -274,7 +274,7 @@ void fixup_irqs(cpumask_t map)
     3.4  		}
     3.5  		if (irq_desc[irq].handler->set_affinity)
     3.6  			irq_desc[irq].handler->set_affinity(irq, mask);
     3.7 -		else if (irq_desc[irq].action && !(warned++))
     3.8 +		else if (irq_desc[irq].action)
     3.9  			printk("Cannot set affinity for irq %i\n", irq);
    3.10  	}
    3.11  
     4.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Thu Jul 07 09:27:25 2005 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/smpboot.c	Fri Jul 08 12:22:18 2005 +0000
     4.3 @@ -103,6 +103,11 @@ static int trampoline_exec;
     4.4  DEFINE_PER_CPU(int, cpu_state) = { 0 };
     4.5  #endif
     4.6  
     4.7 +static DEFINE_PER_CPU(int, resched_irq);
     4.8 +static DEFINE_PER_CPU(int, callfunc_irq);
     4.9 +static char resched_name[NR_CPUS][15];
    4.10 +static char callfunc_name[NR_CPUS][15];
    4.11 +
    4.12  #if 0
    4.13  /*
    4.14   * Currently trivial. Write the real->protected mode
    4.15 @@ -1328,6 +1333,10 @@ static int __devinit cpu_enable(unsigned
    4.16  	while (!cpu_online(cpu))
    4.17  		cpu_relax();
    4.18  
    4.19 +   /* re-route bound IRQs 0 to cpu */
    4.20 +   rebind_evtchn_from_irq(0, cpu,  per_cpu(resched_irq, cpu));
    4.21 +   rebind_evtchn_from_irq(0, cpu, per_cpu(callfunc_irq, cpu));
    4.22 +
    4.23  	fixup_irqs(cpu_online_map);
    4.24  	/* counter the disable in fixup_irqs() */
    4.25  	local_irq_enable();
    4.26 @@ -1357,6 +1366,11 @@ int __cpu_disable(void)
    4.27  
    4.28  	cpu_clear(cpu, map);
    4.29  	fixup_irqs(map);
    4.30 +
    4.31 +   /* re-route IRQs from dead vcpu to another */
    4.32 +   rebind_evtchn_from_irq(cpu, 0,  per_cpu(resched_irq, cpu));
    4.33 +   rebind_evtchn_from_irq(cpu, 0, per_cpu(callfunc_irq, cpu));
    4.34 +
    4.35  	/* It's now safe to remove this processor from the online map */
    4.36  	cpu_clear(cpu, cpu_online_map);
    4.37  
    4.38 @@ -1514,11 +1528,6 @@ void __init smp_cpus_done(unsigned int m
    4.39  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
    4.40  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
    4.41  
    4.42 -static DEFINE_PER_CPU(int, resched_irq);
    4.43 -static DEFINE_PER_CPU(int, callfunc_irq);
    4.44 -static char resched_name[NR_CPUS][15];
    4.45 -static char callfunc_name[NR_CPUS][15];
    4.46 -
    4.47  void __init smp_intr_init(void)
    4.48  {
    4.49  	int cpu = smp_processor_id();
     5.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Thu Jul 07 09:27:25 2005 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/evtchn.c	Fri Jul 08 12:22:18 2005 +0000
     5.3 @@ -271,6 +271,38 @@ int bind_ipi_on_cpu_to_irq(int cpu, int 
     5.4      return irq;
     5.5  }
     5.6  
     5.7 +void rebind_evtchn_from_ipi(int cpu, int newcpu, int ipi)
     5.8 +{
     5.9 +    evtchn_op_t op;
    5.10 +    int evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi];
    5.11 +
    5.12 +    spin_lock(&irq_mapping_update_lock);
    5.13 +
    5.14 +    op.cmd          = EVTCHNOP_rebind;
    5.15 +    op.u.rebind.port = evtchn;
    5.16 +    op.u.rebind.vcpu = newcpu;
    5.17 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
    5.18 +       printk(KERN_INFO "Failed to rebind IPI%d to CPU%d\n",ipi,newcpu);
    5.19 +
    5.20 +    spin_unlock(&irq_mapping_update_lock);
    5.21 +}
    5.22 +
    5.23 +void rebind_evtchn_from_irq(int cpu, int newcpu, int irq)
    5.24 +{
    5.25 +    evtchn_op_t op;
    5.26 +    int evtchn = irq_to_evtchn[irq];
    5.27 +
    5.28 +    spin_lock(&irq_mapping_update_lock);
    5.29 +
    5.30 +    op.cmd          = EVTCHNOP_rebind;
    5.31 +    op.u.rebind.port = evtchn;
    5.32 +    op.u.rebind.vcpu = newcpu;
    5.33 +    if ( HYPERVISOR_event_channel_op(&op) != 0 )
    5.34 +       printk(KERN_INFO "Failed to rebind IRQ%d to CPU%d\n",irq,newcpu);
    5.35 +
    5.36 +    spin_unlock(&irq_mapping_update_lock);
    5.37 +}
    5.38 +
    5.39  void unbind_ipi_on_cpu_from_irq(int cpu, int ipi)
    5.40  {
    5.41      evtchn_op_t op;
     6.1 --- a/tools/Rules.mk	Thu Jul 07 09:27:25 2005 +0000
     6.2 +++ b/tools/Rules.mk	Fri Jul 08 12:22:18 2005 +0000
     6.3 @@ -7,12 +7,12 @@ XEN_LIBXC          = $(XEN_ROOT)/tools/l
     6.4  
     6.5  ifeq ($(XEN_TARGET_ARCH),x86_32)
     6.6  CFLAGS  += -m32 -march=i686
     6.7 -LDFLAGS += -m elf_i386
     6.8 +LDFLAGS += -m32
     6.9  endif
    6.10  
    6.11  ifeq ($(XEN_TARGET_ARCH),x86_64)
    6.12  CFLAGS  += -m64
    6.13 -LDFLAGS += -m elf_x86_64
    6.14 +LDFLAGS += -m64
    6.15  endif
    6.16  
    6.17  X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
     7.1 --- a/tools/firmware/vmxassist/Makefile	Thu Jul 07 09:27:25 2005 +0000
     7.2 +++ b/tools/firmware/vmxassist/Makefile	Fri Jul 08 12:22:18 2005 +0000
     7.3 @@ -29,16 +29,13 @@ XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN
     7.4  #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
     7.5  #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
     7.6  
     7.7 -LD=ld
     7.8 -CC=gcc
     7.9 -CPP=cpp -P
    7.10 -OBJCOPY=objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
    7.11 -CFLAGS=${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    7.12 -
    7.13 -ifeq ($(XEN_COMPILE_ARCH),x86_64)
    7.14 +LD       = ld
    7.15 +CC       = gcc
    7.16 +CPP      = cpp -P
    7.17 +OBJCOPY  = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
    7.18 +CFLAGS   = ${DEFINES} -I. $(XENINC) -Wall -fno-builtin -O2 -msoft-float
    7.19  CFLAGS  += -m32 -march=i686
    7.20 -LDFLAGS += -m elf_i386
    7.21 -endif
    7.22 +LDFLAGS  = -m elf_i386
    7.23  
    7.24  OBJECTS = head.o trap.o vm86.o setup.o util.o
    7.25  
     8.1 --- a/tools/misc/cpuperf/Makefile	Thu Jul 07 09:27:25 2005 +0000
     8.2 +++ b/tools/misc/cpuperf/Makefile	Fri Jul 08 12:22:18 2005 +0000
     8.3 @@ -17,8 +17,7 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
     8.4  XEN_ROOT=../../..
     8.5  include $(XEN_ROOT)/tools/Rules.mk
     8.6  
     8.7 -CC           = gcc
     8.8 -CFLAGS       = -Wall -O3 
     8.9 +CFLAGS      += -Wall -O3 
    8.10  
    8.11  HDRS         = $(wildcard *.h)
    8.12  SRCS         = $(wildcard *.c)
     9.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Jul 07 09:27:25 2005 +0000
     9.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Jul 08 12:22:18 2005 +0000
     9.3 @@ -423,8 +423,10 @@ class XendDomainInfo:
     9.4              sxpr.append(['cpu_time', self.info['cpu_time']/1e9])    
     9.5              sxpr.append(['vcpus', self.info['vcpus']])
     9.6              sxpr.append(['cpumap', self.info['cpumap']])
     9.7 -            sxpr.append(['vcpu_to_cpu', ''.join(map(lambda x: str(x),
     9.8 -                        self.info['vcpu_to_cpu'][0:self.info['vcpus']]))])
     9.9 +            # build a string, using '|' to seperate items, show only up
    9.10 +            # to number of vcpus in domain, and trim the trailing '|'
    9.11 +            sxpr.append(['vcpu_to_cpu', ''.join(map(lambda x: str(x)+'|',
    9.12 +                        self.info['vcpu_to_cpu'][0:self.info['vcpus']]))[:-1]])
    9.13              
    9.14          if self.start_time:
    9.15              up_time =  time.time() - self.start_time  
    10.1 --- a/tools/python/xen/xm/main.py	Thu Jul 07 09:27:25 2005 +0000
    10.2 +++ b/tools/python/xen/xm/main.py	Fri Jul 08 12:22:18 2005 +0000
    10.3 @@ -410,8 +410,7 @@ class ProgList(Prog):
    10.4          print 'Name              Id  VCPU  CPU  CPUMAP'
    10.5          for dom in doms:
    10.6              info = server.xend_domain(dom)
    10.7 -            # XXX this is quite broken for cpu's > 9
    10.8 -            vcpu_to_cpu = sxp.child_value(info, 'vcpu_to_cpu', '?').replace('-1','#')
    10.9 +            vcpu_to_cpu = sxp.child_value(info, 'vcpu_to_cpu', '-1').split('|')
   10.10              cpumap = sxp.child_value(info, 'cpumap', [])
   10.11              mask = ((int(sxp.child_value(info, 'vcpus', '0')))**2) - 1
   10.12              count = 0
   10.13 @@ -420,10 +419,7 @@ class ProgList(Prog):
   10.14                  d['name']   = sxp.child_value(info, 'name', '??')
   10.15                  d['dom']    = int(sxp.child_value(info, 'id', '-1'))
   10.16                  d['vcpu']   = int(count)
   10.17 -                if cpu == "#":
   10.18 -                    d['cpu']    = int("-1")
   10.19 -                else:
   10.20 -                    d['cpu']    = int(cpu)
   10.21 +                d['cpu']    = int(cpu)
   10.22                  d['cpumap'] = int(cpumap[count])&mask
   10.23                  count = count + 1
   10.24                  print ("%(name)-16s %(dom)3d  %(vcpu)4d  %(cpu)3d  0x%(cpumap)x" % d)
   10.25 @@ -593,15 +589,7 @@ domain DOM"""
   10.26          state = int(args[3])
   10.27          dom = server.xend_domain(name)
   10.28          id = sxp.child_value(dom, 'id')
   10.29 -        vcpu_to_cpu = sxp.child_value(dom, 'vcpu_to_cpu', '-1')
   10.30 -        # only send state change if states differ 
   10.31 -        try:
   10.32 -            # (down going up) or (up going down)
   10.33 -            if (vcpu_to_cpu[vcpu] == "-1" and state == 1) or \
   10.34 -               (vcpu_to_cpu[vcpu] != "-1" and state == 0):
   10.35 -                server.xend_domain_vcpu_hotplug(id, vcpu, state)
   10.36 -        except IndexError:
   10.37 -            print "Invalid VCPU(%d)"%(vcpu)
   10.38 +        server.xend_domain_vcpu_hotplug(id, vcpu, state)
   10.39  
   10.40  xm.prog(ProgVcpuhotplug)
   10.41  
    11.1 --- a/tools/xenstore/Makefile	Thu Jul 07 09:27:25 2005 +0000
    11.2 +++ b/tools/xenstore/Makefile	Fri Jul 08 12:22:18 2005 +0000
    11.3 @@ -19,11 +19,11 @@ BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
    11.4  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
    11.5  BASECFLAGS+= -I.
    11.6  
    11.7 -CFLAGS += $(BASECFLAGS)
    11.8 -LDFLAGS=$(PROFILE) -L$(XEN_LIBXC)
    11.9 -TESTDIR=`pwd`/testsuite/tmp
   11.10 -TESTFLAGS=-DTESTING
   11.11 -TESTENV=XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
   11.12 +CFLAGS  += $(BASECFLAGS)
   11.13 +LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
   11.14 +TESTDIR  = `pwd`/testsuite/tmp
   11.15 +TESTFLAGS= -DTESTING
   11.16 +TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
   11.17  
   11.18  all: xen xenstored libxenstore.a libxenstore-pic.a
   11.19  
    12.1 --- a/xen/common/event_channel.c	Thu Jul 07 09:27:25 2005 +0000
    12.2 +++ b/xen/common/event_channel.c	Fri Jul 08 12:22:18 2005 +0000
    12.3 @@ -583,6 +583,29 @@ static long evtchn_status(evtchn_status_
    12.4      return rc;
    12.5  }
    12.6  
    12.7 +static long evtchn_rebind(evtchn_rebind_t *bind) 
    12.8 +{
    12.9 +    struct domain *d    = current->domain;
   12.10 +    int            port = bind->port;
   12.11 +    int            vcpu = bind->vcpu;
   12.12 +    struct evtchn *chn;
   12.13 +    long             rc = 0;
   12.14 +
   12.15 +    spin_lock(&d->evtchn_lock);
   12.16 +
   12.17 +    if ( !port_is_valid(d, port) )
   12.18 +    {
   12.19 +        rc = -EINVAL;
   12.20 +        goto out;
   12.21 +    }
   12.22 +
   12.23 +    chn = evtchn_from_port(d, port);
   12.24 +    chn->notify_vcpu_id = vcpu;
   12.25 +
   12.26 + out:
   12.27 +    spin_unlock(&d->evtchn_lock);
   12.28 +    return rc;
   12.29 +}
   12.30  
   12.31  long do_event_channel_op(evtchn_op_t *uop)
   12.32  {
   12.33 @@ -641,6 +664,12 @@ long do_event_channel_op(evtchn_op_t *uo
   12.34              rc = -EFAULT;
   12.35          break;
   12.36  
   12.37 +    case EVTCHNOP_rebind:
   12.38 +        rc = evtchn_rebind(&op.u.rebind);
   12.39 +        if ( (rc == 0) && (copy_to_user(uop, &op, sizeof(op)) != 0) )
   12.40 +            rc = -EFAULT;
   12.41 +        break;
   12.42 +
   12.43      default:
   12.44          rc = -ENOSYS;
   12.45          break;
    13.1 --- a/xen/common/schedule.c	Thu Jul 07 09:27:25 2005 +0000
    13.2 +++ b/xen/common/schedule.c	Fri Jul 08 12:22:18 2005 +0000
    13.3 @@ -38,8 +38,8 @@
    13.4  #include <xen/mm.h>
    13.5  #include <public/sched_ctl.h>
    13.6  
    13.7 -/* opt_sched: scheduler - default to Borrowed Virtual Time */
    13.8 -static char opt_sched[10] = "bvt";
    13.9 +/* opt_sched: scheduler - default to SEDF */
   13.10 +static char opt_sched[10] = "sedf";
   13.11  string_param("sched", opt_sched);
   13.12  
   13.13  #if defined(WAKE_HISTO)
    14.1 --- a/xen/include/public/event_channel.h	Thu Jul 07 09:27:25 2005 +0000
    14.2 +++ b/xen/include/public/event_channel.h	Fri Jul 08 12:22:18 2005 +0000
    14.3 @@ -158,6 +158,13 @@ typedef struct evtchn_status {
    14.4      } u;
    14.5  } evtchn_status_t;
    14.6  
    14.7 +#define EVTCHNOP_rebind        8
    14.8 +typedef struct {
    14.9 +    /* IN parameters. */
   14.10 +    u32 port;                         /*  0 */
   14.11 +    u32 vcpu;                         /*  4 */
   14.12 +} evtchn_rebind_t; /* 8 bytes */
   14.13 +
   14.14  typedef struct evtchn_op {
   14.15      u32 cmd; /* EVTCHNOP_* */
   14.16      union {
   14.17 @@ -169,6 +176,7 @@ typedef struct evtchn_op {
   14.18          evtchn_close_t            close;
   14.19          evtchn_send_t             send;
   14.20          evtchn_status_t           status;
   14.21 +        evtchn_rebind_t           rebind;
   14.22      } u;
   14.23  } evtchn_op_t;
   14.24