[RFC][PATCH v2 01/21] e820: cheat PMEM as DRAM
From: Fengguang Wu
Date: Wed Dec 26 2018 - 08:38:27 EST
From: Fan Du <fan.du@xxxxxxxxx>
This is a hack to enumerate PMEM as NUMA nodes.
It's necessary for current BIOS that don't yet fill ACPI HMAT table.
WARNING: take care to backup. It is mutual exclusive with libnvdimm
subsystem and can destroy ndctl managed namespaces.
Signed-off-by: Fan Du <fan.du@xxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
arch/x86/kernel/e820.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- linux.orig/arch/x86/kernel/e820.c 2018-12-23 19:20:34.587078783 +0800
+++ linux/arch/x86/kernel/e820.c 2018-12-23 19:20:34.587078783 +0800
@@ -403,7 +403,8 @@ static int __init __append_e820_table(st
/* Ignore the entry on 64-bit overflow: */
if (start > end && likely(size))
return -1;
-
+ if (type == E820_TYPE_PMEM)
+ type = E820_TYPE_RAM;
e820__range_add(start, size, type);
entry++;