From owner-svn-src-all@freebsd.org Sun Feb 19 03:57:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 341B5CE5501; Sun, 19 Feb 2017 03:57:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2D5910EA; Sun, 19 Feb 2017 03:57:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1J3vgX6076042; Sun, 19 Feb 2017 03:57:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1J3vgnL076041; Sun, 19 Feb 2017 03:57:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702190357.v1J3vgnL076041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Feb 2017 03:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313934 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2017 03:57:43 -0000 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)) {