[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [XEN][X86_64] Allocate multiple L2 page directories for
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 7474bb5e29233d20ff45383c96bbee556bbb376a # Parent 29bc328cd8d39b79349e004323de2b57ab90d94b [XEN][X86_64] Allocate multiple L2 page directories for the read-only M2P table mapping, if required. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> --- xen/arch/x86/x86_64/mm.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff -r 29bc328cd8d3 -r 7474bb5e2923 xen/arch/x86/x86_64/mm.c --- a/xen/arch/x86/x86_64/mm.c Wed Sep 13 14:24:42 2006 +0100 +++ b/xen/arch/x86/x86_64/mm.c Wed Sep 13 14:30:06 2006 +0100 @@ -78,7 +78,7 @@ void __init paging_init(void) { unsigned long i, mpt_size; l3_pgentry_t *l3_ro_mpt; - l2_pgentry_t *l2_ro_mpt; + l2_pgentry_t *l2_ro_mpt = NULL; struct page_info *pg; /* Create user-accessible L2 directory to map the MPT for guests. */ @@ -87,12 +87,6 @@ void __init paging_init(void) idle_pg_table[l4_table_offset(RO_MPT_VIRT_START)] = l4e_from_page( virt_to_page(l3_ro_mpt), __PAGE_HYPERVISOR | _PAGE_USER); - l2_ro_mpt = alloc_xenheap_page(); - clear_page(l2_ro_mpt); - l3_ro_mpt[l3_table_offset(RO_MPT_VIRT_START)] = - l3e_from_page( - virt_to_page(l2_ro_mpt), __PAGE_HYPERVISOR | _PAGE_USER); - l2_ro_mpt += l2_table_offset(RO_MPT_VIRT_START); /* * Allocate and map the machine-to-phys table. @@ -110,10 +104,20 @@ void __init paging_init(void) PAGE_HYPERVISOR); memset((void *)(RDWR_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT)), 0x55, 1UL << L2_PAGETABLE_SHIFT); + if ( !((unsigned long)l2_ro_mpt & ~PAGE_MASK) ) + { + unsigned long va = RO_MPT_VIRT_START + (i << L2_PAGETABLE_SHIFT); + + l2_ro_mpt = alloc_xenheap_page(); + clear_page(l2_ro_mpt); + l3_ro_mpt[l3_table_offset(va)] = + l3e_from_page( + virt_to_page(l2_ro_mpt), __PAGE_HYPERVISOR | _PAGE_USER); + l2_ro_mpt += l2_table_offset(va); + } /* NB. Cannot be GLOBAL as shadow_mode_translate reuses this area. */ *l2_ro_mpt++ = l2e_from_page( pg, /*_PAGE_GLOBAL|*/_PAGE_PSE|_PAGE_USER|_PAGE_PRESENT); - BUG_ON(((unsigned long)l2_ro_mpt & ~PAGE_MASK) == 0); } /* Set up linear page table mapping. */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |