From owner-svn-src-all@freebsd.org Sat Jul 22 06:40:59 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 4F7B5CFD23E; Sat, 22 Jul 2017 06:40:59 +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 1E2076E8C5; Sat, 22 Jul 2017 06:40:59 +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 v6M6ewRJ056939; Sat, 22 Jul 2017 06:40:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6M6ew6N056937; Sat, 22 Jul 2017 06:40:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201707220640.v6M6ew6N056937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 22 Jul 2017 06:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321363 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 321363 X-SVN-Commit-Repository: base 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: Sat, 22 Jul 2017 06:40:59 -0000 Author: alc Date: Sat Jul 22 06:40:57 2017 New Revision: 321363 URL: https://svnweb.freebsd.org/changeset/base/321363 Log: MFC r320546 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. Modified: stable/10/sys/amd64/amd64/pmap.c stable/10/sys/i386/i386/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/amd64/amd64/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1807,7 +1807,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: stable/10/sys/i386/i386/pmap.c ============================================================================== --- stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:36:27 2017 (r321362) +++ stable/10/sys/i386/i386/pmap.c Sat Jul 22 06:40:57 2017 (r321363) @@ -1245,7 +1245,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"));