From nobody Tue Jan 17 16:38:25 2023 X-Original-To: dev-commits-src-main@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 4NxF294qPNz2skT3; Tue, 17 Jan 2023 16:38:25 +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 4NxF29472cz3DyW; Tue, 17 Jan 2023 16:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673973505; 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=BId6xlhwqw81vBL8yvAvTE90S0X6x+OmH6l96Q4JHhc=; b=hNc3iqwH71Y1zAVEu+sPPZtQPYfCSq/O0Qg+ZBA2xoZs7gwfmCf35eBcT0PG+lNOUrpbTe 3QG3lPuYfpcy1Mg248RQa9HnDhCwNB6InOXPNZGVZZ/chx+92AunLueVB8KUvCpVnDCWog K7vXFEKpWOARIAbdDfwgrlaukCd2QQ3ER5aRubdiG/2m2dMzDU9/xS/MsZAkrTGueHbPEA jQS1/u+b0QzwdHKcjxlGa1YAYwat/Qk84mfwOJRrtuU1wE7bs+ds3YE7hNcPIN6DWjpwR3 9qFGHt6FPLgF45NBOWlvU0abULEMTXSgK008Jp6PDmyYrQviX/qDHN4D/w+eSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673973505; 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=BId6xlhwqw81vBL8yvAvTE90S0X6x+OmH6l96Q4JHhc=; b=ePIoDGZ21aWkXVRv7uGC3aPgnsvu+sY1qakq3RU34dG7L+/hmtiSkugg1pvHPv3LVgg2uV hNJ7mhcrLAeDaoEZGuP4KFSK1uI6XoIYOHssVrPDEJwc+EKjJPhGR1vrGhLqt/v7z3aLgY l3CgSWxI1kFwyNp5lGT5Ov0gD8qaFHEHCHMmwbFDl6uMgk5WVh7IJTseUn2HOrJgDFLVcR zK0946qAJF2UWAgfnUyYBpRFWOJWK7CT3kvxdxd1iW19XfBkoc9h35HEogg5YVPbm+IG6l 1PXyVMazaFDK5XcJ10L2ZvrySBr4Leh3kCGusWbwq4gvqm7KwnQUJN5YdwGOKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673973505; a=rsa-sha256; cv=none; b=mryhDKHUFofhLpwcKW0EYEOfOanZJC6vuKFlQ8OuU8Rf1cQWoDLUrYScuS1tOFAWBHe0Vp br44IJjtf03yEfB7r8HdsQjZgPEDWzY46VxJQ9Mc4krw4r330wsFmyMyNLgQRLpDlaiYEf cbqJf+Tx2UTr8HlMA6SyOYEynlkD5XfGFqHLknohPftzZmnxJE10Vr1C9aFlZoT4Jifil5 Lrt79308yhkvIXZZvAtKZeaLYcPxUsdG6z5aW64OY0Cic9MSrEcqG/AFRlxr3t7+qptNMN Ga1WcgL5D0hK+eOfe55l0NU9aFAtIr2Ci2Ogryd7tokP0nYJMmo7Pjq7hcJD4Q== 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 4NxF293CRjzfBL; Tue, 17 Jan 2023 16:38:25 +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 30HGcPtM091185; Tue, 17 Jan 2023 16:38:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HGcP3C091184; Tue, 17 Jan 2023 16:38:25 GMT (envelope-from git) Date: Tue, 17 Jan 2023 16:38:25 GMT Message-Id: <202301171638.30HGcP3C091184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: b75062f23431 - main - riscv: Fix thread0.td_kstack_pages init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b75062f23431fbabef1e7d665cae270b144f71b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b75062f23431fbabef1e7d665cae270b144f71b1 commit b75062f23431fbabef1e7d665cae270b144f71b1 Author: Brooks Davis AuthorDate: 2023-01-17 16:36:15 +0000 Commit: Brooks Davis CommitDate: 2023-01-17 16:37:42 +0000 riscv: Fix thread0.td_kstack_pages init Commit 0ef3ca7ae37c70e9dc83475dc2e68e98e1c2a418 initialized thread0.td_kstack_pages to KSTACK_PAGES. Due to the lack of an include of opt_kstack_pages.h it used the fallback value of 4 from machine/param.h. This meant that increasing KSTACK_PAGES in the kernel config resulted in a panic in _epoch_enter_preempt as the following assertion was false during network stack setup: MPASS((vm_offset_t)et >= td->td_kstack && (vm_offset_t)et + sizeof(struct epoch_tracker) <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); Switch to initializing with kstack_pages following other architectures. Reviewed by: imp, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D38049 --- sys/riscv/riscv/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index b03d45b018ec..0821a29d11c1 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -291,7 +291,7 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_kstack_pages = kstack_pages; thread0.td_pcb = (struct pcb *)(thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0;