Commit 25b884a8 authored by David Vrabel's avatar David Vrabel

x86/xen: set regions above the end of RAM as 1:1

PCI devices may have BARs located above the end of RAM so mark such
frames as identity frames in the p2m (instead of the default of
missing).

PFNs outside the p2m (above MAX_P2M_PFN) are also considered to be
identity frames for the same reason.
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 2dcc9a3d
...@@ -507,7 +507,7 @@ unsigned long get_phys_to_machine(unsigned long pfn) ...@@ -507,7 +507,7 @@ unsigned long get_phys_to_machine(unsigned long pfn)
unsigned topidx, mididx, idx; unsigned topidx, mididx, idx;
if (unlikely(pfn >= MAX_P2M_PFN)) if (unlikely(pfn >= MAX_P2M_PFN))
return INVALID_P2M_ENTRY; return IDENTITY_FRAME(pfn);
topidx = p2m_top_index(pfn); topidx = p2m_top_index(pfn);
mididx = p2m_mid_index(pfn); mididx = p2m_mid_index(pfn);
......
...@@ -468,6 +468,15 @@ char * __init xen_memory_setup(void) ...@@ -468,6 +468,15 @@ char * __init xen_memory_setup(void)
i++; i++;
} }
/*
* Set the rest as identity mapped, in case PCI BARs are
* located here.
*
* PFNs above MAX_P2M_PFN are considered identity mapped as
* well.
*/
set_phys_range_identity(map[i-1].addr / PAGE_SIZE, ~0ul);
/* /*
* In domU, the ISA region is normal, usable memory, but we * In domU, the ISA region is normal, usable memory, but we
* reserve ISA memory anyway because too many things poke * reserve ISA memory anyway because too many things poke
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment