From owner-svn-src-head@freebsd.org Sat Jun 1 01:40:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D183F15A75CA; Sat, 1 Jun 2019 01:40:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 711448CF06; Sat, 1 Jun 2019 01:40:15 +0000 (UTC) (envelope-from jhibbits@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C0668BE0; Sat, 1 Jun 2019 01:40:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x511eFuQ015649; Sat, 1 Jun 2019 01:40:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x511eF54015648; Sat, 1 Jun 2019 01:40:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906010140.x511eF54015648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 1 Jun 2019 01:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348490 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 348490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 711448CF06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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 Jun 2019 01:40:16 -0000 Author: jhibbits Date: Sat Jun 1 01:40:14 2019 New Revision: 348490 URL: https://svnweb.freebsd.org/changeset/base/348490 Log: powerpc/moea: Fix moea64 native VA invalidation Summary: moea64_insert_pteg_native()'s invalidation only works by happenstance. The purpose of the shifts and XORs is to extract the VSID in order to reverse-engineer the lower bits of the VPN. Currently a segment size is 256MB (2**28), and ADDR_API_SHFT64 is 16, so ADDR_PIDX_SHIFT is equivalent. However, it's semantically incorrect, in that we don't want to shift by the page shift size, we want to shift to get to the VSID. Tested by: bdragon Differential Revision: https://reviews.freebsd.org/D20467 Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Jun 1 01:22:21 2019 (r348489) +++ head/sys/powerpc/aim/moea64_native.c Sat Jun 1 01:40:14 2019 (r348490) @@ -646,15 +646,12 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint * "Modifying a Page Table Entry". Need to reconstruct * the virtual address for the outgoing entry to do that. */ - if (oldptehi & LPTE_BIG) - va = oldptehi >> moea64_large_page_shift; - else - va = oldptehi >> ADDR_PIDX_SHFT; + va = oldptehi >> (ADDR_SR_SHFT - ADDR_API_SHFT64); if (oldptehi & LPTE_HID) va = (((k >> 3) ^ moea64_pteg_mask) ^ va) & - VSID_HASH_MASK; + (ADDR_PIDX >> ADDR_PIDX_SHFT); else - va = ((k >> 3) ^ va) & VSID_HASH_MASK; + va = ((k >> 3) ^ va) & (ADDR_PIDX >> ADDR_PIDX_SHFT); va |= (oldptehi & LPTE_AVPN_MASK) << (ADDR_API_SHFT64 - ADDR_PIDX_SHFT); PTESYNC();