Page MenuHomeFreeBSD

D15482.diff
No OneTemporary

D15482.diff

Index: sys/powerpc/ofw/ofw_machdep.c
===================================================================
--- sys/powerpc/ofw/ofw_machdep.c
+++ sys/powerpc/ofw/ofw_machdep.c
@@ -342,7 +342,19 @@
res = parse_ofw_memory(phandle, "reg", &memp[msz]);
msz += res/sizeof(struct mem_region);
- if (OF_getproplen(phandle, "available") >= 0)
+
+ /* Order is important below. On POWER9 System, device-tree
+ * might have both /linux,usable-memory and /reg properties
+ * with different size values. For discovering memory slots, we
+ * must use /linux-usable-memory otherwise we can grab NVlink
+ * memories that contains len=0 on linux,usable-memory but >0 on
+ * /reg property, even not being a standard memory region, which
+ * is wrong and causes ghost memories to show up.
+ */
+ if (OF_getproplen(phandle, "linux,usable-memory") >= 0)
+ res = parse_ofw_memory(phandle, "linux,usable-memory",
+ &availp[asz]);
+ else if (OF_getproplen(phandle, "available") >= 0)
res = parse_ofw_memory(phandle, "available",
&availp[asz]);
else

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 12, 6:54 PM (14 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26909246
Default Alt Text
D15482.diff (1 KB)

Event Timeline