From owner-svn-src-head@freebsd.org Thu Jul 19 21:58:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A53104CA10; Thu, 19 Jul 2018 21:58:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB3207E451; Thu, 19 Jul 2018 21:58:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C991A2F05C; Thu, 19 Jul 2018 21:58:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6JLw78O093518; Thu, 19 Jul 2018 21:58:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6JLw7Rq093515; Thu, 19 Jul 2018 21:58:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201807192158.w6JLw7Rq093515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 19 Jul 2018 21:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336519 - in head/sys: arm64/arm64 arm64/include kern X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include kern X-SVN-Commit-Revision: 336519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2018 21:58:08 -0000 Author: manu Date: Thu Jul 19 21:58:06 2018 New Revision: 336519 URL: https://svnweb.freebsd.org/changeset/base/336519 Log: Raise the size of L3 table for early devmap on arm64 Some driver (like efifb) needs to map more than the current L2_SIZE Raise the size so we can map the framebuffer setup by the bootloader. Reviewed by: cognet Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h head/sys/kern/subr_devmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Jul 19 21:07:39 2018 (r336518) +++ head/sys/arm64/arm64/pmap.c Thu Jul 19 21:58:06 2018 (r336519) @@ -836,7 +836,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ freemempos = pmap_bootstrap_l2(l1pt, va, freemempos); /* And the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, - VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); + VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE), freemempos); cpu_tlb_flushID(); @@ -858,7 +858,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ virtual_avail = preinit_map_va + PMAP_PREINIT_MAPPING_SIZE; virtual_avail = roundup2(virtual_avail, L1_SIZE); - virtual_end = VM_MAX_KERNEL_ADDRESS - L2_SIZE; + virtual_end = VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE); kernel_vm_end = virtual_avail; pa = pmap_early_vtophys(l1pt, freemempos); Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Thu Jul 19 21:07:39 2018 (r336518) +++ head/sys/arm64/include/pte.h Thu Jul 19 21:58:06 2018 (r336519) @@ -109,6 +109,8 @@ typedef uint64_t pt_entry_t; /* page table entry */ /* 0x2 also marks an invalid address */ #define L3_PAGE 0x3 +#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 4) + #define L0_ENTRIES_SHIFT 9 #define L0_ENTRIES (1 << L0_ENTRIES_SHIFT) #define L0_ADDR_MASK (L0_ENTRIES - 1) Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Thu Jul 19 21:07:39 2018 (r336518) +++ head/sys/kern/subr_devmap.c Thu Jul 19 21:58:06 2018 (r336519) @@ -305,8 +305,8 @@ pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_me if (early_boot) { akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - size); va = akva_devmap_vaddr; - KASSERT(va >= VM_MAX_KERNEL_ADDRESS - L2_SIZE, - ("Too many early devmap mappings")); + KASSERT(va >= (VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE)), + ("Too many early devmap mappings 2")); } else va = kva_alloc(size); if (!va)