From owner-svn-src-head@freebsd.org Sat Jul 1 16:42:11 2017 Return-Path: Delivered-To: svn-src-head@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 2DC88D8DF25; Sat, 1 Jul 2017 16:42:11 +0000 (UTC) (envelope-from alc@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 E63E567407; Sat, 1 Jul 2017 16:42:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v61Gg9p5005064; Sat, 1 Jul 2017 16:42:09 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v61Gg9f6005062; Sat, 1 Jul 2017 16:42:09 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707011642.v61Gg9f6005062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 1 Jul 2017 16:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320546 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 320546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jul 2017 16:42:11 -0000 Author: alc Date: Sat Jul 1 16:42:09 2017 New Revision: 320546 URL: https://svnweb.freebsd.org/changeset/base/320546 Log: When "force" is specified to pmap_invalidate_cache_range(), the given start address is not required to be page aligned. However, the loop within pmap_invalidate_cache_range() that performs the actual cache line invalidations requires that the starting address be truncated to a multiple of the cache line size. This change corrects an error in that truncation. Submitted by: Brett Gutstein Reviewed by: kib MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jul 1 15:58:57 2017 (r320545) +++ head/sys/amd64/amd64/pmap.c Sat Jul 1 16:42:09 2017 (r320546) @@ -1868,7 +1868,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned")); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jul 1 15:58:57 2017 (r320545) +++ head/sys/i386/i386/pmap.c Sat Jul 1 16:42:09 2017 (r320546) @@ -1289,7 +1289,7 @@ pmap_invalidate_cache_range(vm_offset_t sva, vm_offset { if (force) { - sva &= ~(vm_offset_t)cpu_clflush_line_size; + sva &= ~(vm_offset_t)(cpu_clflush_line_size - 1); } else { KASSERT((sva & PAGE_MASK) == 0, ("pmap_invalidate_cache_range: sva not page-aligned"));