ia64/xen-unstable

changeset 19204:9b761ae54610

[IA64] fix relinquish_memory()

This patch fixes the following panic.

(XEN) Assertion 'entry->prev->next == entry' failed, line 170, file xen-unstable.hg/xen/include/xen/list.h
(XEN) Xen BUG at xen-unstable.hg/xen/include/xen/list.h:170
(XEN) FIXME: implement ia64 dump_execution_state()
(XEN)
(XEN) Call Trace:
(XEN) [<f400000004104670>] show_stack+0x90/0xb0
(XEN) sp=f0000002f64cfbf0 bsp=f0000002f64c9918
(XEN) [<f400000004105180>] dump_stack+0x30/0x50
(XEN) sp=f0000002f64cfdc0 bsp=f0000002f64c98f8
(XEN) [<f400000004064ac0>] __bug+0x70/0xa0
(XEN) sp=f0000002f64cfdc0 bsp=f0000002f64c98c8
(XEN) [<f400000004031290>] free_domheap_pages+0x380/0x700
(XEN) sp=f0000002f64cfdc0 bsp=f0000002f64c9868
(XEN) [<f4000000040ac470>] domain_page_flush_and_put+0x1c0/0x550
(XEN) sp=f0000002f64cfdc0 bsp=f0000002f64c9820
(XEN) [<f4000000040ac990>] domain_put_page+0x190/0x530
(XEN) sp=f0000002f64cfdd0 bsp=f0000002f64c97b0
(XEN) [<f4000000040ad060>] zap_domain_page_one+0x330/0x530
(XEN) sp=f0000002f64cfde0 bsp=f0000002f64c9710
(XEN) [<f4000000040ad570>] dom0vp_zap_physmap+0x70/0xe0
(XEN) sp=f0000002f64cfdf0 bsp=f0000002f64c96d8
(XEN) [<f4000000040838f0>] do_dom0vp_op+0x320/0x7b0
(XEN) sp=f0000002f64cfdf0 bsp=f0000002f64c9690
(XEN) [<f400000004002e60>] fast_hypercall+0x170/0x310
(XEN) sp=f0000002f64cfe00 bsp=f0000002f64c9690
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 2:
(XEN) Xen BUG at xen-unstable.hg/xen/include/xen/list.h:170
(XEN) ****************************************
(XEN)
(XEN) Reboot in five seconds...
(XEN) Debugging connection not set up.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Feb 13 19:03:37 2009 +0900 (2009-02-13)
parents 726b56720b16
children 9369df6e5bd2
files xen/arch/ia64/xen/domain.c xen/include/asm-ia64/mm.h
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Fri Feb 13 11:23:16 2009 +0900
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Fri Feb 13 19:03:37 2009 +0900
     1.3 @@ -1705,13 +1705,7 @@ static int relinquish_memory(struct doma
     1.4          }
     1.5      }
     1.6  
     1.7 -    /* list is empty at this point. */
     1.8 -    if ( !page_list_empty(&d->arch.relmem_list) )
     1.9 -    {
    1.10 -        *list = d->arch.relmem_list;
    1.11 -        INIT_PAGE_LIST_HEAD(&d->arch.relmem_list);
    1.12 -    }
    1.13 -
    1.14 +    page_list_splice_init(&d->arch.relmem_list, list);
    1.15  
    1.16   out:
    1.17      spin_unlock_recursive(&d->page_alloc_lock);
     2.1 --- a/xen/include/asm-ia64/mm.h	Fri Feb 13 11:23:16 2009 +0900
     2.2 +++ b/xen/include/asm-ia64/mm.h	Fri Feb 13 19:03:37 2009 +0900
     2.3 @@ -92,6 +92,24 @@ struct page_info
     2.4      u32 tlbflush_timestamp;
     2.5  };
     2.6  
     2.7 +#ifndef page_list_entry
     2.8 +static inline void
     2.9 +page_list_splice_init(struct page_list_head *list, struct page_list_head *head)
    2.10 +{
    2.11 +    if ( !page_list_empty(list) )
    2.12 +    {
    2.13 +        if ( head->next )
    2.14 +            head->tail->list.next = page_to_mfn(list->next);
    2.15 +        else
    2.16 +            head->next = list->next;
    2.17 +        head->tail = list->tail;
    2.18 +        INIT_PAGE_LIST_HEAD(list);
    2.19 +    }
    2.20 +}
    2.21 +#else
    2.22 +# define page_list_splice_init	list_splice_init
    2.23 +#endif
    2.24 +
    2.25  #define set_page_count(p,v) 	atomic_set(&(p)->_count, v - 1)
    2.26  
    2.27  /*