svn commit: r313934 - head/sys/x86/x86

Konstantin Belousov kib at FreeBSD.org
Sun Feb 19 03:57:43 UTC 2017


Author: kib
Date: Sun Feb 19 03:57:41 2017
New Revision: 313934
URL: https://svnweb.freebsd.org/changeset/base/313934

Log:
  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

Modified:
  head/sys/x86/x86/x86_mem.c

Modified: head/sys/x86/x86/x86_mem.c
==============================================================================
--- head/sys/x86/x86/x86_mem.c	Sun Feb 19 03:33:20 2017	(r313933)
+++ head/sys/x86/x86/x86_mem.c	Sun Feb 19 03:57:41 2017	(r313934)
@@ -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)) {


More information about the svn-src-head mailing list