[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 09/13] xen: check for kernel memory conflicting with memory layout



Checks whether the pre-allocated memory of the loaded kernel is in
conflict with the target memory map. If this is the case, just panic
instead of run into problems later.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 arch/x86/xen/setup.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index eb219c1..37a34f9 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -829,6 +829,12 @@ static void __init xen_reserve_xen_mfnlist(void)
                         PFN_PHYS(xen_start_info->nr_p2m_frames));
 }
 
+static int __init xen_kernel_mem_conflict(phys_addr_t start, phys_addr_t size)
+{
+       panic("kernel is located at position conflicting with E820 map!\n");
+       return 0;
+}
+
 /**
  * machine_specific_memory_setup - Hook for machine specific memory setup.
  **/
@@ -843,6 +849,10 @@ char * __init xen_memory_setup(void)
        int i;
        int op;
 
+       xen_add_reserved_area(__pa_symbol(_text),
+                             __pa_symbol(__bss_stop) - __pa_symbol(_text),
+                             xen_kernel_mem_conflict, 0);
+
        xen_reserve_xen_mfnlist();
 
        xen_max_pfn = min(MAX_DOMAIN_PAGES, xen_start_info->nr_pages);
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.