:: commit 862e9a8eff10d503b489f7f081141b62482fa5e2

Mintsuki <mintsuki@protonmail.com> — 2026-05-01 20:15

parents: beee378f06

protos/limine: Allow trimming reserved entries that overlap framebuffer pages

diff --git a/common/protos/limine.c b/common/protos/limine.c
index 16807a7c..2fbb68bb 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -1421,12 +1421,15 @@ FEAT_END
                 continue;
             }
 
-            // There is a page-level overlap. Only USABLE regions can be trimmed.
-            if (memmap[j].type != MEMMAP_USABLE) {
+            // There is a page-level overlap. Only USABLE and RESERVED regions
+            // can be trimmed; everything else describes firmware- or
+            // kernel-asserted content that we must not silently shrink.
+            if (memmap[j].type != MEMMAP_USABLE
+             && memmap[j].type != MEMMAP_RESERVED) {
                 panic(false, "limine: Framebuffer page-level overlap with non-trimmable memory type %x", memmap[j].type);
             }
 
-            // Trim the usable region to not overlap with the framebuffer's
+            // Trim the region to not overlap with the framebuffer's
             // page-aligned extent.
             if (region_base < fb_aligned_base && region_top > fb_aligned_base) {
                 // Region extends before the framebuffer - trim end.
tab: 248 wrap: offon