x86/xen: enable early use of set_fixmap in 32-bit Xen PV guest
Commit7b25b9cb0d
("x86/xen/time: Initialize pv xen time in init_hypervisor_platform()") moved the mapping of the shared info area before pagetable_init(). This breaks booting as 32-bit PV guest as the use of set_fixmap isn't possible at this time on 32-bit. This can be worked around by populating the needed PMD on 32-bit kernel earlier. In order not to reimplement populate_extra_pte() using extend_brk() for allocating new page tables extend alloc_low_pages() to do that in case the early page table pool is not yet available. Fixes:7b25b9cb0d
("x86/xen/time: Initialize pv xen time in init_hypervisor_platform()") Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
This commit is contained in:

committed by
Boris Ostrovsky

parent
00f53f758d
commit
75f2d3a0ce
@@ -99,15 +99,22 @@ __ref void *alloc_low_pages(unsigned int num)
|
||||
}
|
||||
|
||||
if ((pgt_buf_end + num) > pgt_buf_top || !can_use_brk_pgt) {
|
||||
unsigned long ret;
|
||||
if (min_pfn_mapped >= max_pfn_mapped)
|
||||
panic("alloc_low_pages: ran out of memory");
|
||||
ret = memblock_find_in_range(min_pfn_mapped << PAGE_SHIFT,
|
||||
unsigned long ret = 0;
|
||||
|
||||
if (min_pfn_mapped < max_pfn_mapped) {
|
||||
ret = memblock_find_in_range(
|
||||
min_pfn_mapped << PAGE_SHIFT,
|
||||
max_pfn_mapped << PAGE_SHIFT,
|
||||
PAGE_SIZE * num , PAGE_SIZE);
|
||||
}
|
||||
if (ret)
|
||||
memblock_reserve(ret, PAGE_SIZE * num);
|
||||
else if (can_use_brk_pgt)
|
||||
ret = __pa(extend_brk(PAGE_SIZE * num, PAGE_SIZE));
|
||||
|
||||
if (!ret)
|
||||
panic("alloc_low_pages: can not alloc memory");
|
||||
memblock_reserve(ret, PAGE_SIZE * num);
|
||||
|
||||
pfn = ret >> PAGE_SHIFT;
|
||||
} else {
|
||||
pfn = pgt_buf_end;
|
||||
|
Reference in New Issue
Block a user