Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 May 2018 03:45:38 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333825 - head/sys/powerpc/ofw
Message-ID:  <201805190345.w4J3jcAv011569@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sat May 19 03:45:38 2018
New Revision: 333825
URL: https://svnweb.freebsd.org/changeset/base/333825

Log:
  Add yet another option for gathering available memory
  
  On some POWER9 systems, 'reg' denotes the full memory in the system, while
  'linux,usable-memory' denotes the usable memory.  Some memory is reserved for
  NVLink usage, so is partitioned off.
  
  Submitted by:	Breno Leitao

Modified:
  head/sys/powerpc/ofw/ofw_machdep.c

Modified: head/sys/powerpc/ofw/ofw_machdep.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_machdep.c	Sat May 19 03:23:46 2018	(r333824)
+++ head/sys/powerpc/ofw/ofw_machdep.c	Sat May 19 03:45:38 2018	(r333825)
@@ -342,6 +342,16 @@ ofw_mem_regions(struct mem_region *memp, int *memsz,
 
 		res = parse_ofw_memory(phandle, "reg", &memp[msz]);
 		msz += res/sizeof(struct mem_region);
+
+		/*
+		 * On POWER9 Systems we might have both linux,usable-memory and
+		 * reg properties.  'reg' denotes all available memory, but we
+		 * must use 'linux,usable-memory', a subset, as some memory
+		 * regions are reserved for NVLink.
+		 */
+		if (OF_getproplen(phandle, "linux,usable-memory") >= 0)
+			res = parse_ofw_memory(phandle, "linux,usable-memory",
+			    &availp[asz]);
 		if (OF_getproplen(phandle, "available") >= 0)
 			res = parse_ofw_memory(phandle, "available",
 			    &availp[asz]);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805190345.w4J3jcAv011569>