aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-03-30 14:15:14 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-04-06 17:03:01 -0400
commitcef4cca551d652b7f69c9d76337c5fae24e069dc (patch)
treeade7186b2ae588fce6c41a688a7fa6aadd5b4320 /arch/x86/xen
parent3f3aaea29ff7ee2d43b430338427f30ba7f60ff9 (diff)
xen/p2m: Allow alloc_p2m_middle to call reserve_brk depending on argument
For identity cases we want to call reserve_brk only on the boundary conditions of the middle P2M (so P2M[x][y][0] = extend_brk). This is to work around identify regions (PCI spaces, gaps in E820) which are not aligned on 2MB regions. However for the case were we want to allocate P2M middle leafs at the early bootup stage, irregardless of this alignment check we need some means of doing that. For that we provide the new argument. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/p2m.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 3cc3afeb09a1..8b3a3958d120 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -499,7 +499,7 @@ static bool alloc_p2m(unsigned long pfn)
499 return true; 499 return true;
500} 500}
501 501
502static bool __init early_alloc_p2m_middle(unsigned long pfn) 502static bool __init early_alloc_p2m_middle(unsigned long pfn, bool check_boundary)
503{ 503{
504 unsigned topidx, mididx, idx; 504 unsigned topidx, mididx, idx;
505 505
@@ -508,7 +508,7 @@ static bool __init early_alloc_p2m_middle(unsigned long pfn)
508 idx = p2m_index(pfn); 508 idx = p2m_index(pfn);
509 509
510 /* Pfff.. No boundary cross-over, lets get out. */ 510 /* Pfff.. No boundary cross-over, lets get out. */
511 if (!idx) 511 if (!idx && check_boundary)
512 return false; 512 return false;
513 513
514 WARN(p2m_top[topidx][mididx] == p2m_identity, 514 WARN(p2m_top[topidx][mididx] == p2m_identity,
@@ -531,7 +531,7 @@ static bool __init early_alloc_p2m_middle(unsigned long pfn)
531 p2m_top[topidx][mididx] = p2m; 531 p2m_top[topidx][mididx] = p2m;
532 532
533 /* For save/restore we need to MFN of the P2M saved */ 533 /* For save/restore we need to MFN of the P2M saved */
534 534
535 mid_mfn_p = p2m_top_mfn_p[topidx]; 535 mid_mfn_p = p2m_top_mfn_p[topidx];
536 WARN(mid_mfn_p[mididx] != virt_to_mfn(p2m_missing), 536 WARN(mid_mfn_p[mididx] != virt_to_mfn(p2m_missing),
537 "P2M_TOP_P[%d][%d] != MFN of p2m_missing!\n", 537 "P2M_TOP_P[%d][%d] != MFN of p2m_missing!\n",
@@ -592,8 +592,8 @@ unsigned long __init set_phys_range_identity(unsigned long pfn_s,
592 WARN_ON(!early_alloc_p2m(pfn)); 592 WARN_ON(!early_alloc_p2m(pfn));
593 } 593 }
594 594
595 early_alloc_p2m_middle(pfn_s); 595 early_alloc_p2m_middle(pfn_s, true);
596 early_alloc_p2m_middle(pfn_e); 596 early_alloc_p2m_middle(pfn_e, true);
597 597
598 for (pfn = pfn_s; pfn < pfn_e; pfn++) 598 for (pfn = pfn_s; pfn < pfn_e; pfn++)
599 if (!__set_phys_to_machine(pfn, IDENTITY_FRAME(pfn))) 599 if (!__set_phys_to_machine(pfn, IDENTITY_FRAME(pfn)))