diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-02-08 11:06:04 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-02-08 11:06:04 +0100 |
commit | f1bde87fc08ce8c818a1640a8fe4765d48923091 (patch) | |
tree | 0d70fa9de1bdfb1701df321df7dd05b13e46ce51 /xen/common/page_alloc.c | |
parent | ed759d20249197cf87b338ff0ed328052ca3b8e7 (diff) | |
download | xen-f1bde87fc08ce8c818a1640a8fe4765d48923091.tar.gz xen-f1bde87fc08ce8c818a1640a8fe4765d48923091.tar.bz2 xen-f1bde87fc08ce8c818a1640a8fe4765d48923091.zip |
x86: debugging code for testing 16Tb support on smaller memory systems
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/page_alloc.c')
-rw-r--r-- | xen/common/page_alloc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 9593743ef5..6b8bc39897 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -45,6 +45,7 @@ #include <asm/flushtlb.h> #ifdef CONFIG_X86 #include <asm/p2m.h> +#include <asm/setup.h> /* for highmem_start only */ #else #define p2m_pod_offline_or_broken_hit(pg) 0 #define p2m_pod_offline_or_broken_replace(pg) BUG_ON(pg != NULL) @@ -203,6 +204,25 @@ unsigned long __init alloc_boot_pages( pg = (r->e - nr_pfns) & ~(pfn_align - 1); if ( pg < r->s ) continue; + +#if defined(CONFIG_X86) && !defined(NDEBUG) + /* + * Filtering pfn_align == 1 since the only allocations using a bigger + * alignment are the ones used for setting up the frame table chunks. + * Those allocations get remapped anyway, i.e. them not having 1:1 + * mappings always accessible is not a problem. + */ + if ( highmem_start && pfn_align == 1 && + r->e > PFN_DOWN(highmem_start) ) + { + pg = r->s; + if ( pg + nr_pfns > PFN_DOWN(highmem_start) ) + continue; + r->s = pg + nr_pfns; + return pg; + } +#endif + _e = r->e; r->e = pg; bootmem_region_add(pg + nr_pfns, _e); |