Skip to content

Commit c4498ae

Browse files
committed
xen: move checks for e820 conflicts further up
Move the checks for e820 memory map conflicts using the xen_chk_is_e820_usable() helper further up in order to prepare resolving some of the possible conflicts by doing some e820 map modifications, which must happen before evaluating the RAM layout. Signed-off-by: Juergen Gross <[email protected]> Tested-by: Marek Marczykowski-Górecki <[email protected]> Reviewed-by: Jan Beulich <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent ba88829 commit c4498ae

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

arch/x86/xen/setup.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,28 @@ char * __init xen_memory_setup(void)
764764
/* Make sure the Xen-supplied memory map is well-ordered. */
765765
e820__update_table(&xen_e820_table);
766766

767+
/*
768+
* Check whether the kernel itself conflicts with the target E820 map.
769+
* Failing now is better than running into weird problems later due
770+
* to relocating (and even reusing) pages with kernel text or data.
771+
*/
772+
xen_chk_is_e820_usable(__pa_symbol(_text),
773+
__pa_symbol(_end) - __pa_symbol(_text),
774+
"kernel");
775+
776+
/*
777+
* Check for a conflict of the xen_start_info memory with the target
778+
* E820 map.
779+
*/
780+
xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
781+
"xen_start_info");
782+
783+
/*
784+
* Check for a conflict of the hypervisor supplied page tables with
785+
* the target E820 map.
786+
*/
787+
xen_pt_check_e820();
788+
767789
max_pages = xen_get_max_pages();
768790

769791
/* How many extra pages do we need due to remapping? */
@@ -836,28 +858,6 @@ char * __init xen_memory_setup(void)
836858

837859
e820__update_table(e820_table);
838860

839-
/*
840-
* Check whether the kernel itself conflicts with the target E820 map.
841-
* Failing now is better than running into weird problems later due
842-
* to relocating (and even reusing) pages with kernel text or data.
843-
*/
844-
xen_chk_is_e820_usable(__pa_symbol(_text),
845-
__pa_symbol(_end) - __pa_symbol(_text),
846-
"kernel");
847-
848-
/*
849-
* Check for a conflict of the xen_start_info memory with the target
850-
* E820 map.
851-
*/
852-
xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
853-
"xen_start_info");
854-
855-
/*
856-
* Check for a conflict of the hypervisor supplied page tables with
857-
* the target E820 map.
858-
*/
859-
xen_pt_check_e820();
860-
861861
xen_reserve_xen_mfnlist();
862862

863863
/* Check for a conflict of the initrd with the target E820 map. */

0 commit comments

Comments
 (0)