File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -305,6 +305,20 @@ static int __init cpcompare(const void *a, const void *b)
305
305
return (ap -> addr != ap -> entry -> addr ) - (bp -> addr != bp -> entry -> addr );
306
306
}
307
307
308
+ static bool e820_nomerge (enum e820_type type )
309
+ {
310
+ /*
311
+ * These types may indicate distinct platform ranges aligned to
312
+ * numa node, protection domain, performance domain, or other
313
+ * boundaries. Do not merge them.
314
+ */
315
+ if (type == E820_TYPE_PRAM )
316
+ return true;
317
+ if (type == E820_TYPE_SOFT_RESERVED )
318
+ return true;
319
+ return false;
320
+ }
321
+
308
322
int __init e820__update_table (struct e820_table * table )
309
323
{
310
324
struct e820_entry * entries = table -> entries ;
@@ -380,7 +394,7 @@ int __init e820__update_table(struct e820_table *table)
380
394
}
381
395
382
396
/* Continue building up new map based on this information: */
383
- if (current_type != last_type || current_type == E820_TYPE_PRAM ) {
397
+ if (current_type != last_type || e820_nomerge ( current_type ) ) {
384
398
if (last_type != 0 ) {
385
399
new_entries [new_nr_entries ].size = change_point [chg_idx ]-> addr - last_addr ;
386
400
/* Move forward only if the new size was non-zero: */
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ void __init efi_fake_memmap_early(void)
38
38
m_start = mem -> range .start ;
39
39
m_end = mem -> range .end ;
40
40
for_each_efi_memory_desc (md ) {
41
- u64 start , end ;
41
+ u64 start , end , size ;
42
42
43
43
if (md -> type != EFI_CONVENTIONAL_MEMORY )
44
44
continue ;
@@ -58,11 +58,17 @@ void __init efi_fake_memmap_early(void)
58
58
*/
59
59
start = max (start , m_start );
60
60
end = min (end , m_end );
61
+ size = end - start + 1 ;
61
62
62
63
if (end <= start )
63
64
continue ;
64
- e820__range_update (start , end - start + 1 , E820_TYPE_RAM ,
65
- E820_TYPE_SOFT_RESERVED );
65
+
66
+ /*
67
+ * Ensure each efi_fake_mem instance results in
68
+ * a unique e820 resource
69
+ */
70
+ e820__range_remove (start , size , E820_TYPE_RAM , 1 );
71
+ e820__range_add (start , size , E820_TYPE_SOFT_RESERVED );
66
72
e820__update_table (e820_table );
67
73
}
68
74
}
You can’t perform that action at this time.
0 commit comments