# HG changeset patch # User Doi.Tsunehisa@jp.fujitsu.com # Node ID a0a48f19ddba0ebab21befb076eba607b8221700 # Parent 21ac9a7848b36da95132eac54ad3cf4f1ee0f93a Modify gnttab initialization code for PV-on-HVM on IPF Signed-off-by: Tsunehisa Doi Signed-off-by: Tomonari Horikoshi diff -r 21ac9a7848b3 -r a0a48f19ddba linux-2.6-xen-sparse/drivers/xen/core/gnttab.c --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Sat Aug 26 13:40:55 2006 +0900 +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Sat Aug 26 13:44:41 2006 +0900 @@ -429,6 +429,7 @@ int gnttab_resume(void) int gnttab_resume(void) { unsigned long frames; +#ifndef __ia64__ struct xen_add_to_physmap xatp; unsigned int i; @@ -448,13 +449,30 @@ int gnttab_resume(void) printk("error to ioremap gnttab share frames\n"); return -1; } +#else /* !__ia64__ */ + struct xen_hvm_setup xhs; + + shared = (struct grant_entry *) + __get_free_pages(GFP_KERNEL, get_order(PAGE_SIZE * NR_GRANT_FRAMES)); + if (shared == NULL) { + printk("error to allocate gnttab share frames\n"); + return -1; + } + frames = virt_to_phys((void *)shared); + xhs.arg1 = frames; + xhs.arg2 = NR_GRANT_FRAMES; + if (HYPERVISOR_hvm_op(HVMOP_setup_gnttab_table, &xhs)) + BUG(); +#endif /* !__ia64__ */ return 0; } int gnttab_suspend(void) { +#ifndef __ia64__ iounmap(shared); +#endif /* !__ia64__ */ return 0; }