ia64/xen-unstable

changeset 1338:343bab45b371

bitkeeper revision 1.886 (4096bb79FO21T0jG8TqB3XBOZ5eOpw)

save/restore bug fixes, extra debug
author iap10@labyrinth.cl.cam.ac.uk
date Mon May 03 21:36:57 2004 +0000 (2004-05-03)
parents b4a9837c89b1
children 9e1ef2196d83 8b4e4b30b2bb
files tools/examples/xc_dom_create.py tools/xend/lib/utils.c xen/common/dom0_ops.c xen/common/domain.c xen/include/xen/mm.h xenolinux-2.4.26-sparse/arch/xen/drivers/dom0/core.c xenolinux-2.4.26-sparse/arch/xen/mm/ioremap.c
line diff
     1.1 --- a/tools/examples/xc_dom_create.py	Sun May 02 00:52:45 2004 +0000
     1.2 +++ b/tools/examples/xc_dom_create.py	Mon May 03 21:36:57 2004 +0000
     1.3 @@ -253,7 +253,7 @@ def make_domain():
     1.4      else:                     io_priv = False
     1.5  
     1.6      if restore:
     1.7 -        ret = eval('xc.%s_restore ( dom=id, state_file=state_file, progress=1, io_priv=%d )' % (builder_fn, io_priv))
     1.8 +        ret = eval('xc.%s_restore ( dom=id, state_file=state_file, progress=1)' % (builder_fn) )
     1.9          if ret < 0:
    1.10              print "Error restoring domain"
    1.11              print "Return code = " + str(ret)
     2.1 --- a/tools/xend/lib/utils.c	Sun May 02 00:52:45 2004 +0000
     2.2 +++ b/tools/xend/lib/utils.c	Mon May 03 21:36:57 2004 +0000
     2.3 @@ -22,11 +22,11 @@
     2.4  #include <signal.h>
     2.5  #include <xc.h>
     2.6  
     2.7 -#include <asm-xen/proc_cmd.h>
     2.8 -
     2.9  #include <hypervisor-if.h>
    2.10  #include "domain_controller.h"
    2.11  
    2.12 +#include <asm-xen/proc_cmd.h>
    2.13 +
    2.14  /* Needed for Python versions earlier than 2.3. */
    2.15  #ifndef PyMODINIT_FUNC
    2.16  #define PyMODINIT_FUNC DL_EXPORT(void)
     3.1 --- a/xen/common/dom0_ops.c	Sun May 02 00:52:45 2004 +0000
     3.2 +++ b/xen/common/dom0_ops.c	Mon May 03 21:36:57 2004 +0000
     3.3 @@ -274,7 +274,6 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     3.4          }
     3.5          else
     3.6          {
     3.7 -printk("AAAA %p\n",op->u.getdomaininfo.ctxt);
     3.8              op->u.getdomaininfo.domain      = p->domain;
     3.9              strcpy (op->u.getdomaininfo.name, p->name);
    3.10              op->u.getdomaininfo.processor   = p->processor;
    3.11 @@ -349,7 +348,6 @@ printk("AAAA %p\n",op->u.getdomaininfo.c
    3.12  
    3.13  		if( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) )
    3.14  		{
    3.15 -printk("URGHT %p\n",op->u.getdomaininfo.ctxt);
    3.16  		    ret = -EINVAL;
    3.17  		}
    3.18  
    3.19 @@ -546,6 +544,7 @@ printk("URGHT %p\n",op->u.getdomaininfo.
    3.20  	if ( p )
    3.21  	{
    3.22  	    strncpy(p->name, op->u.setdomainname.name, MAX_DOMAIN_NAME);
    3.23 +	    put_task_struct(p);
    3.24  	}
    3.25  	else 
    3.26  	    ret = -ESRCH;
    3.27 @@ -565,6 +564,7 @@ printk("URGHT %p\n",op->u.getdomaininfo.
    3.28  		    p, op->u.setdomaininitialmem.initial_memkb );
    3.29  	    else
    3.30  		ret = -EINVAL;
    3.31 +	    put_task_struct(p);
    3.32  	}
    3.33      }
    3.34      break;
    3.35 @@ -577,6 +577,7 @@ printk("URGHT %p\n",op->u.getdomaininfo.
    3.36  	{
    3.37  	    p->max_pages = 
    3.38  		(op->u.setdomainmaxmem.max_memkb+PAGE_SIZE-1)>> PAGE_SHIFT;
    3.39 +	    put_task_struct(p);
    3.40  	}
    3.41  	else 
    3.42  	    ret = -ESRCH;
     4.1 --- a/xen/common/domain.c	Sun May 02 00:52:45 2004 +0000
     4.2 +++ b/xen/common/domain.c	Mon May 03 21:36:57 2004 +0000
     4.3 @@ -214,6 +214,10 @@ void __kill_domain(struct task_struct *p
     4.4      *pp = p->next_hash;
     4.5      write_unlock_irqrestore(&tasklist_lock, flags);
     4.6  
     4.7 +    if ( atomic_read(&p->refcnt) >2 )
     4.8 +	DPRINTK("Domain refcnt>1 so kil deferred. Missing put_task? p=%p cur=%p cnt=%d\n",p,current,atomic_read(&p->refcnt));
     4.9 +
    4.10 +
    4.11      if ( p == current )
    4.12      {
    4.13          __enter_scheduler();
     5.1 --- a/xen/include/xen/mm.h	Sun May 02 00:52:45 2004 +0000
     5.2 +++ b/xen/include/xen/mm.h	Mon May 03 21:36:57 2004 +0000
     5.3 @@ -164,8 +164,8 @@ static inline int get_page(struct pfn_in
     5.4               unlikely(x & PGC_zombie) ||             /* Zombie? */
     5.5               unlikely(p != domain) )                 /* Wrong owner? */
     5.6          {
     5.7 -            DPRINTK("Error pfn %08lx: ed=%p,sd=%p,caf=%08x\n",
     5.8 -                    page_to_pfn(page), domain, p, x);
     5.9 +            DPRINTK("Error pfn %08lx: ed=%p(%lld), sd=%p(%lld), caf=%08x\n",
    5.10 +                    page_to_pfn(page), domain, (domain)?domain->domain:1234, p, (p)?p->domain:1234, x);
    5.11              return 0;
    5.12          }
    5.13          __asm__ __volatile__(
     6.1 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/dom0/core.c	Sun May 02 00:52:45 2004 +0000
     6.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/dom0/core.c	Mon May 03 21:36:57 2004 +0000
     6.3 @@ -62,6 +62,14 @@ static int privcmd_ioctl(struct inode *i
     6.4      }
     6.5      break;
     6.6  
     6.7 +    case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
     6.8 +    {
     6.9 +        extern int initdom_ctrlif_domcontroller_port;
    6.10 +        ret = initdom_ctrlif_domcontroller_port;
    6.11 +    }
    6.12 +    break;
    6.13 +    
    6.14 +
    6.15      case IOCTL_PRIVCMD_MMAP:
    6.16      {
    6.17  #define PRIVCMD_MMAP_SZ 32
    6.18 @@ -108,13 +116,6 @@ static int privcmd_ioctl(struct inode *i
    6.19      }
    6.20      break;
    6.21  
    6.22 -    case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
    6.23 -    {
    6.24 -        extern int initdom_ctrlif_domcontroller_port;
    6.25 -        ret = initdom_ctrlif_domcontroller_port;
    6.26 -    }
    6.27 -    break;
    6.28 -    
    6.29      default:
    6.30          ret = -EINVAL;
    6.31      	break;
    6.32 @@ -124,7 +125,6 @@ static int privcmd_ioctl(struct inode *i
    6.33  
    6.34  static int privcmd_mmap(struct file * file, struct vm_area_struct * vma)
    6.35  {
    6.36 -printk(KERN_ALERT"privcmd_mmap\n");
    6.37  	/* DONTCOPY is essential for Xen as copy_page_range is broken. */
    6.38  	vma->vm_flags |= VM_RESERVED | VM_IO | VM_DONTCOPY;
    6.39  
     7.1 --- a/xenolinux-2.4.26-sparse/arch/xen/mm/ioremap.c	Sun May 02 00:52:45 2004 +0000
     7.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/mm/ioremap.c	Mon May 03 21:36:57 2004 +0000
     7.3 @@ -35,7 +35,7 @@ static inline int direct_remap_area_pte(
     7.4                                          domid_t  domid)
     7.5  {
     7.6      unsigned long end;
     7.7 -#define MAX_DIRECTMAP_MMU_QUEUE 64
     7.8 +#define MAX_DIRECTMAP_MMU_QUEUE 130
     7.9      mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *v;
    7.10  
    7.11      address &= ~PMD_MASK;
    7.12 @@ -70,7 +70,7 @@ static inline int direct_remap_area_pte(
    7.13  #endif
    7.14          v->ptr = virt_to_machine(pte);
    7.15          v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot) | _PAGE_IO;
    7.16 -        if ( ++v == MAX_DIRECTMAP_MMU_QUEUE )
    7.17 +        if ( ( ++v - u )== MAX_DIRECTMAP_MMU_QUEUE ) 
    7.18          {
    7.19              if ( HYPERVISOR_mmu_update(u, MAX_DIRECTMAP_MMU_QUEUE) < 0 )
    7.20                  return -EFAULT;