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