ia64/xen-unstable

changeset 12795:85b9711cb895

[IA64] Allocate frame table/mpt table at mfn=0

Allocate frame table/mpt table at mfn=0 even when memory isn't assigned at
mfn=0 as work around for transate_domain_pte().

transate_domain_pte() returns mfn=0 when the machine page isn't present
as a work around for memory mapped I/O where no device is assigned.
Xen might access page_info of mfn=0, so it must be guaranteed that it
exists. Otherwise xen panics with a tlb miss fault in xen's virtual
address area.

Once transate_domain_pte() is fixed correctly, this will be removed.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Tue Dec 05 13:42:37 2006 -0700 (2006-12-05)
parents 9787cb7262e8
children d901f2fe8c25
files xen/arch/ia64/xen/xenmem.c
line diff
     1.1 --- a/xen/arch/ia64/xen/xenmem.c	Tue Dec 05 10:59:32 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/xenmem.c	Tue Dec 05 13:42:37 2006 -0700
     1.3 @@ -181,6 +181,23 @@ void init_virtual_frametable(void)
     1.4  	printk("virtual machine to physical table: %p size: %lukB\n"
     1.5  	       "max_page: 0x%lx\n",
     1.6  	       mpt_table, ((table_size << PAGE_SHIFT) >> 10), max_page);
     1.7 +
     1.8 +	/*
     1.9 +	 * XXX work around for translate_domain_pte().
    1.10 +	 * It returns mfn=0 when the machine page isn't present.  This
    1.11 +	 * behavior is a work around for memory mapped I/O where no device
    1.12 +	 * is assigned.  Xen might access page_info of mfn=0, so it must
    1.13 +	 * be guaranteed that it exists.  Otherwise xen panics with tlb miss
    1.14 +	 * fault in xen's virtual address area.
    1.15 +	 *
    1.16 +	 * Once translate_domain_pte() is fixed correctly, this will
    1.17 +	 * be removed.
    1.18 +	 */
    1.19 +	if (!mfn_valid(0)) {
    1.20 +		printk("allocating frame table/mpt table at mfn 0.\n");
    1.21 +		create_frametable_page_table(0, PAGE_SIZE, NULL);
    1.22 +		create_mpttable_page_table(0, PAGE_SIZE, NULL);
    1.23 +	}
    1.24  }
    1.25  
    1.26  int