]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm/x86: Workaround re-mapping low-mem areas
authorMarco Schlumpp <marco@unikraft.io>
Thu, 9 Feb 2023 13:47:36 +0000 (14:47 +0100)
committerUnikraft <monkey@unikraft.io>
Mon, 8 May 2023 19:49:16 +0000 (19:49 +0000)
The paging code currently does not unmap the memory area before the
kernel image, but then tries to re-map any region in that area.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #760

plat/kvm/x86/setup.c

index 586f399189df213e59d2ecdb9d9581b35a26d010..044a513f7a4ad8cc48170f876d807778b4bcb232 100644 (file)
@@ -195,7 +195,10 @@ static int paging_init(void)
 
                rc = ukplat_page_map(&kernel_pt, vaddr, paddr,
                                     len >> PAGE_SHIFT, prot, 0);
-               if (unlikely(rc))
+               /* Unmappings are currently not performed on the low-mem.
+                * Ignore any errors caused by already existing mappings.
+                */
+               if (unlikely(rc && rc != -EEXIST))
                        return rc;
        }