From nobody Thu Aug 29 15:21:52 2024 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 4WvlPY1Qptz5PcGw; Thu, 29 Aug 2024 15:21:53 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WvlPX65Mzz4q76; Thu, 29 Aug 2024 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944912; 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=1B0VgsHNi007aVdoAhRbBoGFrXvF0MW9IFn1P5ybniU=; b=cg37kyVTq3qHjO7NMBffxNkcDS1OvILeXTCd4JAAcdRFacKxUZ9RE/p72yO+JJioDSGfWI TZemvrbp38Zm/cKyAYuXiqIciIGYewgBJ7zMPgxh2Ob2Uo24zlN8mrt6cgzVQonPxD3GCI 8gHaj3Mn6Wlu/1r74pUvRgJ0Jd1RVWSPY7MFzQQqQfV4kdhOuFjIAcBsK8ot+zaRDULUah lMbRDm+j7WwLavD2CL1raS+SZ8hW5lO4Z/uUw4fNtH88SoeumYxQmo8tNeEhr6d8jXJ7fg pIrOGk5lKrGu9dSzzj97pjJMOppKr//soJELB59cuopQ/lZehh87AHJaXdxoTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724944912; a=rsa-sha256; cv=none; b=GheNDvu2ZWcPSNTLJP8c5quitSbFM/Asbs2HeYLHiO+sP9Njjyc5zrs6Ejnhm+MzndYDdb kw7MXlOph/1euHHIU42cNDv8YAc/Mg655QDFS6UQ8tDb2ipFuSK95a/6Lw+K6iqYeI1HJc fvBW6ZLxN8BHHnN7l/27pXJusNcnhE6F6Y7WfRwo8b/6jN/qEFtVsWZtZtlY3MRy/Lcyug posfEYv9Pdfn3xDi+DydpIY+Qutv8lxBhiRSfDi8nkyJGlwL1ZQ3TcwaXlV3d5jDhGL5Op oSc3vfoRAcZvYrMu90gsVpSuqMF0gkeyv8uS0jG1Ujfods4e3eqEwLmvc+iSTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724944912; 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=1B0VgsHNi007aVdoAhRbBoGFrXvF0MW9IFn1P5ybniU=; b=dzuZgPyOsFpJdHqLCC0VuKT8ZNGg2ZP8HxZtKFiHBQLstXgbkjxy9GKkPlisW+s2wF81S/ b7lPtwqTMErkk0QkB/78hitWTAAtfJXl18MjQis/3k/w1rtH64BnjLoXuS+VtafjFMOyMB zdlJfo+mfQWZG9bf3kQvzQe/BtHFWBiOhBXAj9MRsyTd9zc+Hfepp74n2aa15U9mGjNpvD nhadZ/ef/9+7CzVws63Ujcgk3YOX0a0cDKS0FIR4EM1B2XfDlxSHdj4/MI+izdbD2iyYZR LdzopAiYvE8Dbscw9X6552Y7mEmR/VAXd9G7iurmDvuClIB83TVfGC7hdxK5kg== 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 4WvlPX5jFXzMt4; Thu, 29 Aug 2024 15:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47TFLqx8008966; Thu, 29 Aug 2024 15:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47TFLqr6008963; Thu, 29 Aug 2024 15:21:52 GMT (envelope-from git) Date: Thu, 29 Aug 2024 15:21:52 GMT Message-Id: <202408291521.47TFLqr6008963@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: 2e33abc35460 - main - riscv: fix a bug in calculating the pindex for L1 page 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 commit 2e33abc35460b9e2c2eeb1e43a0614db7bebbdb3 Author: Wuyang Chung AuthorDate: 2024-08-04 14:04:12 +0000 Commit: Mitchell Horne CommitDate: 2024-08-29 15:20:28 +0000 riscv: fix a bug in calculating the pindex for L1 page pmap_l1_pindex(va) expands to: ((va >> L1_SHIFT) + NUL2E) Reviewed by: mhorne MFC after: 1 week Fixes: a4667e09e652 ("Convert vm_page_alloc() callers to...") Pull Request: https://github.com/freebsd/freebsd-src/pull/1360 --- sys/riscv/riscv/pmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index c372e6f7362b..4baa4948e442 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1887,8 +1887,8 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L1_SHIFT; + panic("%s: no memory to grow kernel", __func__); + nkpg->pindex = pmap_l1_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pn = (paddr / PAGE_SIZE); @@ -1913,8 +1913,8 @@ pmap_growkernel(vm_offset_t addr) nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_NOFREE | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) - panic("pmap_growkernel: no memory to grow kernel"); - nkpg->pindex = kernel_vm_end >> L2_SHIFT; + panic("%s: no memory to grow kernel", __func__); + nkpg->pindex = pmap_l2_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pn = (paddr / PAGE_SIZE);