From owner-svn-src-head@freebsd.org Mon Jul 25 15:57:15 2016 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 08FC2BA45B9; Mon, 25 Jul 2016 15:57:15 +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 CD2F115BA; Mon, 25 Jul 2016 15:57:14 +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 u6PFvEjb077320; Mon, 25 Jul 2016 15:57:14 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6PFvEle077319; Mon, 25 Jul 2016 15:57:14 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201607251557.u6PFvEle077319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Jul 2016 15:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303307 - head/sys/arm64/arm64 X-SVN-Group: head 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.22 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: Mon, 25 Jul 2016 15:57:15 -0000 Author: andrew Date: Mon Jul 25 15:57:13 2016 New Revision: 303307 URL: https://svnweb.freebsd.org/changeset/base/303307 Log: Rework how we number CPUs on arm64 to try and keep clusters together. Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:56:37 2016 (r303306) +++ head/sys/arm64/arm64/mp_machdep.c Mon Jul 25 15:57:13 2016 (r303307) @@ -454,9 +454,16 @@ cpu_init_fdt(u_int id, phandle_t node, u if (id == cpu0) return (1); + /* + * Rotate the CPU IDs to put the boot CPU as CPU 0. We keep the other + * CPUs ordered as the are likely grouped into clusters so it can be + * useful to keep that property, e.g. for the GICv3 driver to send + * an IPI to all CPUs in the cluster. + */ cpuid = id; if (cpuid < cpu0) - cpuid++; + cpuid += mp_maxid + 1; + cpuid -= cpu0; pcpup = &__pcpu[cpuid]; pcpu_init(pcpup, cpuid, sizeof(struct pcpu));