From nobody Fri Oct 22 16:53:41 2021 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 806F21808520; Fri, 22 Oct 2021 16:53: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 4HbVmP335hz4jX8; Fri, 22 Oct 2021 16:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 4840F12546; Fri, 22 Oct 2021 16:53: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 19MGrfnT084919; Fri, 22 Oct 2021 16:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MGrfa1084918; Fri, 22 Oct 2021 16:53:41 GMT (envelope-from git) Date: Fri, 22 Oct 2021 16:53:41 GMT Message-Id: <202110221653.19MGrfa1084918@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: a23e18ea5456 - main - powerpc64: tell kernel when radix is not available 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: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a23e18ea545675aca7551ef2395f6df40a3acb29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=a23e18ea545675aca7551ef2395f6df40a3acb29 commit a23e18ea545675aca7551ef2395f6df40a3acb29 Author: Leandro Lupori AuthorDate: 2021-10-22 16:44:21 +0000 Commit: Leandro Lupori CommitDate: 2021-10-22 16:44:21 +0000 powerpc64: tell kernel when radix is not available If CAS detects that radix is not supported, set radix_mmu to 0 to avoid the kernel trying to use it and panic. MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) --- stand/powerpc/ofw/cas.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c index 0a12f31d1a1a..e95af42762a5 100644 --- a/stand/powerpc/ofw/cas.c +++ b/stand/powerpc/ofw/cas.c @@ -234,9 +234,15 @@ ppc64_cas(void) } } - if ((var = getenv("radix_mmu")) != NULL && var[0] == '0') + if (!radix_mmu) + /* + * If radix is not supported, set radix_mmu to 0 to avoid + * the kernel trying to use it and panic. + */ + setenv("radix_mmu", "0", 1); + else if ((var = getenv("radix_mmu")) != NULL && var[0] == '0') radix_mmu = 0; - if (radix_mmu) + else ov5[OV5_MMU_INDEX] = OV5_MMU_RADIX; inst = OF_open("/");