From owner-svn-src-head@freebsd.org Sat Aug 5 20:57:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4A3DC9E5B; Sat, 5 Aug 2017 20:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A78435C9; Sat, 5 Aug 2017 20:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75KvYND018593; Sat, 5 Aug 2017 20:57:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75KvY5K018591; Sat, 5 Aug 2017 20:57:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708052057.v75KvY5K018591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 5 Aug 2017 20:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322109 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 322109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 20:57:35 -0000 Author: andrew Date: Sat Aug 5 20:57:34 2017 New Revision: 322109 URL: https://svnweb.freebsd.org/changeset/base/322109 Log: Mark each cpu in the appropriate cpuset_domain set. This allows devices to handle cases where they can only run on a single domain. To allow all devices access to this set we need to move reading the domain earlier in the boot as it was previously handled in the CPU driver, however this is too late for the GICv3 ITS driver. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/param.h Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Sat Aug 5 19:57:45 2017 (r322108) +++ head/sys/arm64/arm64/mp_machdep.c Sat Aug 5 20:57:34 2017 (r322109) @@ -198,10 +198,6 @@ arm64_cpu_attach(device_t dev) /* Set the device to start it later */ cpu_list[cpuid] = dev; - /* Try to read the numa node of this cpu */ - OF_getencprop(ofw_bus_get_node(dev), "numa-node-id", - &__pcpu[cpuid].pc_domain, sizeof(__pcpu[cpuid].pc_domain)); - return (0); } @@ -535,6 +531,7 @@ static boolean_t cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) { uint64_t target_cpu; + int domain; target_cpu = reg[0]; if (addr_size == 2) { @@ -542,7 +539,17 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size target_cpu |= reg[1]; } - return (start_cpu(id, target_cpu) ? TRUE : FALSE); + if (!start_cpu(id, target_cpu)) + return (FALSE); + + /* Try to read the numa node of this cpu */ + if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) { + __pcpu[id].pc_domain = domain; + if (domain < MAXMEMDOM) + CPU_SET(id, &cpuset_domain[domain]); + } + + return (TRUE); } #endif Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Sat Aug 5 19:57:45 2017 (r322108) +++ head/sys/arm64/include/param.h Sat Aug 5 20:57:34 2017 (r322109) @@ -60,7 +60,7 @@ #endif /* SMP || KLD_MODULE */ #ifndef MAXMEMDOM -#define MAXMEMDOM 1 +#define MAXMEMDOM 2 #endif #define ALIGNBYTES _ALIGNBYTES