From owner-svn-src-all@freebsd.org Tue May 22 14:26:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA4FEF7D89; Tue, 22 May 2018 14:26:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C963277916; Tue, 22 May 2018 14:26:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA85315355; Tue, 22 May 2018 14:26:58 +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 w4MEQwsq036787; Tue, 22 May 2018 14:26:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4MEQwdY036786; Tue, 22 May 2018 14:26:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201805221426.w4MEQwdY036786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 May 2018 14:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334045 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 334045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 14:26:59 -0000 Author: andrew Date: Tue May 22 14:26:58 2018 New Revision: 334045 URL: https://svnweb.freebsd.org/changeset/base/334045 Log: Pass the array length into regions_to_avail. On arm64 we will need to get the phys_avail array from before the kernel is excluded to create teh DMAP region. In preperation for this pass in the array length into regions_to_avail. Modified: head/sys/arm/arm/physmem.c Modified: head/sys/arm/arm/physmem.c ============================================================================== --- head/sys/arm/arm/physmem.c Tue May 22 14:25:40 2018 (r334044) +++ head/sys/arm/arm/physmem.c Tue May 22 14:26:58 2018 (r334045) @@ -168,8 +168,8 @@ arm_physmem_print_tables(void) * Returns the number of pages of non-excluded memory added to the avail list. */ static size_t -regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail, - long *prealmem) +regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail, + long *pavail, long *prealmem) { size_t acnt, exi, hwi; uint64_t end, start, xend, xstart; @@ -258,7 +258,7 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, } availmem += pm_btop((vm_offset_t)(end - start)); } - if (acnt >= MAX_AVAIL_ENTRIES) + if (acnt >= maxavail) panic("Not enough space in the dump/phys_avail arrays"); } @@ -389,9 +389,10 @@ arm_physmem_init_kernel_globals(void) { size_t nextidx; - regions_to_avail(dump_avail, EXFLAG_NODUMP, NULL, NULL); - nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC, &physmem, - &realmem); + regions_to_avail(dump_avail, EXFLAG_NODUMP, MAX_AVAIL_ENTRIES, NULL, + NULL); + nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC, + MAX_AVAIL_ENTRIES, &physmem, &realmem); if (nextidx == 0) panic("No memory entries in phys_avail"); Maxmem = atop(phys_avail[nextidx - 1]);