Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 2021 12:20:07 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Andrew Turner <andrew@FreeBSD.org>, dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: e779604f1d4e - main - Clean up early arm64 pmap code
Message-ID:  <424236367.2001.1621851607455@localhost>
In-Reply-To: <202105240944.14O9iZJm047466@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,


Out of curiosity. What is the expected gain? (Next to simplicity of the code of course.)


Ronald


Van: Andrew Turner <andrew@FreeBSD.org>
Datum: 24 mei 2021 11:44
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: e779604f1d4e - main - Clean up early arm64 pmap code

> 
> 
> The branch main has been updated by andrew:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=e779604f1d4e5fd0cdf3a9d1bb756b168f97b39c
> 
> commit e779604f1d4e5fd0cdf3a9d1bb756b168f97b39c
> Author:     Andrew Turner <andrew@FreeBSD.org>
> AuthorDate: 2021-05-20 06:52:15 +0000
> Commit:     Andrew Turner <andrew@FreeBSD.org>
> CommitDate: 2021-05-24 09:22:19 +0000
> 
>     Clean up early arm64 pmap code
>     
>     Early in the arm64 pmap code we need to translate between a virtual
>     address and a physical address. Rather than manually walking the page
>     table we can ask the hardware to do it for us.
>     
>     Reviewed by:    kib, markj
>     Sponsored by:   Innovate UK
>     Differential Revision: https://reviews.freebsd.org/D30357
> ---
>  sys/arm64/arm64/locore.S    |  6 ------
>  sys/arm64/arm64/pmap.c      | 28 +++-------------------------
>  sys/arm64/include/vmparam.h |  1 -
>  3 files changed, 3 insertions(+), 32 deletions(-)
> 
> diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
> index f5e6bbd604a5..472a052e9903 100644
> --- a/sys/arm64/arm64/locore.S
> +++ b/sys/arm64/arm64/locore.S
> @@ -735,10 +735,6 @@ ENTRY(abort)
>     b abort
>  END(abort)
>  
> -   .align 3
> -init_pt_va:
> -   .quad pagetable     /* XXX: Keep page tables VA */
> -
>     .section .init_pagetable, "aw", %nobits
>     .align PAGE_SHIFT
>     /*
> @@ -773,8 +769,6 @@ pagetable_end:
>  el2_pagetable:
>     .space  PAGE_SIZE
>  
> -   .globl init_pt_va
> -
>     .align  4
>  initstack:
>     .space  (PAGE_SIZE * KSTACK_PAGES)
> diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
> index a3be232a56bf..bc5d228af5ad 100644
> --- a/sys/arm64/arm64/pmap.c
> +++ b/sys/arm64/arm64/pmap.c
> @@ -742,35 +742,13 @@ pmap_resident_count_dec(pmap_t pmap, int count)
>     pmap->pm_stats.resident_count -= count;
>  }
>  
> -static pt_entry_t *
> -pmap_early_page_idx(vm_offset_t l1pt, vm_offset_t va, u_int *l1_slot,
> -    u_int *l2_slot)
> -{
> -   pt_entry_t *l2;
> -   pd_entry_t *l1;
> -
> -   l1 = (pd_entry_t *)l1pt;
> -   *l1_slot = (va >> L1_SHIFT) & Ln_ADDR_MASK;
> -
> -   /* Check locore has used a table L1 map */
> -   KASSERT((l1[*l1_slot] & ATTR_DESCR_MASK) == L1_TABLE,
> -      ("Invalid bootstrap L1 table"));
> -   /* Find the address of the L2 table */
> -   l2 = (pt_entry_t *)init_pt_va;
> -   *l2_slot = pmap_l2_index(va);
> -
> -   return (l2);
> -}
> -
>  static vm_paddr_t
>  pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va)
>  {
> -   u_int l1_slot, l2_slot;
> -   pt_entry_t *l2;
> -
> -   l2 = pmap_early_page_idx(l1pt, va, &l1_slot, &l2_slot);
> +   vm_paddr_t pa_page;
>  
> -   return ((l2[l2_slot] & ~ATTR_MASK) + (va & L2_OFFSET));
> +   pa_page = arm64_address_translate_s1e1r(va) & PAR_PA_MASK;
> +   return (pa_page | (va & PAR_LOW_MASK));
>  }
>  
>  static vm_offset_t
> diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h
> index 4a90c7711e01..a42c68d52887 100644
> --- a/sys/arm64/include/vmparam.h
> +++ b/sys/arm64/include/vmparam.h
> @@ -228,7 +228,6 @@ extern vm_paddr_t dmap_phys_base;
>  extern vm_paddr_t dmap_phys_max;
>  extern vm_offset_t dmap_max_addr;
>  extern vm_offset_t vm_max_kernel_address;
> -extern vm_offset_t init_pt_va;
>  
>  #endif
>  
> _______________________________________________
> dev-commits-src-all@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
> To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org"
> 
> 
> 
> 
From owner-dev-commits-src-all@freebsd.org  Mon May 24 10:53:55 2021
Return-Path: <owner-dev-commits-src-all@freebsd.org>
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 EA70A6321E5;
 Mon, 24 May 2021 10:53:55 +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 4FpYwz4pGGz3PQ9;
 Mon, 24 May 2021 10:53:55 +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 8CF89CE6;
 Mon, 24 May 2021 10:53:55 +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 14OArt0c040070;
 Mon, 24 May 2021 10:53:55 GMT (envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
 by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14OArtuZ040069;
 Mon, 24 May 2021 10:53:55 GMT (envelope-from git)
Date: Mon, 24 May 2021 10:53:55 GMT
Message-Id: <202105241053.14OArtuZ040069@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
 dev-commits-src-main@FreeBSD.org
From: Emmanuel Vadot <manu@FreeBSD.org>
Subject: git: 996afd401c6c - main - arm: RPI-B: Add ext_resources driver
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: manu
X-Git-Repository: src
X-Git-Refname: refs/heads/main
X-Git-Reftype: branch
X-Git-Commit: 996afd401c6c69d5abaa1aac111ca3cdd0c90a90
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
 <dev-commits-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-all>, 
 <mailto:dev-commits-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-all/>;
List-Post: <mailto:dev-commits-src-all@freebsd.org>
List-Help: <mailto:dev-commits-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all>, 
 <mailto:dev-commits-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 24 May 2021 10:53:56 -0000

The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=996afd401c6c69d5abaa1aac111ca3cdd0c90a90

commit 996afd401c6c69d5abaa1aac111ca3cdd0c90a90
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2021-05-24 10:53:00 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2021-05-24 10:53:00 +0000

    arm: RPI-B: Add ext_resources driver
    
    mmc_fdt_helpers needs clock and regulators.
    Add all the ext_resources driver to RPI-B conf file to fix the build
    
    Reported by:    mjg
---
 sys/arm/conf/RPI-B | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B
index ebaa0462b155..3d354841beba 100644
--- a/sys/arm/conf/RPI-B
+++ b/sys/arm/conf/RPI-B
@@ -36,6 +36,15 @@ options 	PLATFORM
 
 #options 	ROOTDEVNAME=\"ufs:mmcsd0s2\"
 
+# EXT_RESOURCES pseudo devices
+options 	EXT_RESOURCES
+device		clk
+device		phy
+device		hwreset
+device		nvmem
+device		regulator
+device		syscon
+
 device		bpf
 device		loop
 device		ether



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?424236367.2001.1621851607455>