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

[Xen-changelog] [xen stable-4.9] x86/mb2: avoid Xen image when looking for module/crashkernel position



commit df6db6c7c20fb04b27eb327ad1e29adb583844c2
Author:     Daniel Kiper <daniel.kiper@xxxxxxxxxx>
AuthorDate: Wed Dec 20 15:57:26 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Dec 20 15:57:26 2017 +0100

    x86/mb2: avoid Xen image when looking for module/crashkernel position
    
    Commit e22e1c4 (x86/EFI: avoid Xen image when looking for module/kexec
    position) added relevant check for EFI case. However, since commit
    f75a304 (x86: add multiboot2 protocol support for relocatable images)
    Multiboot2 compatible bootloaders are able to relocate Xen image too.
    So, we have to avoid also Xen image region in such cases.
    
    Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 9589927e5bf9e123ec42b6e0b0809f153bd92732
    master date: 2017-12-12 14:30:53 +0100
---
 xen/arch/x86/setup.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c3e24e6..de0edf3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -638,7 +638,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     unsigned long nr_pages, raw_max_page, modules_headroom, *module_map;
     int i, j, e820_warn = 0, bytes = 0;
-    bool_t acpi_boot_table_init_done = 0;
+    bool acpi_boot_table_init_done = false, relocated = false;
     struct domain *dom0;
     struct ns16550_defaults ns16550 = {
         .data_bits = 8,
@@ -889,8 +889,10 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         mod[i].reserved = 0;
     }
 
-    if ( efi_enabled(EFI_LOADER) )
+    if ( xen_phys_start )
     {
+        relocated = true;
+
         /*
          * This needs to remain in sync with xen_in_range() and the
          * respective reserve_e820_ram() invocation below.
@@ -1083,8 +1085,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
             /* Don't overlap with other modules (or Xen itself). */
             end = consider_modules(s, e, size, mod,
-                                   mbi->mods_count + efi_enabled(EFI_LOADER),
-                                   j);
+                                   mbi->mods_count + relocated, j);
 
             if ( highmem_start && end > highmem_start )
                 continue;
@@ -1111,7 +1112,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules (or Xen itself). */
             e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
-                                 mbi->mods_count + efi_enabled(EFI_LOADER), 
-1);
+                                 mbi->mods_count + relocated, -1);
             if ( s >= e )
                 break;
             if ( e > kexec_crash_area_limit )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.9

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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