1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

Fix regression in r313898 on i386.

Use large enough type for calculation of mtrr physmask.  Typical
cpu_maxphyaddr is 36 or larger.

Reported and tested by:	sbruno
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
This commit is contained in:
Konstantin Belousov 2017-02-19 03:57:41 +00:00
parent d9440197b4
commit 8403b5a129
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313934

View File

@ -638,7 +638,7 @@ x86_mrinit(struct mem_range_softc *sc)
* Determine the size of the PhysMask and PhysBase fields in
* the variable range MTRRs.
*/
mtrr_physmask = ((1UL << cpu_maxphyaddr) - 1) & ~0xfffUL;
mtrr_physmask = (((uint64_t)1 << cpu_maxphyaddr) - 1) & ~0xfffUL;
/* If fixed MTRRs supported and enabled. */
if ((mtrrcap & MTRR_CAP_FIXED) && (mtrrdef & MTRR_DEF_FIXED_ENABLE)) {