ia64/xen-unstable

changeset 8197:30eb074a560a

Merged.
author emellor@leeni.uk.xensource.com
date Fri Dec 02 15:48:55 2005 +0000 (2005-12-02)
parents 485871ff1d39 e13c994bdccb
children a9c35cd7e559
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Fri Dec 02 15:48:44 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Fri Dec 02 15:48:55 2005 +0000
     1.3 @@ -2724,7 +2724,7 @@ CONFIG_NTFS_FS=m
     1.4  CONFIG_PROC_FS=y
     1.5  CONFIG_PROC_KCORE=y
     1.6  CONFIG_SYSFS=y
     1.7 -CONFIG_DEVFS_FS=y
     1.8 +# CONFIG_DEVFS_FS is not set
     1.9  # CONFIG_DEVFS_MOUNT is not set
    1.10  # CONFIG_DEVFS_DEBUG is not set
    1.11  CONFIG_DEVPTS_FS_XATTR=y
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Fri Dec 02 15:48:44 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Fri Dec 02 15:48:55 2005 +0000
     2.3 @@ -2201,7 +2201,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
     2.4  CONFIG_PROC_FS=y
     2.5  CONFIG_PROC_KCORE=y
     2.6  CONFIG_SYSFS=y
     2.7 -CONFIG_DEVFS_FS=y
     2.8 +# CONFIG_DEVFS_FS is not set
     2.9  CONFIG_DEVPTS_FS_XATTR=y
    2.10  CONFIG_DEVPTS_FS_SECURITY=y
    2.11  CONFIG_TMPFS=y
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Fri Dec 02 15:48:44 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Fri Dec 02 15:48:55 2005 +0000
     3.3 @@ -28,8 +28,6 @@
     3.4  #endif
     3.5  #include <asm-xen/evtchn.h>
     3.6  
     3.7 -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg)
     3.8 -
     3.9  /*
    3.10   *	Some notes on x86 processor bugs affecting SMP operation:
    3.11   *
    3.12 @@ -542,9 +540,7 @@ static void stop_this_cpu (void * dummy)
    3.13  	 */
    3.14  	cpu_clear(smp_processor_id(), cpu_online_map);
    3.15  	local_irq_disable();
    3.16 -#if 1
    3.17 -	xxprint("stop_this_cpu disable_local_APIC\n");
    3.18 -#else
    3.19 +#if 0
    3.20  	disable_local_APIC();
    3.21  #endif
    3.22  	if (cpu_data[smp_processor_id()].hlt_works_ok)
    3.23 @@ -561,9 +557,7 @@ void smp_send_stop(void)
    3.24  	smp_call_function(stop_this_cpu, NULL, 1, 0);
    3.25  
    3.26  	local_irq_disable();
    3.27 -#if 1
    3.28 -	xxprint("smp_send_stop disable_local_APIC\n");
    3.29 -#else
    3.30 +#if 0
    3.31  	disable_local_APIC();
    3.32  #endif
    3.33  	local_irq_enable();
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Dec 02 15:48:44 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Dec 02 15:48:55 2005 +0000
     4.3 @@ -389,7 +389,6 @@ void pgd_free(pgd_t *pgd)
     4.4  }
     4.5  
     4.6  #ifndef CONFIG_XEN_SHADOW_MODE
     4.7 -asmlinkage int xprintk(const char *fmt, ...);
     4.8  void make_lowmem_page_readonly(void *va)
     4.9  {
    4.10  	pte_t *pte = virt_to_ptep(va);
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c	Fri Dec 02 15:48:44 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c	Fri Dec 02 15:48:55 2005 +0000
     5.3 @@ -31,8 +31,6 @@
     5.4  #ifdef CONFIG_XEN
     5.5  #include <asm-xen/evtchn.h>
     5.6  
     5.7 -#define xxprint(msg) HYPERVISOR_console_io(CONSOLEIO_write, strlen(msg), msg)
     5.8 -
     5.9  #else
    5.10  /*
    5.11   *	Smarter SMP flushing macros. 
    5.12 @@ -379,8 +377,6 @@ void smp_stop_cpu(void)
    5.13  	local_irq_disable();
    5.14  #ifndef CONFIG_XEN
    5.15  	disable_local_APIC();
    5.16 -#else
    5.17 -	xxprint("stop_this_cpu disable_local_APIC\n");
    5.18  #endif
    5.19  	local_irq_enable(); 
    5.20  }
    5.21 @@ -409,9 +405,7 @@ void smp_send_stop(void)
    5.22  		spin_unlock(&call_lock);
    5.23  
    5.24  	local_irq_disable();
    5.25 -#ifdef CONFIG_XEN
    5.26 -	xxprint("stop_this_cpu disable_local_APIC\n");
    5.27 -#else
    5.28 +#ifndef CONFIG_XEN
    5.29  	disable_local_APIC();
    5.30  #endif
    5.31  	local_irq_enable();
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Fri Dec 02 15:48:44 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Fri Dec 02 15:48:55 2005 +0000
     6.3 @@ -498,10 +498,14 @@ static void make_response(blkif_t *blkif
     6.4           * notifications if requests are already in flight (lower overheads
     6.5           * and promotes batching).
     6.6           */
     6.7 -	if (!__on_blkdev_list(blkif) &&
     6.8 -	    RING_HAS_UNCONSUMED_REQUESTS(blk_ring)) {
     6.9 -		add_to_blkdev_list_tail(blkif);
    6.10 -		maybe_trigger_blkio_schedule();
    6.11 +	mb();
    6.12 +	if (!__on_blkdev_list(blkif)) {
    6.13 +		int more_to_do;
    6.14 +		RING_FINAL_CHECK_FOR_REQUESTS(blk_ring, more_to_do);
    6.15 +		if (more_to_do) {
    6.16 +			add_to_blkdev_list_tail(blkif);
    6.17 +			maybe_trigger_blkio_schedule();
    6.18 +		}
    6.19  	}
    6.20  
    6.21  	if (notify)
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Dec 02 15:48:44 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Dec 02 15:48:55 2005 +0000
     7.3 @@ -311,7 +311,7 @@ static void connect(struct blkfront_info
     7.4  	int err;
     7.5  
     7.6          if( (info->connected == BLKIF_STATE_CONNECTED) || 
     7.7 -	    (info->connected == BLKIF_STATE_SUSPENDED) ) 
     7.8 +	    (info->connected == BLKIF_STATE_SUSPENDED) )
     7.9  		return;
    7.10  
    7.11  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    7.12 @@ -327,16 +327,18 @@ static void connect(struct blkfront_info
    7.13  				 info->xbdev->otherend);
    7.14  		return;
    7.15  	}
    7.16 -	
    7.17 +
    7.18          xlvbd_add(sectors, info->vdevice, binfo, sector_size, info);
    7.19  
    7.20  	(void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 
    7.21 -	
    7.22 +
    7.23  	/* Kick pending requests. */
    7.24  	spin_lock_irq(&blkif_io_lock);
    7.25  	info->connected = BLKIF_STATE_CONNECTED;
    7.26  	kick_pending_request_queues(info);
    7.27  	spin_unlock_irq(&blkif_io_lock);
    7.28 +
    7.29 +	add_disk(info->gd);
    7.30  }
    7.31  
    7.32  /**
    7.33 @@ -395,16 +397,11 @@ static inline void ADD_ID_TO_FREELIST(
    7.34  
    7.35  static inline void flush_requests(struct blkfront_info *info)
    7.36  {
    7.37 -	RING_IDX old_prod = info->ring.sring->req_prod;
    7.38 -
    7.39 -	RING_PUSH_REQUESTS(&info->ring);
    7.40 +	int notify;
    7.41  
    7.42 -	/*
    7.43 -         * Send new requests /then/ check if any old requests are still in
    7.44 -         * flight. If so then there is no need to send a notification.
    7.45 -         */
    7.46 -	mb();
    7.47 -	if (info->ring.sring->rsp_prod == old_prod)
    7.48 +	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&info->ring, notify);
    7.49 +
    7.50 +	if (notify)
    7.51  		notify_remote_via_irq(info->irq);
    7.52  }
    7.53  
    7.54 @@ -593,7 +590,6 @@ void do_blkif_request(request_queue_t *r
    7.55  
    7.56  	while ((req = elv_next_request(rq)) != NULL) {
    7.57  		info = req->rq_disk->private_data;
    7.58 -
    7.59  		if (!blk_fs_request(req)) {
    7.60  			end_request(req, 0);
    7.61  			continue;
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Fri Dec 02 15:48:44 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Fri Dec 02 15:48:55 2005 +0000
     8.3 @@ -146,6 +146,9 @@ extern int blkif_revalidate(dev_t dev);
     8.4  extern void do_blkif_request (request_queue_t *rq); 
     8.5  
     8.6  /* Virtual block-device subsystem. */
     8.7 +/* Note that xlvbd_add doesn't call add_disk for you: you're expected
     8.8 +   to call add_disk on info->gd once the disk is properly connected
     8.9 +   up. */
    8.10  int xlvbd_add(blkif_sector_t capacity, int device,
    8.11  	      u16 vdisk_info, u16 sector_size, struct blkfront_info *info);
    8.12  void xlvbd_del(struct blkfront_info *info);
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Fri Dec 02 15:48:44 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Fri Dec 02 15:48:55 2005 +0000
     9.3 @@ -261,7 +261,6 @@ xlvbd_alloc_gendisk(int minor, blkif_sec
     9.4  	if (vdisk_info & VDISK_CDROM)
     9.5  		gd->flags |= GENHD_FL_CD;
     9.6  
     9.7 -	add_disk(gd);
     9.8  	info->gd = gd;
     9.9  
    9.10  	return 0;
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Dec 02 15:48:44 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Dec 02 15:48:55 2005 +0000
    10.3 @@ -55,7 +55,6 @@
    10.4  #include <asm-xen/evtchn.h>
    10.5  #include <asm-xen/xencons.h>
    10.6  
    10.7 -#include "xencons_ring.h"
    10.8  /*
    10.9   * Modes:
   10.10   *  'xencons=off'  [XC_OFF]:     Console is disabled.
   10.11 @@ -135,20 +134,22 @@ static struct tty_driver *xencons_driver
   10.12  static void kcons_write(
   10.13  	struct console *c, const char *s, unsigned int count)
   10.14  {
   10.15 -	int           i;
   10.16 +	int           i = 0;
   10.17  	unsigned long flags;
   10.18  
   10.19  	spin_lock_irqsave(&xencons_lock, flags);
   10.20 -    
   10.21 -	for (i = 0; i < count; i++) {
   10.22 -		if ((wp - wc) >= (wbuf_size - 1))
   10.23 -			break;
   10.24 -		if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n')
   10.25 -			wbuf[WBUF_MASK(wp++)] = '\r';
   10.26 +
   10.27 +	while (i < count) {
   10.28 +		for (; i < count; i++) {
   10.29 +			if ((wp - wc) >= (wbuf_size - 1))
   10.30 +				break;
   10.31 +			if ((wbuf[WBUF_MASK(wp++)] = s[i]) == '\n')
   10.32 +				wbuf[WBUF_MASK(wp++)] = '\r';
   10.33 +		}
   10.34 +
   10.35 +		__xencons_tx_flush();
   10.36  	}
   10.37  
   10.38 -	__xencons_tx_flush();
   10.39 -
   10.40  	spin_unlock_irqrestore(&xencons_lock, flags);
   10.41  }
   10.42  
   10.43 @@ -247,7 +248,6 @@ void xencons_force_flush(void)
   10.44  	if (xen_start_info->flags & SIF_INITDOMAIN)
   10.45  		return;
   10.46  
   10.47 -
   10.48  	/* Spin until console data is flushed through to the daemon. */
   10.49  	while (wc != wp) {
   10.50  		int sent = 0;
   10.51 @@ -271,8 +271,7 @@ static struct tty_struct *xencons_tty;
   10.52  static int xencons_priv_irq;
   10.53  static char x_char;
   10.54  
   10.55 -/* Non-privileged receive callback. */
   10.56 -static void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
   10.57 +void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
   10.58  {
   10.59  	int           i;
   10.60  	unsigned long flags;
   10.61 @@ -311,10 +310,9 @@ static void xencons_rx(char *buf, unsign
   10.62  	spin_unlock_irqrestore(&xencons_lock, flags);
   10.63  }
   10.64  
   10.65 -/* Privileged and non-privileged transmit worker. */
   10.66  static void __xencons_tx_flush(void)
   10.67  {
   10.68 -	int sz, work_done = 0;
   10.69 +	int sent, sz, work_done = 0;
   10.70  
   10.71  	if (xen_start_info->flags & SIF_INITDOMAIN) {
   10.72  		if (x_char) {
   10.73 @@ -340,20 +338,18 @@ static void __xencons_tx_flush(void)
   10.74  		}
   10.75  
   10.76  		while (wc != wp) {
   10.77 -			int sent;
   10.78  			sz = wp - wc;
   10.79  			if (sz > (wbuf_size - WBUF_MASK(wc)))
   10.80  				sz = wbuf_size - WBUF_MASK(wc);
   10.81  			sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz);
   10.82 -			if (sent > 0) {
   10.83 -				wc += sent;
   10.84 -				work_done = 1;
   10.85 -			}
   10.86 +			if (sent == 0)
   10.87 +				break;
   10.88 +			wc += sent;
   10.89 +			work_done = 1;
   10.90  		}
   10.91  	}
   10.92  
   10.93 -	if (work_done && (xencons_tty != NULL))
   10.94 -	{
   10.95 +	if (work_done && (xencons_tty != NULL)) {
   10.96  		wake_up_interruptible(&xencons_tty->write_wait);
   10.97  		if ((xencons_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
   10.98  		    (xencons_tty->ldisc.write_wakeup != NULL))
   10.99 @@ -361,31 +357,26 @@ static void __xencons_tx_flush(void)
  10.100  	}
  10.101  }
  10.102  
  10.103 +void xencons_tx(void)
  10.104 +{
  10.105 +	unsigned long flags;
  10.106 +
  10.107 +	spin_lock_irqsave(&xencons_lock, flags);
  10.108 +	__xencons_tx_flush();
  10.109 +	spin_unlock_irqrestore(&xencons_lock, flags);
  10.110 +}
  10.111 +
  10.112  /* Privileged receive callback and transmit kicker. */
  10.113  static irqreturn_t xencons_priv_interrupt(int irq, void *dev_id,
  10.114                                            struct pt_regs *regs)
  10.115  {
  10.116 -	static char   rbuf[16];
  10.117 -	int           i, l;
  10.118 -	unsigned long flags;
  10.119 -
  10.120 -	spin_lock_irqsave(&xencons_lock, flags);
  10.121 +	static char rbuf[16];
  10.122 +	int         l;
  10.123  
  10.124 -	if (xencons_tty != NULL)
  10.125 -	{
  10.126 -		/* Receive work. */
  10.127 -		while ((l = HYPERVISOR_console_io(
  10.128 -			CONSOLEIO_read, 16, rbuf)) > 0)
  10.129 -			for (i = 0; i < l; i++)
  10.130 -				tty_insert_flip_char(xencons_tty, rbuf[i], 0);
  10.131 -		if (xencons_tty->flip.count != 0)
  10.132 -			tty_flip_buffer_push(xencons_tty);
  10.133 -	}
  10.134 +	while ((l = HYPERVISOR_console_io(CONSOLEIO_read, 16, rbuf)) > 0)
  10.135 +		xencons_rx(rbuf, l, regs);
  10.136  
  10.137 -	/* Transmit work. */
  10.138 -	__xencons_tx_flush();
  10.139 -
  10.140 -	spin_unlock_irqrestore(&xencons_lock, flags);
  10.141 +	xencons_tx();
  10.142  
  10.143  	return IRQ_HANDLED;
  10.144  }
  10.145 @@ -664,7 +655,8 @@ static int __init xencons_init(void)
  10.146  	if ((rc = tty_register_driver(DRV(xencons_driver))) != 0) {
  10.147  		printk("WARNING: Failed to register Xen virtual "
  10.148  		       "console driver as '%s%d'\n",
  10.149 -		       DRV(xencons_driver)->name, DRV(xencons_driver)->name_base);
  10.150 +		       DRV(xencons_driver)->name,
  10.151 +		       DRV(xencons_driver)->name_base);
  10.152  		put_tty_driver(xencons_driver);
  10.153  		xencons_driver = NULL;
  10.154  		return rc;
  10.155 @@ -681,8 +673,6 @@ static int __init xencons_init(void)
  10.156  			"console",
  10.157  			NULL);
  10.158  		BUG_ON(xencons_priv_irq < 0);
  10.159 -	} else {
  10.160 -		xencons_ring_register_receiver(xencons_rx);
  10.161  	}
  10.162  
  10.163  	printk("Xen virtual console successfully installed as %s%d\n",
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Fri Dec 02 15:48:44 2005 +0000
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Fri Dec 02 15:48:55 2005 +0000
    11.3 @@ -15,15 +15,14 @@
    11.4  
    11.5  #include <asm/hypervisor.h>
    11.6  #include <asm-xen/evtchn.h>
    11.7 +#include <asm-xen/xencons.h>
    11.8  #include <linux/wait.h>
    11.9  #include <linux/interrupt.h>
   11.10  #include <linux/sched.h>
   11.11  #include <linux/err.h>
   11.12 -#include "xencons_ring.h"
   11.13  #include <asm-xen/xen-public/io/console.h>
   11.14  
   11.15  static int xencons_irq;
   11.16 -static xencons_receiver_func *xencons_receiver;
   11.17  
   11.18  static inline struct xencons_interface *xencons_interface(void)
   11.19  {
   11.20 @@ -69,10 +68,8 @@ static irqreturn_t handle_input(int irq,
   11.21  	BUG_ON((prod - cons) > sizeof(intf->in));
   11.22  
   11.23  	while (cons != prod) {
   11.24 -		if (xencons_receiver != NULL)
   11.25 -			xencons_receiver(
   11.26 -				intf->in + MASK_XENCONS_IDX(cons++, intf->in),
   11.27 -				1, regs);
   11.28 +		xencons_rx(intf->in+MASK_XENCONS_IDX(cons,intf->in), 1, regs);
   11.29 +		cons++;
   11.30  	}
   11.31  
   11.32  	mb();
   11.33 @@ -80,12 +77,9 @@ static irqreturn_t handle_input(int irq,
   11.34  
   11.35  	notify_daemon();
   11.36  
   11.37 -	return IRQ_HANDLED;
   11.38 -}
   11.39 +	xencons_tx();
   11.40  
   11.41 -void xencons_ring_register_receiver(xencons_receiver_func *f)
   11.42 -{
   11.43 -	xencons_receiver = f;
   11.44 +	return IRQ_HANDLED;
   11.45  }
   11.46  
   11.47  int xencons_ring_init(void)
   11.48 @@ -103,7 +97,7 @@ int xencons_ring_init(void)
   11.49  		xen_start_info->console_evtchn,
   11.50  		handle_input, 0, "xencons", NULL);
   11.51  	if (err <= 0) {
   11.52 -		xprintk("XEN console request irq failed %i\n", err);
   11.53 +		printk(KERN_ERR "XEN console request irq failed %i\n", err);
   11.54  		return err;
   11.55  	}
   11.56  
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.h	Fri Dec 02 15:48:44 2005 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,23 +0,0 @@
    12.4 -#ifndef _XENCONS_RING_H
    12.5 -#define _XENCONS_RING_H
    12.6 -
    12.7 -asmlinkage int xprintk(const char *fmt, ...);
    12.8 -
    12.9 -int xencons_ring_init(void);
   12.10 -int xencons_ring_send(const char *data, unsigned len);
   12.11 -
   12.12 -typedef void (xencons_receiver_func)(
   12.13 -	char *buf, unsigned len, struct pt_regs *regs);
   12.14 -void xencons_ring_register_receiver(xencons_receiver_func *f);
   12.15 -
   12.16 -#endif /* _XENCONS_RING_H */
   12.17 -
   12.18 -/*
   12.19 - * Local variables:
   12.20 - *  c-file-style: "linux"
   12.21 - *  indent-tabs-mode: t
   12.22 - *  c-indent-level: 8
   12.23 - *  c-basic-offset: 8
   12.24 - *  tab-width: 8
   12.25 - * End:
   12.26 - */
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Fri Dec 02 15:48:44 2005 +0000
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Fri Dec 02 15:48:55 2005 +0000
    13.3 @@ -25,7 +25,7 @@ static int  make_rx_response(netif_t *ne
    13.4                               s8       st,
    13.5                               u16      offset,
    13.6                               u16      size,
    13.7 -                             u16      csum_valid);
    13.8 +                             u16      flags);
    13.9  
   13.10  static void net_tx_action(unsigned long unused);
   13.11  static DECLARE_TASKLET(net_tx_tasklet, net_tx_action, 0);
   13.12 @@ -301,7 +301,8 @@ static void net_rx_action(unsigned long 
   13.13  		id = RING_GET_REQUEST(&netif->rx, netif->rx.rsp_prod_pvt)->id;
   13.14  		if (make_rx_response(netif, id, status,
   13.15  				     (unsigned long)skb->data & ~PAGE_MASK,
   13.16 -				     size, skb->proto_csum_valid) &&
   13.17 +				     size, skb->proto_csum_valid ?
   13.18 +				     NETRXF_csum_valid : 0) &&
   13.19  		    (rx_notify[irq] == 0)) {
   13.20  			rx_notify[irq] = 1;
   13.21  			notify_list[notify_nr++] = irq;
   13.22 @@ -632,7 +633,7 @@ static void net_tx_action(unsigned long 
   13.23                   */
   13.24  		skb->ip_summed        = CHECKSUM_UNNECESSARY;
   13.25  		skb->proto_csum_valid = 1;
   13.26 -		skb->proto_csum_blank = txreq.csum_blank;
   13.27 +		skb->proto_csum_blank = !!(txreq.flags & NETTXF_csum_blank);
   13.28  
   13.29  		netif->stats.rx_bytes += txreq.size;
   13.30  		netif->stats.rx_packets++;
   13.31 @@ -706,7 +707,7 @@ static int make_rx_response(netif_t *net
   13.32                              s8       st,
   13.33                              u16      offset,
   13.34                              u16      size,
   13.35 -                            u16      csum_valid)
   13.36 +                            u16      flags)
   13.37  {
   13.38  	RING_IDX i = netif->rx.rsp_prod_pvt;
   13.39  	netif_rx_response_t *resp;
   13.40 @@ -714,7 +715,7 @@ static int make_rx_response(netif_t *net
   13.41  
   13.42  	resp = RING_GET_RESPONSE(&netif->rx, i);
   13.43  	resp->offset     = offset;
   13.44 -	resp->csum_valid = csum_valid;
   13.45 +	resp->flags      = flags;
   13.46  	resp->id         = id;
   13.47  	resp->status     = (s16)size;
   13.48  	if (st < 0)
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Dec 02 15:48:44 2005 +0000
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri Dec 02 15:48:55 2005 +0000
    14.3 @@ -660,7 +660,7 @@ static int network_start_xmit(struct sk_
    14.4  	tx->gref = np->grant_tx_ref[id] = ref;
    14.5  	tx->offset = (unsigned long)skb->data & ~PAGE_MASK;
    14.6  	tx->size = skb->len;
    14.7 -	tx->csum_blank = (skb->ip_summed == CHECKSUM_HW);
    14.8 +	tx->flags = (skb->ip_summed == CHECKSUM_HW) ? NETTXF_csum_blank : 0;
    14.9  
   14.10  	np->tx.req_prod_pvt = i + 1;
   14.11  	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&np->tx, notify);
   14.12 @@ -775,7 +775,7 @@ static int netif_poll(struct net_device 
   14.13  		skb->len  = rx->status;
   14.14  		skb->tail = skb->data + skb->len;
   14.15  
   14.16 -		if ( rx->csum_valid )
   14.17 +		if ( rx->flags & NETRXF_csum_valid )
   14.18  			skb->ip_summed = CHECKSUM_UNNECESSARY;
   14.19  
   14.20  		np->stats.rx_packets++;
   14.21 @@ -957,7 +957,8 @@ static void network_connect(struct net_d
   14.22  		tx->gref = np->grant_tx_ref[i];
   14.23  		tx->offset = (unsigned long)skb->data & ~PAGE_MASK;
   14.24  		tx->size = skb->len;
   14.25 -		tx->csum_blank = (skb->ip_summed == CHECKSUM_HW);
   14.26 +		tx->flags = (skb->ip_summed == CHECKSUM_HW) ?
   14.27 +			NETTXF_csum_blank : 0;
   14.28  
   14.29  		np->stats.tx_bytes += skb->len;
   14.30  		np->stats.tx_packets++;
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h	Fri Dec 02 15:48:44 2005 +0000
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/common.h	Fri Dec 02 15:48:55 2005 +0000
    15.3 @@ -12,6 +12,7 @@
    15.4  #include <linux/slab.h>
    15.5  #include <asm-xen/evtchn.h>
    15.6  #include <asm-xen/driver_util.h>
    15.7 +#include <asm-xen/xen-public/grant_table.h>
    15.8  #include <asm-xen/xen-public/io/tpmif.h>
    15.9  #include <asm/io.h>
   15.10  #include <asm/pgalloc.h>
    16.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Fri Dec 02 15:48:44 2005 +0000
    16.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Fri Dec 02 15:48:55 2005 +0000
    16.3 @@ -44,6 +44,7 @@
    16.4  #include <asm/semaphore.h>
    16.5  #include <asm/io.h>
    16.6  #include <asm-xen/evtchn.h>
    16.7 +#include <asm-xen/xen-public/grant_table.h>
    16.8  #include <asm-xen/xen-public/io/tpmif.h>
    16.9  #include <asm/uaccess.h>
   16.10  #include <asm-xen/xenbus.h>
    17.1 --- a/linux-2.6-xen-sparse/include/asm-xen/xencons.h	Fri Dec 02 15:48:44 2005 +0000
    17.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/xencons.h	Fri Dec 02 15:48:55 2005 +0000
    17.3 @@ -4,4 +4,11 @@
    17.4  void xencons_force_flush(void);
    17.5  void xencons_resume(void);
    17.6  
    17.7 +/* Interrupt work hooks. Receive data, or kick data out. */
    17.8 +void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
    17.9 +void xencons_tx(void);
   17.10 +
   17.11 +int xencons_ring_init(void);
   17.12 +int xencons_ring_send(const char *data, unsigned len);
   17.13 +
   17.14  #endif /* __ASM_XENCONS_H__ */
    18.1 --- a/linux-2.6-xen-sparse/net/core/dev.c	Fri Dec 02 15:48:44 2005 +0000
    18.2 +++ b/linux-2.6-xen-sparse/net/core/dev.c	Fri Dec 02 15:48:55 2005 +0000
    18.3 @@ -1283,6 +1283,11 @@ int dev_queue_xmit(struct sk_buff *skb)
    18.4  			skb->csum = offsetof(struct udphdr, check);
    18.5  			break;
    18.6  		default:
    18.7 +			if (net_ratelimit())
    18.8 +				printk(KERN_ERR "Attempting to checksum a non-"
    18.9 +				       "TCP/UDP packet, dropping a protocol"
   18.10 +				       " %d packet", skb->nh.iph->protocol);
   18.11 +			rc = -EPROTO;
   18.12  			goto out_kfree_skb;
   18.13  		}
   18.14  		if ((skb->h.raw + skb->csum + 2) > skb->tail)
    19.1 --- a/xen/arch/x86/shadow.c	Fri Dec 02 15:48:44 2005 +0000
    19.2 +++ b/xen/arch/x86/shadow.c	Fri Dec 02 15:48:55 2005 +0000
    19.3 @@ -2750,10 +2750,10 @@ static unsigned long shadow_l3_table(
    19.4                      g2mfn, g2mfn);
    19.5                  BUG(); /* XXX Deal gracefully with failure. */
    19.6              }
    19.7 -
    19.8 -            if (!get_shadow_ref(s2mfn))
    19.9 -                BUG();
   19.10          } 
   19.11 +
   19.12 +        if (!get_shadow_ref(s2mfn))
   19.13 +            BUG();
   19.14              
   19.15          /* Map shadow L2 into shadow L3 */
   19.16          spl3e[L3_PAGETABLE_ENTRIES - 1] = l3e_from_pfn(s2mfn, _PAGE_PRESENT);
   19.17 @@ -3526,10 +3526,11 @@ static void shadow_invlpg_64(struct vcpu
   19.18  
   19.19      shadow_lock(d);
   19.20  
   19.21 +    __shadow_sync_va(v, va);
   19.22 +
   19.23      if ( __shadow_get_l1e(v, va, &old_sl1e) )
   19.24          if ( l1e_get_flags(old_sl1e) & _PAGE_PRESENT )
   19.25 -            put_page_from_l1e(old_sl1e, d);
   19.26 -
   19.27 +            shadow_put_page_from_l1e(old_sl1e, d);
   19.28  
   19.29      sl1e = l1e_empty();
   19.30      __shadow_set_l1e(v, va, &sl1e);
    20.1 --- a/xen/arch/x86/shadow_public.c	Fri Dec 02 15:48:44 2005 +0000
    20.2 +++ b/xen/arch/x86/shadow_public.c	Fri Dec 02 15:48:55 2005 +0000
    20.3 @@ -1425,7 +1425,7 @@ alloc_p2m_table(struct domain *d)
    20.4  
    20.5  void shadow_l1_normal_pt_update(
    20.6      struct domain *d,
    20.7 -    unsigned long pa, l1_pgentry_t gpte,
    20.8 +    physaddr_t pa, l1_pgentry_t gpte,
    20.9      struct domain_mmap_cache *cache)
   20.10  {
   20.11      unsigned long sl1mfn;    
   20.12 @@ -1450,7 +1450,7 @@ void shadow_l1_normal_pt_update(
   20.13  
   20.14  void shadow_l2_normal_pt_update(
   20.15      struct domain *d,
   20.16 -    unsigned long pa, l2_pgentry_t gpde,
   20.17 +    physaddr_t pa, l2_pgentry_t gpde,
   20.18      struct domain_mmap_cache *cache)
   20.19  {
   20.20      unsigned long sl2mfn;
   20.21 @@ -1475,7 +1475,7 @@ void shadow_l2_normal_pt_update(
   20.22  #if CONFIG_PAGING_LEVELS >= 3
   20.23  void shadow_l3_normal_pt_update(
   20.24      struct domain *d,
   20.25 -    unsigned long pa, l3_pgentry_t l3e,
   20.26 +    physaddr_t pa, l3_pgentry_t l3e,
   20.27      struct domain_mmap_cache *cache)
   20.28  {
   20.29      unsigned long sl3mfn;
   20.30 @@ -1502,7 +1502,7 @@ void shadow_l3_normal_pt_update(
   20.31  #if CONFIG_PAGING_LEVELS >= 4
   20.32  void shadow_l4_normal_pt_update(
   20.33      struct domain *d,
   20.34 -    unsigned long pa, l4_pgentry_t l4e,
   20.35 +    physaddr_t pa, l4_pgentry_t l4e,
   20.36      struct domain_mmap_cache *cache)
   20.37  {
   20.38      unsigned long sl4mfn;
    21.1 --- a/xen/common/grant_table.c	Fri Dec 02 15:48:44 2005 +0000
    21.2 +++ b/xen/common/grant_table.c	Fri Dec 02 15:48:55 2005 +0000
    21.3 @@ -74,7 +74,7 @@ static int
    21.4      grant_ref_t    ref;
    21.5      struct domain *ld, *rd;
    21.6      struct vcpu   *led;
    21.7 -    u16            dev_hst_ro_flags;
    21.8 +    u32            dev_hst_ro_flags;
    21.9      int            handle;
   21.10      u64            addr;
   21.11      unsigned long  frame = 0;
    22.1 --- a/xen/drivers/char/ns16550.c	Fri Dec 02 15:48:44 2005 +0000
    22.2 +++ b/xen/drivers/char/ns16550.c	Fri Dec 02 15:48:55 2005 +0000
    22.3 @@ -211,7 +211,8 @@ static void ns16550_init_postirq(struct 
    22.4      {
    22.5          /* Polled mode. Calculate time to fill RX FIFO and/or empty TX FIFO. */
    22.6          bits = uart->data_bits + uart->stop_bits + !!uart->parity;
    22.7 -        uart->timeout_ms = (bits * port->tx_fifo_size * 1000) / uart->baud;
    22.8 +        uart->timeout_ms = max_t(
    22.9 +            unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
   22.10          init_ac_timer(&uart->timer, ns16550_poll, port, 0);
   22.11          set_ac_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
   22.12      }
    23.1 --- a/xen/include/asm-x86/shadow.h	Fri Dec 02 15:48:44 2005 +0000
    23.2 +++ b/xen/include/asm-x86/shadow.h	Fri Dec 02 15:48:55 2005 +0000
    23.3 @@ -131,10 +131,10 @@ extern int set_p2m_entry(
    23.4  extern void remove_shadow(struct domain *d, unsigned long gpfn, u32 stype);
    23.5  
    23.6  extern void shadow_l1_normal_pt_update(struct domain *d,
    23.7 -                                       unsigned long pa, l1_pgentry_t l1e,
    23.8 +                                       physaddr_t pa, l1_pgentry_t l1e,
    23.9                                         struct domain_mmap_cache *cache);
   23.10  extern void shadow_l2_normal_pt_update(struct domain *d,
   23.11 -                                       unsigned long pa, l2_pgentry_t l2e,
   23.12 +                                       physaddr_t pa, l2_pgentry_t l2e,
   23.13                                         struct domain_mmap_cache *cache);
   23.14  #if CONFIG_PAGING_LEVELS >= 3
   23.15  #include <asm/page-guest32.h>
   23.16 @@ -148,12 +148,12 @@ extern void shadow_l2_normal_pt_update(s
   23.17  
   23.18  extern unsigned long gva_to_gpa(unsigned long gva);
   23.19  extern void shadow_l3_normal_pt_update(struct domain *d,
   23.20 -                                       unsigned long pa, l3_pgentry_t l3e,
   23.21 +                                       physaddr_t pa, l3_pgentry_t l3e,
   23.22                                         struct domain_mmap_cache *cache);
   23.23  #endif
   23.24  #if CONFIG_PAGING_LEVELS >= 4
   23.25  extern void shadow_l4_normal_pt_update(struct domain *d,
   23.26 -                                       unsigned long pa, l4_pgentry_t l4e,
   23.27 +                                       physaddr_t pa, l4_pgentry_t l4e,
   23.28                                         struct domain_mmap_cache *cache);
   23.29  #endif
   23.30  extern int shadow_do_update_va_mapping(unsigned long va,
    24.1 --- a/xen/include/public/io/blkif.h	Fri Dec 02 15:48:44 2005 +0000
    24.2 +++ b/xen/include/public/io/blkif.h	Fri Dec 02 15:48:55 2005 +0000
    24.3 @@ -12,11 +12,10 @@
    24.4  #include "ring.h"
    24.5  
    24.6  /*
    24.7 - * Front->back notifications: When enqueuing a new request, there is no
    24.8 - * need to send a notification if there are old requests still in flight
    24.9 - * (that is, old_req_prod != sring->rsp_prod). The backend guarantees to check
   24.10 - * for new requests after queuing the response for the last in-flight request.
   24.11 - * (NB. The generic req_event mechanism is not used for blk requests.)
   24.12 + * Front->back notifications: When enqueuing a new request, sending a
   24.13 + * notification can be made conditional on req_event (i.e., the generic
   24.14 + * hold-off mechanism provided by the ring macros). Backends must set
   24.15 + * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
   24.16   * 
   24.17   * Back->front notifications: When enqueuing a new response, sending a
   24.18   * notification can be made conditional on rsp_event (i.e., the generic
    25.1 --- a/xen/include/public/io/netif.h	Fri Dec 02 15:48:44 2005 +0000
    25.2 +++ b/xen/include/public/io/netif.h	Fri Dec 02 15:48:55 2005 +0000
    25.3 @@ -18,17 +18,21 @@
    25.4   * or rsp_event field in the shared ring.
    25.5   */
    25.6  
    25.7 +/* Protocol checksum field is blank in the packet (hardware offload)? */
    25.8 +#define _NETTXF_csum_blank (0)
    25.9 +#define  NETTXF_csum_blank (1U<<_NETTXF_csum_blank)
   25.10 +
   25.11  typedef struct netif_tx_request {
   25.12      grant_ref_t gref;      /* Reference to buffer page */
   25.13 -    uint16_t offset:15;    /* Offset within buffer page */
   25.14 -    uint16_t csum_blank:1; /* Proto csum field blank?   */
   25.15 +    uint16_t offset;       /* Offset within buffer page */
   25.16 +    uint16_t flags;        /* NETTXF_* */
   25.17      uint16_t id;           /* Echoed in response message. */
   25.18      uint16_t size;         /* Packet size in bytes.       */
   25.19  } netif_tx_request_t;
   25.20  
   25.21  typedef struct netif_tx_response {
   25.22      uint16_t id;
   25.23 -    int8_t   status;
   25.24 +    int16_t  status;       /* NETIF_RSP_* */
   25.25  } netif_tx_response_t;
   25.26  
   25.27  typedef struct {
   25.28 @@ -36,11 +40,15 @@ typedef struct {
   25.29      grant_ref_t gref;      /* Reference to incoming granted frame */
   25.30  } netif_rx_request_t;
   25.31  
   25.32 +/* Protocol checksum already validated (e.g., performed by hardware)? */
   25.33 +#define _NETRXF_csum_valid (0)
   25.34 +#define  NETRXF_csum_valid (1U<<_NETRXF_csum_valid)
   25.35 +
   25.36  typedef struct {
   25.37 -    uint16_t offset;     /* Offset in page of start of received packet  */
   25.38 -    uint16_t csum_valid; /* Protocol checksum is validated?       */
   25.39      uint16_t id;
   25.40 -    int16_t  status;     /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   25.41 +    uint16_t offset;       /* Offset in page of start of received packet  */
   25.42 +    uint16_t flags;        /* NETRXF_* */
   25.43 +    int16_t  status;       /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   25.44  } netif_rx_response_t;
   25.45  
   25.46  /*
    26.1 --- a/xen/include/public/io/ring.h	Fri Dec 02 15:48:44 2005 +0000
    26.2 +++ b/xen/include/public/io/ring.h	Fri Dec 02 15:48:55 2005 +0000
    26.3 @@ -71,6 +71,7 @@ union __name##_sring_entry {            
    26.4  struct __name##_sring {                                                 \
    26.5      RING_IDX req_prod, req_event;                                       \
    26.6      RING_IDX rsp_prod, rsp_event;                                       \
    26.7 +    uint8_t  pad[48];                                                   \
    26.8      union __name##_sring_entry ring[1]; /* variable-length */           \
    26.9  };                                                                      \
   26.10                                                                          \
   26.11 @@ -114,6 +115,7 @@ typedef struct __name##_back_ring __name
   26.12  #define SHARED_RING_INIT(_s) do {                                       \
   26.13      (_s)->req_prod  = (_s)->rsp_prod  = 0;                              \
   26.14      (_s)->req_event = (_s)->rsp_event = 1;                              \
   26.15 +    memset((_s)->pad, 0, sizeof((_s)->pad));                            \
   26.16  } while(0)
   26.17  
   26.18  #define FRONT_RING_INIT(_r, _s, __size) do {                            \