Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Dec 2017 11:25:34 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326525 - head/sys/arm64/arm64
Message-ID:  <201712041125.vB4BPYsW036017@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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