From owner-svn-src-head@freebsd.org Thu Sep 1 10:26:07 2016 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 CE9DFBC9E55; Thu, 1 Sep 2016 10:26:07 +0000 (UTC) (envelope-from andrew@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 9EECCEEC; Thu, 1 Sep 2016 10:26:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u81AQ6ZB012180; Thu, 1 Sep 2016 10:26:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u81AQ6sn012179; Thu, 1 Sep 2016 10:26:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201609011026.u81AQ6sn012179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 1 Sep 2016 10:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305191 - head/sys/arm64/arm64 X-SVN-Group: head 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.22 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: Thu, 01 Sep 2016 10:26:07 -0000 Author: andrew Date: Thu Sep 1 10:26:06 2016 New Revision: 305191 URL: https://svnweb.freebsd.org/changeset/base/305191 Log: Fix arm64 superpages bugs in pmap_enter: * Pass the correct virtual address when demoting a superpage * Use the correct l3 table after demoting a superpage * Remove an invalid KASSERT hit demoting then promoting a superpage [1] With this it is believed that superpages on arm64 is stable. Reported by: [1] cognet Obtained from: ABT Systems Ltd MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Sep 1 08:34:31 2016 (r305190) +++ head/sys/arm64/arm64/pmap.c Thu Sep 1 10:26:06 2016 (r305191) @@ -2732,7 +2732,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if (pde != NULL && lvl == 1) { l2 = pmap_l1_to_l2(pde, va); if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK && - (l3 = pmap_demote_l2_locked(pmap, l2, va, &lock)) != NULL) { + (l3 = pmap_demote_l2_locked(pmap, l2, va & ~L2_OFFSET, + &lock)) != NULL) { + l3 = &l3[pmap_l3_index(va)]; if (va < VM_MAXUSER_ADDRESS) { mpte = PHYS_TO_VM_PAGE( pmap_load(l2) & ~ATTR_MASK); @@ -2944,7 +2946,6 @@ validate: pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { - KASSERT(lvl == 2, ("Invalid pde level %d", lvl)); pmap_promote_l2(pmap, pde, va, &lock); } }