From owner-dev-commits-src-all@freebsd.org Thu Mar 4 14:49:57 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 2779054D793; Thu, 4 Mar 2021 14:49:57 +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 4Drv0j0Yfpz3sx8; Thu, 4 Mar 2021 14:49:57 +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 05F041EC7E; Thu, 4 Mar 2021 14:49:57 +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 124EnuSD019746; Thu, 4 Mar 2021 14:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124EnuIH019745; Thu, 4 Mar 2021 14:49:56 GMT (envelope-from git) Date: Thu, 4 Mar 2021 14:49:56 GMT Message-Id: <202103041449.124EnuIH019745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 23553d6b940f - main - Fix creating the early arm64 level 2 blocks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23553d6b940f959f47045b544eefcdddf5db0949 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, 04 Mar 2021 14:49:57 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=23553d6b940f959f47045b544eefcdddf5db0949 commit 23553d6b940f959f47045b544eefcdddf5db0949 Author: Andrew Turner AuthorDate: 2021-03-04 14:00:19 +0000 Commit: Andrew Turner CommitDate: 2021-03-04 14:39:12 +0000 Fix creating the early arm64 level 2 blocks In 48ba9b2669e6 we switched from creating level 1 blocks to smaller level 2 blocks when creating the early arm64 page tables. On issue was that they had a different meaning for register x7. The former used it to hold page table attributes, while the latter held just the memory type. This caused these attributes to be incorrectly shifted. Fix this by changing the meaning of x7 to hold the block attributes and fix the only caller that used the old meaning. Most hardware seems to have handled the bits being off however qemu failed to boot as reserved bits that should be zero were being set and qemu fails to clear these when translating from a virtual address to a physical address. Sponsored by: Innovate UK --- sys/arm64/arm64/locore.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4d356e8897f0..bd013a870e34 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -430,7 +430,7 @@ common: /* Create the kernel space L2 table */ mov x6, x26 - mov x7, #VM_MEMATTR_WRITE_BACK + mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x8, #(KERNBASE & L2_BLOCK_MASK) mov x9, x28 bl build_l2_block_pagetable @@ -600,7 +600,7 @@ LEND(link_l1_pagetable) /* * Builds count 2 MiB page table entry * x6 = L2 table - * x7 = Type (0 = Device, 1 = Normal) + * x7 = Block attributes * x8 = VA start * x9 = PA start (trashed) * x10 = Entry count (trashed) @@ -615,8 +615,7 @@ LENTRY(build_l2_block_pagetable) and x11, x11, #Ln_ADDR_MASK /* Build the L2 block entry */ - lsl x12, x7, #2 - orr x12, x12, #L2_BLOCK + orr x12, x7, #L2_BLOCK orr x12, x12, #(ATTR_DEFAULT) orr x12, x12, #(ATTR_S1_UXN)