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
This commit is contained in:
Ian Lepore 2017-12-20 22:19:11 +00:00
parent e3842da22f
commit 68359587f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327050

View File

@ -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);