]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
arm64: fix early devmap assertion
authorMitchell Horne <mhorne@FreeBSD.org>
Wed, 13 Jan 2021 18:30:50 +0000 (14:30 -0400)
committerMitchell Horne <mhorne@FreeBSD.org>
Wed, 13 Jan 2021 21:27:44 +0000 (17:27 -0400)
commit818390ce0ca539300dd15d7a817784f1e3f7a9b8
tree8b4fb83b0de105c2ab9d8f51e8cd146e7acd63c2
parent074a91f746bd80498a4c815aa795e5dc51b12121
arm64: fix early devmap assertion

The purpose of this KASSERT is to ensure that we do not run out of space
in the early devmap. However, the devmap grew beyond its initial size of
2MB in r336519, and this assertion did not grow with it.

A devmap mapping of a 1080p framebuffer requires 1920x1080 bytes, or
1.977 MB, so it is just barely able to fit without triggering the
assertion, provided no other devices are mapped before it. With the
addition of `options GDB` in GENERIC by bbfa199cbc16, the uart is now
mapped for the purposes of a debug port, before mapping the framebuffer.
The presence of both these conditions pushes the selected virtual
address just below the threshold, triggering the assertion.

To fix this, use the correct size of the devmap, defined by
PMAP_MAPDEV_EARLY_SIZE. Since this code is shared with RISC-V, define
it for that platform as well (although it is a different size).

PR: 25241
Reported by: gbe
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
sys/kern/subr_devmap.c
sys/riscv/include/vmparam.h