From owner-svn-src-head@FreeBSD.ORG Mon Jan 20 18:37:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E119BF7; Mon, 20 Jan 2014 18:37:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A57F1D8E; Mon, 20 Jan 2014 18:37:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0KIbZfc012461; Mon, 20 Jan 2014 18:37:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0KIbZGY012460; Mon, 20 Jan 2014 18:37:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201401201837.s0KIbZGY012460@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 20 Jan 2014 18:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260914 - head/sys/ia64/ia64 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.17 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: Mon, 20 Jan 2014 18:37:35 -0000 Author: marcel Date: Mon Jan 20 18:37:35 2014 New Revision: 260914 URL: http://svnweb.freebsd.org/changeset/base/260914 Log: In pmap_set_pte(), make sure to enforce ordering by inserting a memory fence. Under system load, the CPU has been found to change the order by which the stores are made visible. When the tag is made visible before the other TLB values, other CPUs may use the invalid TLB values and do bad things. While here (i.e. not a fix) don't return errors from pmap_remove_vhpt() to callers of pmap_remove_pte(). Those callers don't check the return value and as such don't do what is needed to keep a consistent state. More importantly, pmap_remove_vhpt() can't really have an error without it indicating something unintended. Using KASSERT is therefore better. PR: 182999, 183227 Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Jan 20 18:15:06 2014 (r260913) +++ head/sys/ia64/ia64/pmap.c Mon Jan 20 18:37:35 2014 (r260914) @@ -1303,6 +1303,8 @@ pmap_set_pte(struct ia64_lpte *pte, vm_o pte->itir = PAGE_SHIFT << 2; + ia64_mf(); + pte->tag = ia64_ttag(va); } @@ -1321,8 +1323,8 @@ pmap_remove_pte(pmap_t pmap, struct ia64 * First remove from the VHPT. */ error = pmap_remove_vhpt(va); - if (error) - return (error); + KASSERT(error == 0, ("%s: pmap_remove_vhpt returned %d", + __func__, error)); pmap_invalidate_page(va);