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

[Xen-changelog] [xen staging-4.11] x86/boot: Allocate one extra module slot for Xen image placement



commit a2e35a759249bd8b6ffeeebc0a3bc96d9cca2fba
Author:     Daniel Kiper <daniel.kiper@xxxxxxxxxx>
AuthorDate: Mon Oct 8 14:28:55 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Oct 8 14:28:55 2018 +0200

    x86/boot: Allocate one extra module slot for Xen image placement
    
    Commit 9589927 (x86/mb2: avoid Xen image when looking for
    module/crashkernel position) fixed relocation issues for
    Multiboot2 protocol. Unfortunately it missed to allocate
    module slot for Xen image placement in early boot path.
    So, let's fix it right now.
    
    Reported-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 4c5f9dbebc0bd2afee1ecd936c74ffe65756950f
    master date: 2018-09-27 11:17:47 +0100
---
 xen/arch/x86/boot/reloc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index a56ec77212..4f4039bb7c 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -177,7 +177,12 @@ static multiboot_info_t *mbi2_reloc(u32 mbi_in)
     if ( mbi_out->mods_count )
     {
         mbi_out->flags |= MBI_MODULES;
-        mbi_out->mods_addr = alloc_mem(mbi_out->mods_count * 
sizeof(*mbi_out_mods));
+        /*
+         * We have to allocate one more module slot here. At some point
+         * __start_xen() may put Xen image placement into it.
+         */
+        mbi_out->mods_addr = alloc_mem((mbi_out->mods_count + 1) *
+                                       sizeof(*mbi_out_mods));
         mbi_out_mods = _p(mbi_out->mods_addr);
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11

_______________________________________________
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®.