diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-03-30 14:33:14 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-04-06 17:03:06 -0400 |
commit | 940713bb2ce3033f468a220094a07250a2f69bdd (patch) | |
tree | 2bdf0c6eb1a2d530737918544423d56fb0ea4dd8 /arch/x86/xen | |
parent | d5096850b47424fb0f1c6a75b8f7184f7169319a (diff) |
xen/p2m: An early bootup variant of set_phys_to_machine
During early bootup we can't use alloc_page, so to allocate
leaf pages in the P2M we need to use extend_brk. For that
we are utilizing the early_alloc_p2m and early_alloc_p2m_middle
functions to do the job for us. This function follows the
same logic as set_phys_to_machine.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/p2m.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 952edefcedb3..ffd08c414e91 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -570,6 +570,21 @@ static bool __init early_alloc_p2m(unsigned long pfn) | |||
570 | } | 570 | } |
571 | return true; | 571 | return true; |
572 | } | 572 | } |
573 | bool __init early_set_phys_to_machine(unsigned long pfn, unsigned long mfn) | ||
574 | { | ||
575 | if (unlikely(!__set_phys_to_machine(pfn, mfn))) { | ||
576 | if (!early_alloc_p2m(pfn)) | ||
577 | return false; | ||
578 | |||
579 | if (!early_alloc_p2m_middle(pfn, false /* boundary crossover OK!*/)) | ||
580 | return false; | ||
581 | |||
582 | if (!__set_phys_to_machine(pfn, mfn)) | ||
583 | return false; | ||
584 | } | ||
585 | |||
586 | return true; | ||
587 | } | ||
573 | unsigned long __init set_phys_range_identity(unsigned long pfn_s, | 588 | unsigned long __init set_phys_range_identity(unsigned long pfn_s, |
574 | unsigned long pfn_e) | 589 | unsigned long pfn_e) |
575 | { | 590 | { |