From nobody Thu Oct 6 22:05:40 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mk59K1Yhvz4VBWc; Thu, 6 Oct 2022 22:05:41 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mk59K16Ppz3tY1; Thu, 6 Oct 2022 22:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665093941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxMINWfhaC5hu02dbBSbz/qSsj1PzXiVwkdAjdQYTX4=; b=oXEVcRGO08kir8d/TOT7AHP4wbh3vtEyFhqluG7wnqF3T6JceReXLNMq2N09wLw8XyHUhz ry+DFS2DrN0RRd9Mg3Ad2lvS/knSHEb8o13JMKIERCe+knMXPenu6hzKuhHiGFXBipN6Dn c7RAeVWEEVZhLIeZes0BJ0VgVBijJWkzDdecbfefWGCk69+nHyoBGYoTP7I1/D79xu8qUp Fx4x72LLcRN0DyVySSR/zrjuJt1nojbQdq+lucZmzUcn//V6a6Q4c6qUoUsu9byezuMXhA 6aNOWrStiI56JV/uSTe4cAJ+YXtCW0vJ1DUq/sOjvS789LEM3nQMyhB7xRwF4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mk59K0D1RzNvV; Thu, 6 Oct 2022 22:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 296M5eAf056170; Thu, 6 Oct 2022 22:05:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 296M5eqO056169; Thu, 6 Oct 2022 22:05:40 GMT (envelope-from git) Date: Thu, 6 Oct 2022 22:05:40 GMT Message-Id: <202210062205.296M5eqO056169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 99fe523778af - main - riscv: add an assert to pmap_remove_pages() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99fe523778af8cd0db3a17b253adb77a980176be Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665093941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxMINWfhaC5hu02dbBSbz/qSsj1PzXiVwkdAjdQYTX4=; b=pVF+P3qgNBT1KmPvE/cHNndelBL4F7+fNnraHTGeDbiFYC8dVVOFjvJ5Dd/IyUXbazEdee GsldqKc6pLNjExQ8n5Ah4rFTk4ONETMsMvnZ/YgckpBRotdono1RODEP0hcYV9mkSuc5Mo AZWIU2iKcpBi59m9YoXiaelC3ymegWRhZm6/lWlQhoJxQc6ZdG0g0xFBNIEe8UVReLmIfR NRzrWm01iy6Wq0Lp8VAAzfNu4bLgp/LRDEolHXWXN8CcOm2umjBbjmCTfHCUKUBTZt9ET4 5elWtWd+MS9Q/ZYY8g5o1rW+QKWCNoDUbQAK3lMgRzFtYaJCCX6uU4EANAQF3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665093941; a=rsa-sha256; cv=none; b=bkpZEAijG/I0FFnppEphKl0sO1XS4MYJgQehrkzy2ZGjb4vIzcKUfnB0p6nAMh477lP5m2 ibRHJGNDMkWoGdlkWUxeZXc6toXkfIrYJk34YzeJDg6fkA4LRcxu+HulZyzTCUZX8rcaz6 YB+FjqYoM8/h9DCxPPbePpZW3iW9+jq5+IDPKP4GzRJsWNjI+cfnH8mz+/PJ3DcawSr2Dm 1+Yas4+P9co/B+fJYADKRRWWDgFnEtPTXAVssF1uF5e9MznxbYSTaoqxzaNi7x3DI4UsZo QFkphjn35WsNRgd+phxLvxNVOXrlOCtBavEOEWZuRgyBEajRbrOUbu3P/MWLfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=99fe523778af8cd0db3a17b253adb77a980176be commit 99fe523778af8cd0db3a17b253adb77a980176be Author: Mitchell Horne AuthorDate: 2022-08-25 20:08:20 +0000 Commit: Mitchell Horne CommitDate: 2022-10-06 22:04:41 +0000 riscv: add an assert to pmap_remove_pages() Similar checks exist for both arm64 and amd64, but note that for amd64 it is a bare panic(). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36564 --- sys/riscv/riscv/pmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 9f73a020d0f4..de7f548b6519 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -3908,6 +3908,10 @@ pmap_remove_pages(pmap_t pmap) ptepde = pmap_load(pte); pte = pmap_l1_to_l2(pte, pv->pv_va); tpte = pmap_load(pte); + + KASSERT((tpte & PTE_V) != 0, + ("L2 PTE is invalid... bogus PV entry? " + "va=%#lx, pte=%#lx", pv->pv_va, tpte)); if ((tpte & PTE_RWX) != 0) { superpage = true; } else {