From owner-dev-commits-src-all@freebsd.org Thu Mar 25 17:05:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C26C05C499E; Thu, 25 Mar 2021 17:05:18 +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 4F5s1B5CNGz3tTR; Thu, 25 Mar 2021 17:05:18 +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 A5C272DBB; Thu, 25 Mar 2021 17:05:18 +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 12PH5I90039442; Thu, 25 Mar 2021 17:05:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12PH5Iis039441; Thu, 25 Mar 2021 17:05:18 GMT (envelope-from git) Date: Thu, 25 Mar 2021 17:05:18 GMT Message-Id: <202103251705.12PH5Iis039441@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: 3d0399c718b2 - main - [PowerPC64] Clear low-order bits of ARPN 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: 3d0399c718b260da087d28825069f26d4f670065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 17:05:18 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=3d0399c718b260da087d28825069f26d4f670065 commit 3d0399c718b260da087d28825069f26d4f670065 Author: Leandro Lupori AuthorDate: 2021-03-25 16:30:56 +0000 Commit: Leandro Lupori CommitDate: 2021-03-25 17:01:57 +0000 [PowerPC64] Clear low-order bits of ARPN PowerISA 2.07B says that the low-order p-12 bits of the real page number contained in ARPN and LP fields of a PTE must be 0s and are ignored by the hardware (Book III-S, 5.7.7.1), where 2^p is the actual page size in bytes, but we were clearing only the LP field. This worked on bare metal and QEMU with KVM, that ignore these bits, but caused a kernel panic on QEMU with TCG, that expects them to be cleared. This fixes running FreeBSD with HPT superpages enabled on QEMU with TCG. MFC after: 2 weeks Sponsored by: Eldorado Research Institute (eldorado.org.br) --- sys/powerpc/aim/mmu_oea64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 14fea6f29a52..1aa05501bd1b 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -3717,7 +3717,7 @@ moea64_sp_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, pvo = pvos[i]; pvo->pvo_pte.prot = prot; - pvo->pvo_pte.pa = (pa & ~LPTE_LP_MASK) | LPTE_LP_4K_16M | + pvo->pvo_pte.pa = (pa & ~HPT_SP_MASK) | LPTE_LP_4K_16M | moea64_calc_wimg(pa, pmap_page_get_memattr(m)); if ((flags & PMAP_ENTER_WIRED) != 0) @@ -3874,7 +3874,7 @@ moea64_sp_promote(pmap_t pmap, vm_offset_t va, vm_page_t m) for (pvo = first, va_end = PVO_VADDR(pvo) + HPT_SP_SIZE; pvo != NULL && PVO_VADDR(pvo) < va_end; pvo = RB_NEXT(pvo_tree, &pmap->pmap_pvo, pvo)) { - pvo->pvo_pte.pa &= ~LPTE_LP_MASK; + pvo->pvo_pte.pa &= ADDR_POFF | ~HPT_SP_MASK; pvo->pvo_pte.pa |= LPTE_LP_4K_16M; pvo->pvo_vaddr |= PVO_LARGE; }