ia64/xen-unstable

changeset 2228:c5441fce57f0

bitkeeper revision 1.1159.1.55 (411ce247qbjvhaE1_176h9hDMmh3cg)

Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xeno-unstable.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Fri Aug 13 15:46:15 2004 +0000 (2004-08-13)
parents 54c0a4a84934 59b1da265f6b
children 193f9a5f845c 18f6d4de5aac
files linux-2.6.7-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c xen/arch/x86/x86_32/mm.c xen/include/asm-x86/mm.h
line diff
     1.1 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Aug 13 14:23:49 2004 +0000
     1.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Aug 13 15:46:15 2004 +0000
     1.3 @@ -694,6 +694,7 @@ void free_irq(unsigned int irq, void *de
     1.4  	p = &desc->action;
     1.5  	for (;;) {
     1.6  		struct irqaction * action = *p;
     1.7 +
     1.8  		if (action) {
     1.9  			struct irqaction **pp = p;
    1.10  			p = &action->next;
    1.11 @@ -710,7 +711,10 @@ void free_irq(unsigned int irq, void *de
    1.12  
    1.13  			/* Wait to make sure it's not being used on another CPU */
    1.14  			synchronize_irq(irq);
    1.15 -			kfree(action);
    1.16 +
    1.17 +#define SA_STATIC_ACTION 0x01000000 /* Is it our duty to free the action? */
    1.18 +			if (!(action->flags & SA_STATIC_ACTION))
    1.19 +				kfree(action);
    1.20  			return;
    1.21  		}
    1.22  		printk("Trying to free free IRQ%d\n",irq);
     2.1 --- a/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c	Fri Aug 13 14:23:49 2004 +0000
     2.2 +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c	Fri Aug 13 15:46:15 2004 +0000
     2.3 @@ -107,7 +107,11 @@ static void __do_suspend(void)
     2.4  
     2.5      memcpy(&start_info, &suspend_record->resume_info, sizeof(start_info));
     2.6  
     2.7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     2.8 +    set_fixmap_ma(FIX_SHARED_INFO, start_info.shared_info);
     2.9 +#else
    2.10      set_fixmap(FIX_SHARED_INFO, start_info.shared_info);
    2.11 +#endif
    2.12  
    2.13      HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
    2.14  
    2.15 @@ -134,7 +138,6 @@ static void __do_suspend(void)
    2.16  
    2.17      __sti();
    2.18  
    2.19 -
    2.20   out:
    2.21      if ( suspend_record != NULL )
    2.22          free_page((unsigned long)suspend_record);
     3.1 --- a/tools/libxc/xc_linux_restore.c	Fri Aug 13 14:23:49 2004 +0000
     3.2 +++ b/tools/libxc/xc_linux_restore.c	Fri Aug 13 15:46:15 2004 +0000
     3.3 @@ -112,7 +112,7 @@ int xc_linux_restore(int xc_handle, XcIO
     3.4      unsigned long *region_mfn = NULL;
     3.5  
     3.6      /* A temporary mapping, and a copy, of one frame of guest memory. */
     3.7 -    unsigned long *ppage;
     3.8 +    unsigned long *ppage = NULL;
     3.9  
    3.10      /* A copy of the pfn-to-mfn table frame list. */
    3.11      unsigned long pfn_to_mfn_frame_list[1024];
    3.12 @@ -530,6 +530,7 @@ int xc_linux_restore(int xc_handle, XcIO
    3.13          xcio_error(ioctxt, "GDT entry count out of range");
    3.14          goto out;
    3.15      }
    3.16 +
    3.17      for ( i = 0; i < ctxt.gdt_ents; i += 512 )
    3.18      {
    3.19          pfn = ctxt.gdt_frames[i];
     4.1 --- a/tools/libxc/xc_linux_save.c	Fri Aug 13 14:23:49 2004 +0000
     4.2 +++ b/tools/libxc/xc_linux_save.c	Fri Aug 13 15:46:15 2004 +0000
     4.3 @@ -320,7 +320,7 @@ int xc_linux_save(int xc_handle, XcIOCon
     4.4      unsigned long page[1024];
     4.5  
     4.6      /* A copy of the pfn-to-mfn table frame list. */
     4.7 -    unsigned long *live_pfn_to_mfn_frame_list;
     4.8 +    unsigned long *live_pfn_to_mfn_frame_list = NULL;
     4.9      unsigned long pfn_to_mfn_frame_list[1024];
    4.10  
    4.11      /* Live mapping of the table mapping each PFN to its current MFN. */
    4.12 @@ -330,13 +330,13 @@ int xc_linux_save(int xc_handle, XcIOCon
    4.13      unsigned long mfn_to_pfn_table_start_mfn;
    4.14      
    4.15      /* Live mapping of shared info structure */
    4.16 -    shared_info_t *live_shinfo;
    4.17 +    shared_info_t *live_shinfo = NULL;
    4.18  
    4.19      /* base of the region in which domain memory is mapped */
    4.20      unsigned char *region_base = NULL;
    4.21  
    4.22      /* A temporary mapping, and a copy, of the guest's suspend record. */
    4.23 -    suspend_record_t *p_srec;
    4.24 +    suspend_record_t *p_srec = NULL;
    4.25  
    4.26      /* number of pages we're dealing with */
    4.27      unsigned long nr_pfns;
    4.28 @@ -679,6 +679,7 @@ int xc_linux_save(int xc_handle, XcIOCon
    4.29              for ( j = 0; j < batch; j++ ){
    4.30                  if ( (pfn_type[j] & LTAB_MASK) == XTAB ){
    4.31                      DDPRINTF("type fail: page %i mfn %08lx\n",j,pfn_type[j]);
    4.32 +printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]);
    4.33                      continue;
    4.34                  }
    4.35    
    4.36 @@ -829,7 +830,7 @@ int xc_linux_save(int xc_handle, XcIOCon
    4.37  		    goto out;
    4.38  		}
    4.39  
    4.40 -		printf("SUSPPPPPPPP flags %08lx shinfo %08lx eip %08lx esi %08lx\n", 
    4.41 +		printf("SUSPEND flags %08lx shinfo %08lx eip %08lx esi %08lx\n", 
    4.42  		       op.u.getdomaininfo.flags, op.u.getdomaininfo.shared_info_frame,
    4.43  		       ctxt.cpu_ctxt.eip, ctxt.cpu_ctxt.esi );
    4.44  
    4.45 @@ -894,9 +895,10 @@ printf("nrpfns according to suspend reco
    4.46          xcio_error(ioctxt, "Suspend record is not in range of pseudophys map");
    4.47          goto out;
    4.48      }
    4.49 -       
    4.50 +
    4.51      /* Canonicalise each GDT frame number. */
    4.52      for ( i = 0; i < ctxt.gdt_ents; i += 512 ) {
    4.53 +       ctxt.gdt_frames[i], live_mfn_to_pfn_table[ctxt.gdt_frames[i]]);
    4.54          if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) {
    4.55              xcio_error(ioctxt, "GDT frame is not in range of pseudophys map");
    4.56              goto out;
    4.57 @@ -916,9 +918,16 @@ printf("nrpfns according to suspend reco
    4.58          xcio_error(ioctxt, "Error when writing to state file (1)");
    4.59          goto out;
    4.60      }
    4.61 -    munmap(live_shinfo, PAGE_SIZE);
    4.62 +
    4.63  printf("Everything saved OK!\n");
    4.64   out:
    4.65 +
    4.66 +    if ( live_shinfo )          munmap(live_shinfo, PAGE_SIZE);
    4.67 +    if ( p_srec )               munmap(p_srec, sizeof(*p_srec));
    4.68 +    if ( live_pfn_to_mfn_frame_list ) munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE);
    4.69 +    if ( live_pfn_to_mfn_table ) munmap(live_pfn_to_mfn_table, nr_pfns*4 );
    4.70 +    if ( live_mfn_to_pfn_table ) munmap(live_mfn_to_pfn_table, PAGE_SIZE*1024 );
    4.71 +
    4.72      if ( pfn_type != NULL ) free(pfn_type);
    4.73      DPRINTF("Save exit rc=%d\n",rc);
    4.74      return !!rc;
     5.1 --- a/xen/arch/x86/x86_32/mm.c	Fri Aug 13 14:23:49 2004 +0000
     5.2 +++ b/xen/arch/x86/x86_32/mm.c	Fri Aug 13 15:46:15 2004 +0000
     5.3 @@ -262,6 +262,10 @@ long set_gdt(struct domain *d,
     5.4      int i, nr_pages = (entries + 511) / 512;
     5.5      struct desc_struct *vgdt;
     5.6  
     5.7 +    vgdt = map_domain_mem(frames[0] << PAGE_SHIFT);
     5.8 +    memset( vgdt + FIRST_RESERVED_GDT_ENTRY, 0,	    
     5.9 +           NR_RESERVED_GDT_ENTRIES*8);
    5.10 +
    5.11      /* Check the new GDT. */
    5.12      for ( i = 0; i < nr_pages; i++ )
    5.13      {
    5.14 @@ -272,7 +276,6 @@ long set_gdt(struct domain *d,
    5.15      }
    5.16  
    5.17      /* Copy reserved GDT entries to the new GDT. */
    5.18 -    vgdt = map_domain_mem(frames[0] << PAGE_SHIFT);
    5.19      memcpy(vgdt + FIRST_RESERVED_GDT_ENTRY, 
    5.20             gdt_table + FIRST_RESERVED_GDT_ENTRY, 
    5.21             NR_RESERVED_GDT_ENTRIES*8);
     6.1 --- a/xen/include/asm-x86/mm.h	Fri Aug 13 14:23:49 2004 +0000
     6.2 +++ b/xen/include/asm-x86/mm.h	Fri Aug 13 15:46:15 2004 +0000
     6.3 @@ -249,8 +249,10 @@ static inline int get_page_type(struct p
     6.4          /* Try to validate page type; drop the new reference on failure. */
     6.5          if ( unlikely(!alloc_page_type(page, type)) )
     6.6          {
     6.7 -            DPRINTK("Error while validating pfn %08lx for type %08x\n",
     6.8 -                    page_to_pfn(page), type);
     6.9 +            DPRINTK("Error while validating pfn %08lx for type %08x. caf=%08x taf=%08x\n",
    6.10 +                    page_to_pfn(page), type,
    6.11 +		    page->u.inuse.count_info,
    6.12 +		    page->u.inuse.type_info);
    6.13              put_page_type(page);
    6.14              return 0;
    6.15          }