kernel/x86: Allow overlapping of memory types with physical memory ranges in MTRRs.

Otherwise, all RAM that has a more specific type than the physical range
will hit the assertion below. We also don't want to return the type
set here, so put this check before the effectiveType check.

Change-Id: I703242221771732c69accce66380b5a0efdc77e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8345
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2024-10-01 20:54:08 +00:00
committed by waddlesplash
parent 4e9899d5a6
commit 95d8739f18
+5
View File
@@ -573,6 +573,11 @@ add_memory_type_range(area_id areaID, uint64 base, uint64 size, uint32 type,
continue;
}
if (range->area == -1 && !x86_use_pat()) {
// Physical memory range in MTRRs; permit overlapping.
continue;
}
if (effectiveType != NULL) {
type = *effectiveType = range->type;
effectiveType = NULL;