Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2017 03:57:42 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313934 - head/sys/x86/x86
Message-ID:  <201702190357.v1J3vgnL076041@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702190357.v1J3vgnL076041>