From nobody Fri May 10 09:30:12 2024 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 4VbNs11vLmz5J2kW; Fri, 10 May 2024 09:30:13 +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 4VbNs06q8jz4GGD; Fri, 10 May 2024 09:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715333413; 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=K22hxSSpSWrQo3TCO1Lkdtlce4Kf2kgdck8tZdcSqsI=; b=luYJHKgo1eudtN/mRPbSxaRQFYHBmP/CHm28gCzd71YrScQiZPS6/DR2gvtfEHuJMWXFYY /Dir3UyuBhwwJVXKVecrIiBfGe1ZiixPvLcIMpLkimy+Xke8HM8unCs5WwL/+Hcc7SrrPs N1AwzQ9i0onPDTZTPeIwn0pEbl7wLnmKiyNwVdue9zWZLSCMyReTKoDlOptZ4TKlpqQlLd aV5H7jpQpR6vOWAUapANE+DY/9uRWjjyS4bFkWfLeCw4efHlw/EruMkPXN+U0rMqeWwrdA L9z4DtWOVwTMkRqgi34/LA8OivayzXSDDgNBfxpfiBpdISBfspZYPL4aJ9hqJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715333413; a=rsa-sha256; cv=none; b=gcZCZ0En+UILiM9xeG+bDTJqjfdjRm2CXxo5/wMf6mtsvjVEU8z8RrNnZ8ZOdoQallF2DE lGRJo+HzkIYphXoHAb+ckn9WogHBxMMeD3X+dwIj0f1y9meDTfYhxMhTdFNTJJlJNU+Aw6 jcLCnHKxXTSDU6/Ncr1JWb2hoMOogYqn7Rz57vfybdmkD8HrBrR2XN+haYFJbndlBxFKuA M4obPDBW1sXtaDJMyl1bbAVW7gwn3LQc9jRyHKBIpZ4S/uCj93OOP4+jiTLfiueVedGR7p RoFVdpTrWfdGsXI6sbpow/KxFebVFstbwNsrCA/GbnkyRpXmS1w9WNJ/Vyv74Q== 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=1715333413; 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=K22hxSSpSWrQo3TCO1Lkdtlce4Kf2kgdck8tZdcSqsI=; b=D7oDdM0Wrf3zFNSTzSjlLEJz6zEvIG0GebuscSFk63sbGAl8t1tAjhDnPGtBQltovTPBD6 Zi1Vk1uwEf5VlnndPEtOhZhGB7I9ReQw9YH7GlN0VaD3a2poqPnAxQ6tfVFttoZRugHmlR yGMNpGGZVgdS7Foyi5CvovPqyT95V7wpVvaJVYsVV5hJvLtaPtpbdEKD3A29xRX6Dnyln/ WtoIufs/6A/geFplm6d8FbWlJ2F4HyLOjmoCjLyKRHDOoHLiurND7sDocbKg0VOjfGuauc kusQUZjtbgfCfNH1OL9JuZ0K6PPYCmmXYzrok04HFTsnGJzilp5aEppfETV3uA== 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 4VbNs06R37zXRf; Fri, 10 May 2024 09:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A9UCgW086843; Fri, 10 May 2024 09:30:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A9UCEv086834; Fri, 10 May 2024 09:30:12 GMT (envelope-from git) Date: Fri, 10 May 2024 09:30:12 GMT Message-Id: <202405100930.44A9UCEv086834@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: 719908c81300 - main - arm64: Merge common page table creation code 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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: 719908c8130012234898c3602eb0c0db9af0a620 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=719908c8130012234898c3602eb0c0db9af0a620 commit 719908c8130012234898c3602eb0c0db9af0a620 Author: Andrew Turner AuthorDate: 2024-04-25 13:06:23 +0000 Commit: Andrew Turner CommitDate: 2024-05-10 09:29:24 +0000 arm64: Merge common page table creation code Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45061 --- sys/arm64/arm64/locore.S | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 94a50b735bc6..67bdece402c2 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -520,17 +520,27 @@ common: * when the page size is larger than 4k, L2 blocks are too large to * map the kernel with such an alignment. */ +#define PTE_SHIFT L3_SHIFT +#define BUILD_PTE_FUNC build_l3_page_pagetable +#else +#define PTE_SHIFT L2_SHIFT +#define BUILD_PTE_FUNC build_l2_block_pagetable +#endif - /* Get the number of l3 pages to allocate, rounded down */ - lsr x10, x8, #(L3_SHIFT) + /* Get the number of blocks/pages to allocate, rounded down */ + lsr x10, x8, #(PTE_SHIFT) - /* Create the kernel space L2 table */ + /* Create the kernel space PTE table */ mov x6, x26 mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x8, #(KERNBASE) mov x9, x28 - bl build_l3_page_pagetable + bl BUILD_PTE_FUNC + +#undef PTE_SHIFT +#undef BUILD_PTE_FUNC +#if PAGE_SIZE != PAGE_SIZE_4K /* Move to the l2 table */ ldr x9, =(PAGE_SIZE * L3_PAGE_COUNT) add x26, x26, x9 @@ -539,16 +549,6 @@ common: mov x9, x6 mov x6, x26 bl link_l2_pagetable -#else - /* Get the number of l2 pages to allocate, rounded down */ - lsr x10, x8, #(L2_SHIFT) - - /* Create the kernel space L2 table */ - mov x6, x26 - mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) - mov x8, #(KERNBASE) - mov x9, x28 - bl build_l2_block_pagetable #endif /* Move to the l1 table */