svn commit: r327050 - head/sys/arm/arm
Ian Lepore
ian at FreeBSD.org
Wed Dec 20 22:19:12 UTC 2017
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);
More information about the svn-src-head
mailing list