Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2017 22:19:11 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327050 - head/sys/arm/arm
Message-ID:  <201712202219.vBKMJBRP065679@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Wed Dec 20 22:19:11 2017
New Revision: 327050
URL: https://svnweb.freebsd.org/changeset/base/327050

Log:
  If a temporary mapping is made to support EARLY_PRINTF, undo that mapping
  after cninit() runs, otherwise we leave a bogus device-memory mapping in
  userspace VA in the kernel pmap forever.
  
  Pointed out by:	cognet

Modified:
  head/sys/arm/arm/machdep.c

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Wed Dec 20 22:17:27 2017	(r327049)
+++ head/sys/arm/arm/machdep.c	Wed Dec 20 22:19:11 2017	(r327050)
@@ -1204,6 +1204,14 @@ initarm(struct arm_boot_params *abp)
 	platform_gpio_init();
 	cninit();
 
+	/*
+	 * If we made a mapping for EARLY_PRINTF after pmap_bootstrap_prepare(),
+	 * undo it now that the normal console printf works.
+	 */
+#if defined(EARLY_PRINTF) && defined(SOCDEV_PA) && defined(SOCDEV_VA) && SOCDEV_VA < KERNBASE
+	pmap_kremove(SOCDEV_VA);
+#endif
+
 	debugf("initarm: console initialized\n");
 	debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp);
 	debugf(" boothowto = 0x%08x\n", boothowto);



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