direct-io.hg

changeset 7790:2de6e301a640

Merged.
author emellor@leeni.uk.xensource.com
date Mon Nov 14 12:12:29 2005 +0100 (2005-11-14)
parents edc33eea8630 3842ebd7d480
children 6d981d34cf52
files
line diff
     1.1 --- a/install.sh	Mon Nov 14 12:11:41 2005 +0100
     1.2 +++ b/install.sh	Mon Nov 14 12:12:29 2005 +0100
     1.3 @@ -27,7 +27,7 @@ echo "Installing Xen from '$src' to '$ds
     1.4  cp -fdRL $src/etc/init.d/* $dst/etc/init.d/
     1.5  echo "All done."
     1.6  
     1.7 -if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     1.8 +if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     1.9    cp -f $src/etc/udev/rules.d/*.rules $dst/etc/udev/rules.d/
    1.10  else
    1.11    cp -f $src/etc/hotplug/*.agent $dst/etc/hotplug/
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Nov 14 12:11:41 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Nov 14 12:12:29 2005 +0100
     2.3 @@ -293,17 +293,18 @@ static void connect(struct blkfront_info
     2.4  {
     2.5  	unsigned long sectors, sector_size;
     2.6  	unsigned int binfo;
     2.7 +	int err;
     2.8  
     2.9          if (info->connected == BLKIF_STATE_CONNECTED)
    2.10  		return;
    2.11  
    2.12  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    2.13  
    2.14 -	int err = xenbus_gather(NULL, info->xbdev->otherend,
    2.15 -				"sectors", "%lu", &sectors,
    2.16 -				"info", "%u", &binfo,
    2.17 -				"sector-size", "%lu", &sector_size,
    2.18 -				NULL);
    2.19 +	err = xenbus_gather(NULL, info->xbdev->otherend,
    2.20 +			    "sectors", "%lu", &sectors,
    2.21 +			    "info", "%u", &binfo,
    2.22 +			    "sector-size", "%lu", &sector_size,
    2.23 +			    NULL);
    2.24  	if (err) {
    2.25  		xenbus_dev_fatal(info->xbdev, err,
    2.26  				 "reading backend fields at %s",
    2.27 @@ -349,9 +350,9 @@ static void blkfront_closing(struct xenb
    2.28  
    2.29  static int blkfront_remove(struct xenbus_device *dev)
    2.30  {
    2.31 -	DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
    2.32 +	struct blkfront_info *info = dev->data;
    2.33  
    2.34 -	struct blkfront_info *info = dev->data;
    2.35 +	DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
    2.36  
    2.37  	blkif_free(info);
    2.38  
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Mon Nov 14 12:11:41 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Mon Nov 14 12:12:29 2005 +0100
     3.3 @@ -30,6 +30,12 @@ static inline struct xencons_interface *
     3.4  	return mfn_to_virt(xen_start_info->console_mfn);
     3.5  }
     3.6  
     3.7 +static inline void notify_daemon(void)
     3.8 +{
     3.9 +	/* Use evtchn: this is called early, before irq is set up. */
    3.10 +	notify_remote_via_evtchn(xen_start_info->console_evtchn);
    3.11 +}
    3.12 +
    3.13  int xencons_ring_send(const char *data, unsigned len)
    3.14  {
    3.15  	int sent = 0;
    3.16 @@ -47,8 +53,7 @@ int xencons_ring_send(const char *data, 
    3.17  	wmb();
    3.18  	intf->out_prod = prod;
    3.19  
    3.20 -	/* Use evtchn: this is called early, before irq is set up. */
    3.21 -	notify_remote_via_evtchn(xen_start_info->console_evtchn);
    3.22 +	notify_daemon();
    3.23  
    3.24  	return sent;
    3.25  }	
    3.26 @@ -70,9 +75,11 @@ static irqreturn_t handle_input(int irq,
    3.27  				1, regs);
    3.28  	}
    3.29  
    3.30 -	wmb();
    3.31 +	mb();
    3.32  	intf->in_cons = cons;
    3.33  
    3.34 +	notify_daemon();
    3.35 +
    3.36  	return IRQ_HANDLED;
    3.37  }
    3.38  
    3.39 @@ -102,6 +109,9 @@ int xencons_ring_init(void)
    3.40  
    3.41  	xencons_irq = err;
    3.42  
    3.43 +	/* In case we have in-flight data after save/restore... */
    3.44 +	notify_daemon();
    3.45 +
    3.46  	return 0;
    3.47  }
    3.48  
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Mon Nov 14 12:11:41 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Mon Nov 14 12:12:29 2005 +0100
     4.3 @@ -118,10 +118,11 @@ static int netback_hotplug(struct xenbus
     4.4  	struct backend_info *be = xdev->data;
     4.5  	netif_t *netif = be->netif;
     4.6  	int i = 0, length = 0;
     4.7 +	char *val;
     4.8  
     4.9  	DPRINTK("netback_hotplug");
    4.10  
    4.11 -	char *val = xenbus_read(NULL, xdev->nodename, "script", NULL);
    4.12 +	val = xenbus_read(NULL, xdev->nodename, "script", NULL);
    4.13  	if (IS_ERR(val)) {
    4.14  		int err = PTR_ERR(val);
    4.15  		xenbus_dev_fatal(xdev, err, "reading script");
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Mon Nov 14 12:11:41 2005 +0100
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Mon Nov 14 12:12:29 2005 +0100
     5.3 @@ -36,7 +36,7 @@
     5.4  #include <asm-xen/xenbus.h>
     5.5  #include "xenbus_comms.h"
     5.6  
     5.7 -static int xenbus_irq      = 0;
     5.8 +static int xenbus_irq;
     5.9  
    5.10  extern void xenbus_probe(void *); 
    5.11  extern int xenstored_ready; 
    5.12 @@ -51,7 +51,7 @@ static inline struct xenstore_domain_int
    5.13  
    5.14  static irqreturn_t wake_waiting(int irq, void *unused, struct pt_regs *regs)
    5.15  {
    5.16 -	if(unlikely(xenstored_ready == 0)) {
    5.17 +	if (unlikely(xenstored_ready == 0)) {
    5.18  		xenstored_ready = 1; 
    5.19  		schedule_work(&probe_work); 
    5.20  	} 
    5.21 @@ -189,9 +189,6 @@ int xb_init_comms(void)
    5.22  
    5.23  	xenbus_irq = err;
    5.24  
    5.25 -	/* FIXME zero out page -- domain builder should probably do this*/
    5.26 -	memset(mfn_to_virt(xen_start_info->store_mfn), 0, PAGE_SIZE);
    5.27 -
    5.28  	return 0;
    5.29  }
    5.30  
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Mon Nov 14 12:11:41 2005 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Mon Nov 14 12:12:29 2005 +0100
     6.3 @@ -284,6 +284,7 @@ static void otherend_changed(struct xenb
     6.4  	struct xenbus_device *dev =
     6.5  		container_of(watch, struct xenbus_device, otherend_watch);
     6.6  	struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver);
     6.7 +	XenbusState state;
     6.8  
     6.9  	/* Protect us against watches firing on old details when the otherend
    6.10  	   details change, say immediately after a resume. */
    6.11 @@ -294,9 +295,10 @@ static void otherend_changed(struct xenb
    6.12  		return;
    6.13  	}
    6.14  
    6.15 -	XenbusState state = xenbus_read_driver_state(dev->otherend);
    6.16 +	state = xenbus_read_driver_state(dev->otherend);
    6.17  
    6.18 -	DPRINTK("state is %d, %s, %s", state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
    6.19 +	DPRINTK("state is %d, %s, %s",
    6.20 +		state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
    6.21  
    6.22  	drv->otherend_changed(dev, state);
    6.23  }
     7.1 --- a/tools/check/check_hotplug	Mon Nov 14 12:11:41 2005 +0100
     7.2 +++ b/tools/check/check_hotplug	Mon Nov 14 12:12:29 2005 +0100
     7.3 @@ -7,7 +7,7 @@ function error {
     7.4     exit 1
     7.5  }
     7.6  
     7.7 -if [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `udev -V` -ge 059 ]; then
     7.8 +if [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ]; then
     7.9    exit 0
    7.10  fi
    7.11  
     8.1 --- a/tools/examples/Makefile	Mon Nov 14 12:11:41 2005 +0100
     8.2 +++ b/tools/examples/Makefile	Mon Nov 14 12:12:29 2005 +0100
     8.3 @@ -41,7 +41,7 @@ DE = $(shell readlink -f $(DESTDIR))
     8.4  ifeq ($(findstring $(DI),$(DE)),$(DI))
     8.5  HOTPLUGS=install-hotplug install-udev
     8.6  else
     8.7 -ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
     8.8 +ifeq ($(shell [ -x /sbin/udev ] && [ ! -z `/sbin/udev -V` ] && [ `/sbin/udev -V` -ge 059 ] && echo 1),1)
     8.9  HOTPLUGS=install-udev
    8.10  else
    8.11  HOTPLUGS=install-hotplug
     9.1 --- a/tools/ioemu/target-i386-dm/Makefile	Mon Nov 14 12:11:41 2005 +0100
     9.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Mon Nov 14 12:12:29 2005 +0100
     9.3 @@ -376,9 +376,9 @@ mixeng.o: mixeng.c mixeng.h mixeng_templ
     9.4  
     9.5  clean:
     9.6  	rm -rf *.o  *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
     9.7 +	rm -rf config.mak config.h
     9.8  
     9.9 -distclean:
    9.10 -	rm -rf *.o  *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe slirp
    9.11 +distclean: clean
    9.12  
    9.13  install: all 
    9.14  	if [ ! -d $(INSTALL_DIR) ];then mkdir -p $(INSTALL_DIR);fi
    10.1 --- a/tools/libxc/xc_linux_build.c	Mon Nov 14 12:11:41 2005 +0100
    10.2 +++ b/tools/libxc/xc_linux_build.c	Mon Nov 14 12:12:29 2005 +0100
    10.3 @@ -619,7 +619,9 @@ static int setup_guest(int xc_handle,
    10.4  
    10.5      *store_mfn = page_array[(vstoreinfo_start-dsi.v_start) >> PAGE_SHIFT];
    10.6      *console_mfn = page_array[(vconsole_start-dsi.v_start) >> PAGE_SHIFT];
    10.7 -
    10.8 +    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) ||
    10.9 +         xc_clear_domain_page(xc_handle, dom, *console_mfn) )
   10.10 +        goto error_out;
   10.11  
   10.12      start_info = xc_map_foreign_range(
   10.13          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
    11.1 --- a/tools/libxc/xc_linux_restore.c	Mon Nov 14 12:11:41 2005 +0100
    11.2 +++ b/tools/libxc/xc_linux_restore.c	Mon Nov 14 12:12:29 2005 +0100
    11.3 @@ -12,8 +12,6 @@
    11.4  #include "xg_private.h"
    11.5  #include "xg_save_restore.h"
    11.6  
    11.7 -
    11.8 -
    11.9  /* max mfn of the whole machine */
   11.10  static uint32_t max_mfn; 
   11.11  
    12.1 --- a/tools/libxc/xc_private.c	Mon Nov 14 12:11:41 2005 +0100
    12.2 +++ b/tools/libxc/xc_private.c	Mon Nov 14 12:12:29 2005 +0100
    12.3 @@ -336,6 +336,19 @@ int xc_copy_to_domain_page(int xc_handle
    12.4      return 0;
    12.5  }
    12.6  
    12.7 +int xc_clear_domain_page(int xc_handle,
    12.8 +                         uint32_t domid,
    12.9 +                         unsigned long dst_pfn)
   12.10 +{
   12.11 +    void *vaddr = xc_map_foreign_range(
   12.12 +        xc_handle, domid, PAGE_SIZE, PROT_WRITE, dst_pfn);
   12.13 +    if ( vaddr == NULL )
   12.14 +        return -1;
   12.15 +    memset(vaddr, 0, PAGE_SIZE);
   12.16 +    munmap(vaddr, PAGE_SIZE);
   12.17 +    return 0;
   12.18 +}
   12.19 +
   12.20  unsigned long xc_get_filesz(int fd)
   12.21  {
   12.22      uint16_t sig;
    13.1 --- a/tools/libxc/xc_vmx_build.c	Mon Nov 14 12:11:41 2005 +0100
    13.2 +++ b/tools/libxc/xc_vmx_build.c	Mon Nov 14 12:12:29 2005 +0100
    13.3 @@ -495,6 +495,9 @@ static int setup_guest(int xc_handle,
    13.4      }
    13.5  
    13.6      *store_mfn = page_array[(v_end-2) >> PAGE_SHIFT];
    13.7 +    if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) )
    13.8 +        goto error_out;
    13.9 +
   13.10      shared_page_frame = (v_end - PAGE_SIZE) >> PAGE_SHIFT;
   13.11  
   13.12      if ((e820_page = xc_map_foreign_range(
    14.1 --- a/tools/libxc/xenctrl.h	Mon Nov 14 12:11:41 2005 +0100
    14.2 +++ b/tools/libxc/xenctrl.h	Mon Nov 14 12:12:29 2005 +0100
    14.3 @@ -424,6 +424,9 @@ int xc_ia64_get_pfn_list(int xc_handle, 
    14.4  int xc_copy_to_domain_page(int xc_handle, uint32_t domid,
    14.5  			   unsigned long dst_pfn, void *src_page);
    14.6  
    14.7 +int xc_clear_domain_page(int xc_handle, uint32_t domid,
    14.8 +                         unsigned long dst_pfn);
    14.9 +
   14.10  int xc_ia64_copy_to_domain_pages(int xc_handle, uint32_t domid,
   14.11          void* src_page, unsigned long dst_pfn, int nr_pages);
   14.12