PV domU with 255GB boot failure
Subsystems (3)
Hi,
Trying to boot a PV 64bit guest with 255GB mem it hangs in extend_init_mapping() in init-xen.c. The hang is in the loop:
/* Finally, blow away any spurious initial mappings. */
while (1) {
pmd = (pmd_t *)&page[pmd_index(va)];
if (pmd_none(*pmd))
break;
HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0);
va += PAGE_SIZE;
}More details:
tables_space : 0x1ff05000
__START_KERNEL_map == 0xffffffff80000000
&_text == 0xffffffff80200000
start_pfn == 0x20cf8The va going into above loop is 0xffffffffc0cf5000. This is L3 at 511 which is NULL and so bad things happening.
I'm still trying to figure where the initial PTEs are being setup, I don't see in hypervisor, my fear is libxc, or worse python :)....
Could the fix be made in the loop above the above mentioned loop in the function where it's ensuring init mappings cover kernel+tables to check for pud also?
/* Ensure init mappings cover kernel text/data and initial
* tables. */
while (va < (__START_KERNEL_map
+ (start_pfn << PAGE_SHIFT)
+ tables_space)) {
check for pud_none() <======= ????????????
pmd = (pmd_t *)&page[pmd_index(va)];
if (pmd_none(*pmd)) {
pte_page = alloc_static_page(&phys);
................Thanks a lot,
Mukesh
Quoted 3 lines · Mukesh Rathor
Could the fix be made in the loop above the above mentioned loop in the function where it's ensuring init mappings cover kernel+tables to check for pud also?
That would be the correct thing to do. I think the kernel should be self-sufficient in this respect, rather than relying on libxc to do this pud setup for it. It should be an easy kernel fix, so long as you can guarantee to be able to easily allocate the page for the pud. :-)
-- Keir
hi sir, i am currently doing in m.a.m college of engg in trichy. i am using final year project using xen 3.3.1. the xen 3.3.1 source run on following error displayed how to solve the problem plz tell me.. the following error make world command running:select-repository:
Searching `.:..' for linux-2.6.18-xen.hg
select-repository: Ignoring `.'
Unable to determine path to Linux source tree.
Falling back to linux-2.6.18-xen Mercurial repository.
Cloning http://xenbits.xensource.com/linux-2.6.18-xen.hg to linux-2.6.18-xen.hg. /bin/sh: hg: not found
make[3]: *** [linux-2.6.18-xen.hg/.valid-src] Error 127
make[3]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1' make[2]: *** [linux-2.6-xen-install] Error 2
make[2]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1' make[1]: *** [install-kernels] Error 1
make[1]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1'
make: *** [world] Error 2
Quoted 20 lines · Keir Fraser
Quoted 3 lines · Mukesh Rathor
Could the fix be made in the loop above the above mentioned loop in the function where it's ensuring init mappings cover kernel+tables to check for pud also?
That would be the correct thing to do. I think the kernel should be self-sufficient in this respect, rather than relying on libxc to do this pud setup for it. It should be an easy kernel fix, so long as you can guarantee to be able to easily allocate the page for the pud. :-)
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Please do not post homework questions to this mailing list
venkatesh k writes ("Re: [Xen-devel] PV domU with 255GB boot failure"):
Quoted 10 lines
hi sir, i am currently doing in m.a.m college of engg in trichy. i am using final year project using xen 3.3.1. the xen 3.3.1 source run on following error displayed how to solve the problem plz tell me.. the following error make world command running:select-repository:
Searching `.:..' for linux-2.6.18-xen.hg
select-repository: Ignoring `.'
Unable to determine path to Linux source tree.
Falling back to linux-2.6.18-xen Mercurial repository.
Cloning http://xenbits.xensource.com/linux-2.6.18-xen.hg to linux-2.6.18-xen.hg./bin/sh: hg: not found
You have posted this question three times now, each time as a response to some other message chosen apparently at random. Also you have posted it to entirely the wrong place. This is all very rude.
The reason we didn't answer your question the first two times is this:
If you can't figure out what's wrong from the transcript you have posted, you need the help of your teachers, not of the Xen developers.
Ian.
Hi,
It looks like you don't have Mercurial (the hg command) installed. You should install your distribution's package for this, it is used to manage the Xen source and the build process uses it to download the Linux kernel.
The appropriate place to post questions of a "How does this work?" / "What does this mean?" nature is to the xen-users mailing list. Also, you're more likely to get an answer if you start your own e-mail thread - send an e-mail to [email protected] with a Subject that briefly describes your question. Don't reply to another e-mail, else people won't notice your question is separate.
Cheers,
Mark
Quoted 42 lines · On Tuesday 17 February 2009 09:29:34 venkatesh k wrote:
hi sir, i am currently doing in m.a.m college of engg in trichy. i am using final year project using xen 3.3.1. the xen 3.3.1 source run on following error displayed how to solve the problem plz tell me.. the following error make world command running:select-repository:
Searching `.:..' for linux-2.6.18-xen.hg
select-repository: Ignoring `.'
Unable to determine path to Linux source tree.
Falling back to linux-2.6.18-xen Mercurial repository. Cloning http://xenbits.xensource.com/linux-2.6.18-xen.hg to linux-2.6.18-xen.hg./bin/sh: hg: not found
make[3]: *** [linux-2.6.18-xen.hg/.valid-src] Error 127 make[3]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1' make[2]: *** [linux-2.6-xen-install] Error 2
make[2]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1' make[1]: *** [install-kernels] Error 1
make[1]: Leaving directory `/home/mamce/Desktop/Missel/xen-3.3.1'
make: *** [world] Error 2Quoted 10 lines · Keir Fraser
Quoted 3 lines · Mukesh Rathor
Could the fix be made in the loop above the above mentioned loop in the function where it's ensuring init mappings cover kernel+tables to check for pud also?
That would be the correct thing to do. I think the kernel should be self-sufficient in this respect, rather than relying on libxc to do this pud setup for it. It should be an easy kernel fix, so long as you can guarantee to be able to easily allocate the page for the pud. :-)
Quoted 8 lines
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 6 lines · Keir Fraser
Quoted 3 lines · Mukesh Rathor
Could the fix be made in the loop above the above mentioned loop in the function where it's ensuring init mappings cover kernel+tables to check for pud also?
Quoted 7 lines
That would be the correct thing to do. I think the kernel should be self-sufficient in this respect, rather than relying on libxc to do this pud setup for it. It should be an easy kernel fix, so long as you can guarantee to be able to easily allocate the page for the pud. :-)
-- Keir
In that case, attached please find proposed patch. I'm having difficulty currently with building the latest tree, so it was tested on an older version where the function is the same. Please let me know if it looks good. I can resubmit with any changes.
thanks,
Mukesh
init-xen.c renamed from init-xen.c.orig +22 -11
@@ -587,35 +587,45 @@ void __init xen_init_pt(void)static void __init extend_init_mapping (unsigned long tables_space) {unsigned long va = __START_KERNEL_map; -unsigned long phys, addr, *pte_page; +unsigned long phys, addr, *pte_page, *pmd_page; +pud_t *pud;pmd_t *pmd;pte_t *pte, new_pte; -unsigned long *page = (unsigned long *)init_level4_pgt; +unsigned long *pud_page = (unsigned long *)init_level4_pgt; - addr = page[pgd_index (va)]; -addr_to_page (addr, page); - addr = page[pud_index (va)]; -addr_to_page (addr, page); - -/* Kill mapping of low 1MB. */ +/* Kill low mappings */ while (va < (unsigned long )&_text) {if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))BUG (); va +=PAGE_SIZE ; } + addr = pud_page[pgd_index (va)];/* get pud entry from pgd tbl */ +addr_to_page (addr, pud_page);/* pud_page now va of pud tbl */ /* Ensure init mappings cover kernel text/data and initial tables. */ while (va < (__START_KERNEL_map + (start_pfn <<PAGE_SHIFT ) + tables_space)) { - pmd = (pmd_t *)&page[pmd_index (va)]; + + pud = (pud_t *)&pud_page[pud_index (va)];/* get pud entry */ +if (pud_none (*pud)) { + pmd_page =alloc_static_page (&phys); +early_make_page_readonly ( + pmd_page, XENFEAT_writable_page_tables); +set_pud (pud,__pud (phys | _KERNPG_TABLE)); + }else { + addr = pud_page[pud_index (va)]; +addr_to_page (addr, pmd_page); + } + + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd)) { pte_page =alloc_static_page (&phys);early_make_page_readonly ( pte_page, XENFEAT_writable_page_tables);set_pmd (pmd,__pmd (phys | _KERNPG_TABLE)); }else { - addr = page[pmd_index (va)]; + addr = pmd_page[pmd_index (va)];addr_to_page (addr, pte_page); } pte = (pte_t *)&pte_page[pte_index (va)];
@@ -630,7 +640,7 @@ static void __init extend_init_mapping(u/* Finally, blow away any spurious initial mappings. */ while (1 ) { - pmd = (pmd_t *)&page[pmd_index (va)]; + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd))break ;if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))
@@ -719,6 +729,7 @@ static void xen_finish_init_mapping(void table_end = start_pfn; } +/* Setup the direct mapping of the physical memory at PAGE_OFFSET. This runs before bootmem is initialized and gets pages directly from the physical memory. To access them they are temporarily mapped. */
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · Mukesh Rathor
In that case, attached please find proposed patch. I'm having difficulty currently with building the latest tree, so it was tested on an older version where the function is the same. Please let me know if it looks good. I can resubmit with any changes.
Looks okay to me. Jan is the only other person I know might remember the Linux x86_64 page-table init code. Please submit with a proper description and sign-off, and double-check your use of tabs versus spaces.
Thanks,
Keir
Quoted 1 line
Quoted 1 line
Quoted 1 line
Mukesh Rathor <[email protected]> 18.02.09 04:39 >>>
First a general remark: You're doing this patch to support 256G domains, but by keeping extend_init_mapping() there'll continue to be no way to support domains with close to or above 512G (or, if making use of XEN_ELFNOTE_INIT_P2M, 1T). This function, rather than needing fixes, really just needs to go away.
I've done this in our forward ported 2.6.27+ kernels, but unfortunately can't really contribute the changes to the 2.6.18 tree, as there are too many differences, and I'm simply lacking the time (and, honestly, interest) to work out all the issues. I could post the respective patch if you (or someone else) care(s).
init-xen.c void __init xen_init_pt(void) · line 594
Quoted 13 lines
init-xen.c renamed from init-xen.c.orig +3
-2@@ -587,35 +587,45 @@ void __init xen_init_pt(void)static void __init extend_init_mapping (unsigned long tables_space) {unsigned long va = __START_KERNEL_map; -unsigned long phys, addr, *pte_page; +unsigned long phys, addr, *pte_page, *pmd_page; +pud_t *pud;pmd_t *pmd;pte_t *pte, new_pte; -unsigned long *page = (unsigned long *)init_level4_pgt; +unsigned long *pud_page = (unsigned long *)init_level4_pgt;
This is certainly confusing. Please use typeless names here, or names that properly reflect what they're used for.
Quoted 5 lines
init-xen.c renamed from init-xen.c.orig +0
-4- addr = page[pgd_index (va)]; -addr_to_page (addr, page); - addr = page[pud_index (va)]; -addr_to_page (addr, page);
init-xen.c void __init xen_init_pt(void) · line 603
Quoted 10 lines
init-xen.c renamed from init-xen.c.orig +3
-2- -/* Kill mapping of low 1MB. */ +/* Kill low mappings */ while (va < (unsigned long )&_text) {if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))BUG (); va +=PAGE_SIZE ; } + addr = pud_page[pgd_index (va)];/* get pud entry from pgd tbl */ +addr_to_page (addr, pud_page);/* pud_page now va of pud tbl */
If you follow above request for using proper (or type-neutral) names, you won't need extra comments here.
Also, the code could stay at the place it was so far (since clearly pgd_index() can never be different for __START_KERNEL_map and _text).
Quoted 31 lines
init-xen.c renamed from init-xen.c.orig +14
-2/* Ensure init mappings cover kernel text/data and initial tables. */ while (va < (__START_KERNEL_map + (start_pfn <<PAGE_SHIFT ) + tables_space)) { - pmd = (pmd_t *)&page[pmd_index (va)]; + + pud = (pud_t *)&pud_page[pud_index (va)];/* get pud entry */ +if (pud_none (*pud)) { + pmd_page =alloc_static_page (&phys); +early_make_page_readonly ( + pmd_page, XENFEAT_writable_page_tables); +set_pud (pud,__pud (phys | _KERNPG_TABLE)); + }else { + addr = pud_page[pud_index (va)]; +addr_to_page (addr, pmd_page); + } + + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd)) { pte_page =alloc_static_page (&phys);early_make_page_readonly ( pte_page, XENFEAT_writable_page_tables);set_pmd (pmd,__pmd (phys | _KERNPG_TABLE)); }else { - addr = page[pmd_index (va)]; + addr = pmd_page[pmd_index (va)];addr_to_page (addr, pte_page); } pte = (pte_t *)&pte_page[pte_index (va)];
init-xen.c static void __init extend_init_mapping(u · line 642
Quoted 3 lines
init-xen.c renamed from init-xen.c.orig +0
-0@@ -630,7 +640,7 @@ static void __init extend_init_mapping(u/* Finally, blow away any spurious initial mappings. */ while (1 ) {
Didn't you indicate in an earlier mail that we're lacking a pud_none() check here? Just by adding the pud allocation above, you're not excluding to run over a pud entry boundary here.
Likewise would pmd_page need to be updated here when you cross a pud entry boundary.
init-xen.c static void xen_finish_init_mapping(void · line 735
Quoted 13 lines
init-xen.c renamed from init-xen.c.orig +2
-1- pmd = (pmd_t *)&page[pmd_index (va)]; + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd))break ;if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))@@ -719,6 +729,7 @@ static void xen_finish_init_mapping(void table_end = start_pfn; } +/* Setup the direct mapping of the physical memory at PAGE_OFFSET. This runs before bootmem is initialized and gets pages directly from the physical memory. To access them they are temporarily mapped. */
Please omit this last hunk altogether.
Jan
Quoted 8 lines · Jan Beulich
Quoted 1 line
Quoted 1 line
Quoted 1 line
Mukesh Rathor <[email protected]> 18.02.09 04:39 >>>
First a general remark: You're doing this patch to support 256G domains, but by keeping
extend_init_mapping()there'll continue to be no way to support domains with close to or above 512G (or, if making use ofXEN_ELFNOTE_INIT_P2M, 1T). This function, rather than needing fixes, really just needs to go away.
Quoted 6 lines
I've done this in our forward ported 2.6.27+ kernels, but unfortunately can't really contribute the changes to the 2.6.18 tree, as there are too many differences, and I'm simply lacking the time (and, honestly, interest) to work out all the issues. I could post the respective patch if you (or someone else) care(s).
I came up with this patch trying to fix the hang on less than 256 GB. With 256 GB it's not even coming this far, pl see another thread. Since 256 GB was the original bug, we definitely need to support that. So please post your patches with any relevant pointers and I'll take a crack at it...
thanks,
Mukesh
Quoted 96 lines
init-xen.c void __init xen_init_pt(void) · line 594
Quoted 13 lines
init-xen.c renamed from init-xen.c.orig +3
-2@@ -587,35 +587,45 @@ void __init xen_init_pt(void)static void __init extend_init_mapping (unsigned long tables_space) {unsigned long va = __START_KERNEL_map; -unsigned long phys, addr, *pte_page; +unsigned long phys, addr, *pte_page, *pmd_page; +pud_t *pud;pmd_t *pmd;pte_t *pte, new_pte; -unsigned long *page = (unsigned long *)init_level4_pgt; +unsigned long *pud_page = (unsigned long *)init_level4_pgt;This is certainly confusing. Please use typeless names here, or names that properly reflect what they're used for.
Quoted 4 lines
init-xen.c renamed from init-xen.c.orig +0
-4- addr = page[pgd_index (va)]; -addr_to_page (addr, page); - addr = page[pud_index (va)]; -addr_to_page (addr, page);init-xen.c void __init xen_init_pt(void) · line 603
Quoted 10 lines
init-xen.c renamed from init-xen.c.orig +3
-2- -/* Kill mapping of low 1MB. */ +/* Kill low mappings */ while (va < (unsigned long )&_text) {if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))BUG (); va +=PAGE_SIZE ; } + addr = pud_page[pgd_index (va)];/* get pud entry from pgd tbl */ +addr_to_page (addr, pud_page);/* pud_page now va of pud tbl */ If you follow above request for using proper (or type-neutral) names, you won't need extra comments here.
Also, the code could stay at the place it was so far (since clearly
pgd_index()can never be different for__START_KERNEL_mapand_text).Quoted 30 lines
init-xen.c renamed from init-xen.c.orig +14
-2/* Ensure init mappings cover kernel text/data and initial tables. */ while (va < (__START_KERNEL_map + (start_pfn <<PAGE_SHIFT ) + tables_space)) { - pmd = (pmd_t *)&page[pmd_index (va)]; + + pud = (pud_t *)&pud_page[pud_index (va)];/* get pud entry */ +if (pud_none (*pud)) { + pmd_page =alloc_static_page (&phys); +early_make_page_readonly ( + pmd_page, XENFEAT_writable_page_tables); +set_pud (pud,__pud (phys | _KERNPG_TABLE)); + }else { + addr = pud_page[pud_index (va)]; +addr_to_page (addr, pmd_page); + } + + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd)) { pte_page =alloc_static_page (&phys);early_make_page_readonly ( pte_page, XENFEAT_writable_page_tables);set_pmd (pmd,__pmd (phys | _KERNPG_TABLE)); }else { - addr = page[pmd_index (va)]; + addr = pmd_page[pmd_index (va)];addr_to_page (addr, pte_page); } pte = (pte_t *)&pte_page[pte_index (va)];init-xen.c static void __init extend_init_mapping(u · line 642
Quoted 3 lines
init-xen.c renamed from init-xen.c.orig +0
-0@@ -630,7 +640,7 @@ static void __init extend_init_mapping(u/* Finally, blow away any spurious initial mappings. */ while (1 ) {Didn't you indicate in an earlier mail that we're lacking a
pud_none()check here? Just by adding the pud allocation above, you're not excluding to run over a pud entry boundary here.Likewise would
pmd_pageneed to be updated here when you cross a pud entry boundary.init-xen.c static void xen_finish_init_mapping(void · line 735
Quoted 13 lines
init-xen.c renamed from init-xen.c.orig +2
-1- pmd = (pmd_t *)&page[pmd_index (va)]; + pmd = (pmd_t *)&pmd_page[pmd_index (va)];if (pmd_none (*pmd))break ;if (HYPERVISOR_update_va_mapping (va,__pte_ma (0 ),0 ))@@ -719,6 +729,7 @@ static void xen_finish_init_mapping(void table_end = start_pfn; } +/* Setup the direct mapping of the physical memory at PAGE_OFFSET. This runs before bootmem is initialized and gets pages directly from the physical memory. To access them they are temporarily mapped. */ Please omit this last hunk altogether.
Jan
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Mukesh Rathor <[email protected]> 18.02.09 20:12 >>>
Quoted 6 lines · Jan Beulich
First a general remark: You're doing this patch to support 256G domains, but by keeping
extend_init_mapping()there'll continue to be no way to support domains with close to or above 512G (or, if making use ofXEN_ELFNOTE_INIT_P2M, 1T). This function, rather than needing fixes, really just needs to go away.Quoted 6 lines
I've done this in our forward ported 2.6.27+ kernels, but unfortunately can't really contribute the changes to the 2.6.18 tree, as there are too many differences, and I'm simply lacking the time (and, honestly, interest) to work out all the issues. I could post the respective patch if you (or someone else) care(s).
Quoted 4 lines
I came up with this patch trying to fix the hang on less than 256 GB. With 256 GB it's not even coming this far, pl see another thread. Since 256 GB was the original bug, we definitely need to support that. So please post your patches with any relevant pointers and I'll take a crack at it...
Attached. Just to repeat - they are against a 2.6.27+ kernel that has various other patches enabled, so I can't easily tell whether they have dependencies on changes made elsewhere. The order we have them applied here is:
xen-x86-bigmem
xen-x86_64-init-memmap.patch
xen-x86_64-note-init-p2m.patch
Jan
From: [email protected]
Subject: eliminate scalability issues from initial mapping setup
Patch-mainline: obsolete
References: bnc#417417
Direct Xen to place the initial P->M table outside of the initial mapping, as otherwise the 1G (implementation) / 2G (theoretical) restriction on the size of the initial mapping limits the amount of memory a domain can be handed initially.
Note that the flags passed to HYPERVISOR_update_va_mapping() from __make_page_writable() and make_lowmem_page_writable() are intentionally not including UVMF_ALL. This is intended to be on optimal choice between the overhead of a potential spurious page fault (as remote CPUs may still have read-only translations in their TLBs) and the overhead of cross processor flushes. Flushing on the local CPU shouldn't be as expensive (and hence can be viewed as an optimization avoiding the spurious page fault on the local CPU), but is required when the functions are used before the page fault handler gets set up.
arch/x86/kernel/head64-xen.c +8 -0
@@ -171,6 +171,14 @@ void __init x86_64_start_reservations(ch + (xen_start_info->nr_pt_frames <<PAGE_SHIFT ), "Xen provided"); +if (xen_feature (XENFEAT_auto_translated_physmap)) + xen_start_info->mfn_list = ~0UL ; +else if (xen_start_info->mfn_list < __START_KERNEL_map) +reserve_early (xen_start_info->first_p2m_pfn <<PAGE_SHIFT , + (xen_start_info->first_p2m_pfn + + xen_start_info->nr_p2m_frames) <<PAGE_SHIFT , +"INITP2M" ); +/* * At this point everything still needed from the boot loader * or BIOS or kernel text should be early reserved or marked not
arch/x86/kernel/head_64-xen.S +2 -0
@@ -18,6 +18,7 @@ #include <asm/desc.h> #include <asm/segment.h> #include <asm/page.h> +#include <asm/pgtable.h> #include <asm/msr.h> #include <asm/cache.h> #include <asm/dwarf2.h>
@@ -135,6 +136,7 @@ ENTRY(empty_zero_page) ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .quad startup_64) ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad hypercall_page) ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .quad _PAGE_PRESENT, _PAGE_PRESENT) + ELFNOTE(Xen, XEN_ELFNOTE_INIT_P2M, .quad VMEMMAP_START) ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel") ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
arch/x86/kernel/setup-xen.c +78 -6
99 lines not on this page · raw message
arch/x86/mm/init_64-xen.c +59 -12
132 lines not on this page · raw message
arch/x86/mm/pageattr-xen.c +1 -1
@@ -1193,7 +1193,7 @@ static void __make_page_writable(unsigne pte =lookup_address (va, &level);BUG_ON (!pte || level !=PG_LEVEL_4K ); -if (HYPERVISOR_update_va_mapping (va,pte_mkwrite (*pte),0 )) +if (HYPERVISOR_update_va_mapping (va,pte_mkwrite (*pte),UVMF_INVLPG ))BUG ();if (in_secondary_range (va)) {unsigned long pfn =pte_pfn (*pte);
arch/x86/mm/pgtable-xen.c +2 -2
@@ -323,7 +323,7 @@ void __init xen_init_pgd_pin(void)if (PTRS_PER_PUD >1 )/* not folded */ SetPagePinned (virt_to_page (pud));for (u =0 ; u <PTRS_PER_PUD ; u++, pud++) { -if (!pud_present (*pud)) +if (!pud_present (*pud) ||pud_large (*pud))continue ; pmd =pmd_offset (pud,0 );if (PTRS_PER_PMD >1 )/* not folded */
@@ -334,7 +334,7 @@ void __init xen_init_pgd_pin(void) && m >= pmd_index(HYPERVISOR_VIRT_START))continue ;#endif -if (!pmd_present (*pmd)) +if (!pmd_present (*pmd) ||pmd_large (*pmd))continue ;SetPagePinned (pmd_page (*pmd)); }
arch/x86/mm/pgtable_32-xen.c +1 -1
@@ -188,6 +188,6 @@ void make_lowmem_page_writable(void *va, pte =lookup_address ((unsigned long )va, &level);BUG_ON (!pte || level !=PG_LEVEL_4K || !pte_present (*pte)); rc =HYPERVISOR_update_va_mapping ( - (unsigned long )va,pte_mkwrite (*pte),0 ); + (unsigned long )va,pte_mkwrite (*pte),UVMF_INVLPG );BUG_ON (rc); }
include/xen/interface/elfnote.h +12 -1
@@ -162,9 +162,20 @@#define XEN_ELFNOTE_SUSPEND_CANCEL 14/* +* The (non-default) location the initial phys-to-machine map should be +* placed at by the hypervisor (Dom0) or the tools (DomU). +* The kernel must be prepared for this mapping to be established using +* large pages, despite such otherwise not being available to guests. +* The kernel must also be prepared that the page table pages used for +* this mapping may not be accessible through the initial mapping. +* (Only x86-64 supports this at present.) +*/ +#define XEN_ELFNOTE_INIT_P2M 15 + +/* * The number of the highest elfnote defined. */ -#define XEN_ELFNOTE_MAX XEN_ELFNOTE_SUSPEND_CANCEL +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_INIT_P2M/* * System information exported through crash notes.
include/xen/interface/xen.h +4 -0
@@ -534,6 +534,7 @@ typedef struct shared_info shared_info_t* a. relocated kernel image * b. initial ram disk [mod_start, mod_len] * c. list of allocated page frames [mfn_list, nr_pages] +* (unless relocated due to XEN_ELFNOTE_INIT_P2M) * d. start_info_t structure [register ESI (x86)] * e. bootstrap page tables [pt_base, CR3 (x86)] * f. bootstrap stack [register ESP (x86)]
@@ -575,6 +576,9 @@ struct start_info {unsigned long mod_start;/* VIRTUAL address of pre-loaded module. */ unsigned long mod_len;/* Size (bytes) of pre-loaded module. */ int8_t cmd_line[MAX_GUEST_CMDLINE ]; +/* The pfn range here covers both page table and p->m table frames. */ +unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M table. */ +unsigned long nr_p2m_frames;/* # of pfns forming initial P->M table. */ };typedef struct start_info start_info_t ;
From: [email protected]
Subject: eliminate scalability issues from direct mapping setup
Patch-mainline: obsolete
References: bnc#417417
Should be merged into the 2.6.27 merge patch once verified.
arch/x86/kernel/setup-xen.c +0 -16
@@ -914,21 +914,6 @@ void __init setup_arch(char **cmdline_p)#endif /* max_pfn_mapped is updated here */ -#ifdef CONFIG_X86_64_XEN -/* -* Due to the way initial table space gets calculated on Xen, we have -* to call init_memory_mapping() with the larger end address first. -*/ -if (max_pfn > max_low_pfn) - max_pfn_mapped =init_memory_mapping (1UL <<32 , - max_pfn<<PAGE_SHIFT ); - max_low_pfn_mapped =init_memory_mapping (0 , max_low_pfn<<PAGE_SHIFT ); -if (max_pfn > max_low_pfn) -/* can we preserve max_low_pfn ?*/ - max_low_pfn = max_pfn; -else - max_pfn_mapped = max_low_pfn_mapped; -#else max_low_pfn_mapped =init_memory_mapping (0 , max_low_pfn<<PAGE_SHIFT ); max_pfn_mapped = max_low_pfn_mapped;
@@ -940,7 +925,6 @@ void __init setup_arch(char **cmdline_p) max_low_pfn = max_pfn; }#endif -#endif /* * NOTE: On x86-32, only from this point on, fixmaps are ready for use.
arch/x86/mm/init_64-xen.c +92 -115
338 lines not on this page · raw message
include/asm-x86/mach-xen/asm/pgtable_64.h +1 -1
@@ -165,7 +165,7 @@ static inline void xen_set_pgd(pgd_t *pg#define PGDIR_MASK (~(PGDIR_SIZE - 1)) -#define MAXMEM _AC(0x0000006fffffffff, UL) +#define MAXMEM _AC(0x000004ffffffffff, UL)#define VMALLOC_START _AC(0xffffc20000000000, UL)#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)#define VMEMMAP_START _AC(0xffffe20000000000, UL)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel