ia64/xen-unstable

changeset 681:3aa0265ba99b

bitkeeper revision 1.396 (3f4d2199UsCzVuRmn-0-L6lh9VGYZg)

Many files:
Small cleanups. Faster checksum calculation for console UDP packets.
author kaf24@scramble.cl.cam.ac.uk
date Wed Aug 27 21:24:41 2003 +0000 (2003-08-27)
parents 203cbb0ec54e
children 29c5d712802c
files Makefile xen/TODO xen/common/domain.c xen/common/kernel.c xen/common/schedule.c xen/common/timer.c xen/tools/elf-reloc.c xen/tools/figlet/figlet.c
line diff
     1.1 --- a/Makefile	Tue Aug 19 21:27:44 2003 +0000
     1.2 +++ b/Makefile	Wed Aug 27 21:24:41 2003 +0000
     1.3 @@ -13,7 +13,7 @@
     1.4  # the latest Java 2 SDK on your execution path: <http://java.sun.com>
     1.5  # Also, you will need Apache's 'ant' build tool: <http://ant.apache.org>
     1.6  #
     1.7 -# If you received this sourec as part of a Xen release, you should find
     1.8 +# If you received this source as part of a Xen release, you should find
     1.9  # that appropriate versions of the build tools are already installed in
    1.10  # the initial system setup.
    1.11  
     2.1 --- a/xen/TODO	Tue Aug 19 21:27:44 2003 +0000
     2.2 +++ b/xen/TODO	Wed Aug 27 21:24:41 2003 +0000
     2.3 @@ -1,19 +1,15 @@
     2.4  
     2.5 -This is stuff we probably want to implement in the near future. I
     2.6 -think I have them in a sensible priority order -- the first few would
     2.7 -be nice to fix before a code release. The later ones can be
     2.8 -longer-term goals.
     2.9 +This is stuff we probably want to implement in the near future.
    2.10  
    2.11   -- Keir (16/3/03)
    2.12  
    2.13  
    2.14 -1. ACCURATE TIMERS AND WALL-CLOCK TIME
    2.15 ---------------------------------------
    2.16 -Currently our long-term timebase free runs on CPU0, with no external
    2.17 -calibration. We should run ntpd on domain 0 and allow this to warp
    2.18 -Xen's timebase. Once this is done, we can have a timebase per CPU and
    2.19 -not worry about relative drift (since they'll all get sync'ed
    2.20 -periodically by ntp).
    2.21 +1. DOMAIN-0 MANAGEMENT DAEMON
    2.22 +-----------------------------
    2.23 +A better control daemon is required for domain 0, which keeps proper
    2.24 +track of machine resources and can make sensible policy choices. This
    2.25 +may require support in Xen; for example, notifications (eg. DOMn is
    2.26 +killed), and requests (eg. can DOMn allocate x frames of memory?).
    2.27  
    2.28  2. ASSIGNING DOMAINS TO PROCESSORS
    2.29  ----------------------------------
    2.30 @@ -27,42 +23,11 @@ relationships between processors in the 
    2.31  siblings in the same package). We then use this to balance domains
    2.32  across packages, and across virtual processors within a package.
    2.33  
    2.34 -3. DOMAIN 0 MANAGEMENT DAEMON
    2.35 ------------------------------
    2.36 -A better control daemon is required for domain 0, which keeps proper
    2.37 -track of machine resources and can make sensible policy choices. This
    2.38 -may require support in Xen; for example, notifications (eg. DOMn is
    2.39 -killed), and requests (eg. can DOMn allocate x frames of memory?).
    2.40 -
    2.41 -4. SANE NETWORK ROUTING
    2.42 +3. SANE NETWORK ROUTING
    2.43  -----------------------
    2.44  The current virtual firewall/router is completely broken. Needs a new
    2.45  design and implementation!
    2.46  
    2.47 -5. NETWORK CHECKSUM OFFLOAD 
    2.48 ---------------------------- 
    2.49 -All the NICs that we support can checksum packets on behalf of guest
    2.50 -OSes. We need to add appropriate flags to and from each domain to
    2.51 -indicate, on transmit, which packets need the checksum added and, on
    2.52 -receive, which packets have been checked out as okay. We can steal
    2.53 -Linux's interface, which is entirely sane given NIC limitations.
    2.54 -
    2.55 -6. MODULE SUPPORT FOR XEN
    2.56 --------------------------
    2.57 -Network and blkdev drivers are bloating Xen. At some point we want to
    2.58 -build drivers as modules, stick them in a cheesy ramfs, then relocate
    2.59 -them one by one at boot time. If a driver duccessfully probes hardware
    2.60 -we keep it, otherwise we blow it away. Alternative is to have a
    2.61 -central PCI ID to driver name repository. We then use that to decide
    2.62 -which drivers to load.
    2.63 -
    2.64 -Most of the hard stuff (relocating and the like) is done for us by
    2.65 -Linux's module system.
    2.66 -
    2.67 -7. NEW DESIGN FEATURES
    2.68 -----------------------
    2.69 -This includes the last-chance page cache, and the unified buffer cache.
    2.70 -
    2.71  
    2.72  
    2.73  Graveyard
     3.1 --- a/xen/common/domain.c	Tue Aug 19 21:27:44 2003 +0000
     3.2 +++ b/xen/common/domain.c	Wed Aug 27 21:24:41 2003 +0000
     3.3 @@ -671,12 +671,13 @@ int setup_guestos(struct task_struct *p,
     3.4          ((p->tot_pages - 1) << PAGE_SHIFT); 
     3.5  
     3.6      virt_startinfo_address->dom_id = p->domain;
     3.7 -    virt_startinfo_address->flags  = IS_PRIV(p) ? SIF_PRIVILEGED : 0;
     3.8 -    // guest os can have console if:
     3.9 -    // 1) its privileged (need iopl right now)
    3.10 -    // 2) its the owner of the console (and therefore will get kbd/mouse events)
    3.11 -    // 3) xen hasnt tried to touch the console (see console.h)
    3.12 -    virt_startinfo_address->flags |= (IS_PRIV(p) && CONSOLE_ISOWNER(p) ) ? SIF_CONSOLE : 0;
    3.13 +    virt_startinfo_address->flags  = 0;
    3.14 +    if ( IS_PRIV(p) )
    3.15 +    {
    3.16 +        virt_startinfo_address->flags |= SIF_PRIVILEGED;
    3.17 +        if ( CONSOLE_ISOWNER(p) )
    3.18 +            virt_startinfo_address->flags |= SIF_CONSOLE;
    3.19 +    }
    3.20  
    3.21      if ( initrd_len )
    3.22      {
    3.23 @@ -717,10 +718,10 @@ int setup_guestos(struct task_struct *p,
    3.24      }
    3.25      *dst = '\0';
    3.26  
    3.27 -    /* If this guy's getting the console we'd better let go */
    3.28 +    /* If this guy's getting the console we'd better let go. */
    3.29      if ( virt_startinfo_address->flags & SIF_CONSOLE )
    3.30      {
    3.31 -        // should reset the console, but seems to work anyhow...
    3.32 +        /* NB. Should reset the console here. */
    3.33          opt_console = 0;
    3.34      }  
    3.35  
     4.1 --- a/xen/common/kernel.c	Tue Aug 19 21:27:44 2003 +0000
     4.2 +++ b/xen/common/kernel.c	Wed Aug 27 21:24:41 2003 +0000
     4.3 @@ -458,25 +458,12 @@ asmlinkage long sys_ni_syscall(void)
     4.4  
     4.5  unsigned short compute_cksum(unsigned short *buf, int count)
     4.6  {
     4.7 -	/* Function written by ek247
     4.8 -	 * Computes IP and UDP checksum.
     4.9 -	 * To be used for the fake console packets
    4.10 -	 * created in console_export
    4.11 -	 */
    4.12 -
    4.13 -    unsigned long sum=0;
    4.14 -
    4.15 -    while (count--)
    4.16 -    {
    4.17 -        sum+=*buf++;
    4.18 -        if (sum & 0xFFFF0000)
    4.19 -        {
    4.20 -            //carry occured, so wrap around
    4.21 -            sum &=0xFFFF;
    4.22 -            sum++;
    4.23 -        }
    4.24 -    }
    4.25 -    return ~(sum & 0xFFFF);
    4.26 +    unsigned long sum = 0;
    4.27 +    while ( count-- )
    4.28 +        sum += *buf++;
    4.29 +    sum += sum >> 16;
    4.30 +    sum += sum >> 16;
    4.31 +    return (unsigned short)~sum;
    4.32  }
    4.33  
    4.34  
     5.1 --- a/xen/common/schedule.c	Tue Aug 19 21:27:44 2003 +0000
     5.2 +++ b/xen/common/schedule.c	Wed Aug 27 21:24:41 2003 +0000
     5.3 @@ -171,7 +171,6 @@ int wake_up(struct task_struct *p)
     5.4  
     5.5      p->state = TASK_RUNNING;
     5.6      __add_to_runqueue_head(p);
     5.7 -    //__add_to_runqueue_tail(p);
     5.8  
     5.9      /* set the BVT parameters */
    5.10      if (p->avt < schedule_data[p->processor].svt)
     6.1 --- a/xen/common/timer.c	Tue Aug 19 21:27:44 2003 +0000
     6.2 +++ b/xen/common/timer.c	Wed Aug 27 21:24:41 2003 +0000
     6.3 @@ -280,7 +280,7 @@ static inline void cascade_timers(struct
     6.4  
     6.5  		tmp = list_entry(curr, struct timer_list, list);
     6.6  		next = curr->next;
     6.7 -		list_del(curr); // not needed
     6.8 +		list_del(curr); /* not needed */
     6.9  		internal_add_timer(tmp);
    6.10  		curr = next;
    6.11  	}
    6.12 @@ -509,18 +509,12 @@ static void update_wall_time(unsigned lo
    6.13  static inline void do_process_times(struct task_struct *p,
    6.14  	unsigned long user, unsigned long system)
    6.15  {
    6.16 -    //unsigned long psecs;
    6.17 -
    6.18 -//	psecs = (p->times.tms_utime += user);
    6.19 -	//psecs += (p->times.tms_stime += system);
    6.20  }
    6.21  
    6.22  
    6.23  void update_one_process(struct task_struct *p, unsigned long user,
    6.24  			unsigned long system, int cpu)
    6.25  {
    6.26 -//	p->per_cpu_utime[cpu] += user;
    6.27 -//	p->per_cpu_stime[cpu] += system;
    6.28  	do_process_times(p, user, system);
    6.29  }	
    6.30  
     7.1 --- a/xen/tools/elf-reloc.c	Tue Aug 19 21:27:44 2003 +0000
     7.2 +++ b/xen/tools/elf-reloc.c	Wed Aug 27 21:24:41 2003 +0000
     7.3 @@ -4,7 +4,7 @@
     7.4   * Usage: elf-reloc <old base> <new base> <image>
     7.5   * 
     7.6   * Relocates <image> from <old base> address to <new base> address by
     7.7 - * frobbing the Elf headers. Segment contents are unmodified!
     7.8 + * frobbing the Elf headers. Segment contents are unmodified.
     7.9   */
    7.10  
    7.11  #include <stdio.h>
     8.1 --- a/xen/tools/figlet/figlet.c	Tue Aug 19 21:27:44 2003 +0000
     8.2 +++ b/xen/tools/figlet/figlet.c	Wed Aug 27 21:24:41 2003 +0000
     8.3 @@ -5,9 +5,9 @@
     8.4   * This is a HACKED figlet source file for Xen.
     8.5   * 
     8.6   * Hacked to output C octal strings for inclusion in a header file.
     8.7 - * Support for opening zippe files is removed.
     8.8 + * Support for opening zipped files is removed.
     8.9   * 
    8.10 - * Go to www.figlet.org for teh unhacked Figlet sources!
    8.11 + * Go to www.figlet.org for the unhacked Figlet sources.
    8.12   */
    8.13  
    8.14  /****************************************************************************