Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/aarch64/aarch64 Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/5c50b4adf06f
branches:  netbsd-9
changeset: 963506:5c50b4adf06f
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jan 21 11:11:00 2020 +0000

description:
Pull up following revision(s) (requested by ryo in ticket #617):

        sys/arch/aarch64/aarch64/aarch64_machdep.c: revision 1.37
        sys/arch/aarch64/aarch64/locore.S: revision 1.50

fix panic when modload.

panic: kernel diagnostic assertion "!pmap_extract(pmap_kernel(), loopva, NULL)" failed: file "../../../../uvm/uvm_km.c", line 674 loopva=0xffffffc001000000'

The space allocated by bootpage_alloc() is only used as a physical page
for pagetable pages, so there is no need to map it with KVA.
And kernend_extra should not have consumed any KVA space.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |  20 ++++++++++----------
 sys/arch/aarch64/aarch64/locore.S          |   5 ++---
 2 files changed, 12 insertions(+), 13 deletions(-)

diffs (114 lines):

diff -r 310d8f019f25 -r 5c50b4adf06f sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Tue Jan 21 10:40:52 2020 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Tue Jan 21 11:11:00 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.28.4.1 2019/09/22 10:36:30 martin Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.28.4.2 2020/01/21 11:11:00 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.28.4.1 2019/09/22 10:36:30 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.28.4.2 2020/01/21 11:11:00 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -100,7 +100,7 @@
 /* filled in before cleaning bss. keep in .data */
 u_long kern_vtopdiff __attribute__((__section__(".data")));
 
-long kernend_extra;    /* extra memory allocated from round_page(_end[]) */
+long kernend_extra;    /* extra physicalmemory allocated from round_page(_end[]) */
 
 /* dump configuration */
 int    cpu_dump(void);
@@ -221,7 +221,7 @@
        pmapboot_protect(L2_TRUNC_BLOCK(kernstart),
            L2_TRUNC_BLOCK(data_start), VM_PROT_WRITE);
        pmapboot_protect(L2_ROUND_BLOCK(rodata_start),
-           L2_ROUND_BLOCK(kernend + kernend_extra), VM_PROT_EXECUTE);
+           L2_ROUND_BLOCK(kernend), VM_PROT_EXECUTE);
 
        aarch64_tlbi_all();
 
@@ -282,7 +282,7 @@
        kernstart = trunc_page((vaddr_t)__kernel_text);
        kernend = round_page((vaddr_t)_end);
        kernstart_l2 = L2_TRUNC_BLOCK(kernstart);
-       kernend_l2 = L2_ROUND_BLOCK(kernend + kernend_extra);
+       kernend_l2 = L2_ROUND_BLOCK(kernend);
        kernelvmstart = kernend_l2;
 
 #ifdef MODULAR
@@ -336,14 +336,14 @@
            "physical_start        = 0x%016lx\n"
            "kernel_start_phys     = 0x%016lx\n"
            "kernel_end_phys       = 0x%016lx\n"
+           "pagetables_start_phys = 0x%016lx\n"
+           "pagetables_end_phys   = 0x%016lx\n"
            "msgbuf                = 0x%016lx\n"
            "physical_end          = 0x%016lx\n"
            "VM_MIN_KERNEL_ADDRESS = 0x%016lx\n"
            "kernel_start_l2       = 0x%016lx\n"
            "kernel_start          = 0x%016lx\n"
            "kernel_end            = 0x%016lx\n"
-           "pagetables            = 0x%016lx\n"
-           "pagetables_end        = 0x%016lx\n"
            "kernel_end_l2         = 0x%016lx\n"
 #ifdef MODULAR
            "module_start          = 0x%016lx\n"
@@ -357,14 +357,14 @@
            physical_start,
            kernstart_phys,
            kernend_phys,
+           round_page(kernend_phys),
+           round_page(kernend_phys) + kernend_extra,
            msgbufaddr,
            physical_end,
            VM_MIN_KERNEL_ADDRESS,
            kernstart_l2,
            kernstart,
            kernend,
-           round_page(kernend),
-           round_page(kernend) + kernend_extra,
            kernend_l2,
 #ifdef MODULAR
            module_start,
@@ -550,7 +550,7 @@
 #define IN_RANGE(addr,sta,end) (((sta) <= (addr)) && ((addr) < (end)))
 
        *handled = false;
-       if (IN_RANGE(v, kernstart, kernend + kernend_extra)) {
+       if (IN_RANGE(v, kernstart, kernend)) {
                *handled = true;
                if ((v < data_start) && (prot & VM_PROT_WRITE))
                        return EFAULT;
diff -r 310d8f019f25 -r 5c50b4adf06f sys/arch/aarch64/aarch64/locore.S
--- a/sys/arch/aarch64/aarch64/locore.S Tue Jan 21 10:40:52 2020 +0000
+++ b/sys/arch/aarch64/aarch64/locore.S Tue Jan 21 11:11:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.39.2.4 2019/12/29 09:27:09 martin Exp $   */
+/*     $NetBSD: locore.S,v 1.39.2.5 2020/01/21 11:11:00 martin Exp $   */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -38,7 +38,7 @@
 #include <aarch64/hypervisor.h>
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.39.2.4 2019/12/29 09:27:09 martin Exp $")
+RCSID("$NetBSD: locore.S,v 1.39.2.5 2020/01/21 11:11:00 martin Exp $")
 
 #ifdef AARCH64_DEVICE_MEM_STRONGLY_ORDERED
 #define        MAIR_DEVICE_MEM         MAIR_DEVICE_nGnRnE
@@ -844,7 +844,6 @@
        adr     x1, start                       /* pa = start */
        ADDR    x2, _end
        sub     x2, x2, x1                      /* size = _end - start */
-       add     x2, x2, #BOOTPAGE_ALLOC_MAX     /* for bootpage_alloc() */
        ldr     x0, =start                      /* va */
        bl      pmapboot_enter
        cbnz    x0, init_mmutable_error



Home | Main Index | Thread Index | Old Index