From owner-svn-src-head@freebsd.org Mon Dec 4 11:25: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 7B18DDF9086; Mon, 4 Dec 2017 11:25: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 4876F63C65; Mon, 4 Dec 2017 11:25: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 vB4BPYN5036018; Mon, 4 Dec 2017 11:25:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB4BPYsW036017; Mon, 4 Dec 2017 11:25:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201712041125.vB4BPYsW036017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 4 Dec 2017 11:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326525 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 326525 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.25 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, 04 Dec 2017 11:25:35 -0000 Author: andrew Date: Mon Dec 4 11:25:34 2017 New Revision: 326525 URL: https://svnweb.freebsd.org/changeset/base/326525 Log: Use the module pointer to find the address we need to map to in the early arm64 boot sequence. This will be a virtual address in the kernel space after the kernel and any modules loaded by loader so we can use this to find the size of the kernel + modules. We can then add on a level 2 page for the module data and round up the size to be aligned to a level 2 page. This allows more than 8 MiB of modules to be loaded by loader, e.g. zfs.ko and opensolaris.ko. Reported by: Shawn Webb MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Mon Dec 4 11:16:51 2017 (r326524) +++ head/sys/arm64/arm64/locore.S Mon Dec 4 11:25:34 2017 (r326525) @@ -352,13 +352,13 @@ create_pagetables: /* Find the size of the kernel */ mov x6, #(KERNBASE) - ldr x7, .Lend - /* Find the end - begin */ - sub x8, x7, x6 + /* Find modulep - begin */ + sub x8, x0, x6 + /* Add a 2MiB page for the module data and round up */ + ldr x7, =(2 * L2_SIZE - 1) + add x8, x8, x7 /* Get the number of l2 pages to allocate, rounded down */ lsr x10, x8, #(L2_SHIFT) - /* Add 8 MiB for any rounding above and the module data */ - add x10, x10, #4 /* Create the kernel space L2 table */ mov x6, x26