Source-Changes-HG archive

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

[src/trunk]: src/sys/arch support boot option "-1" to disable multiprocessor ...



details:   https://anonhg.NetBSD.org/src/rev/8d380b237eb2
branches:  trunk
changeset: 446226:8d380b237eb2
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Nov 28 09:16:19 2018 +0000

description:
support boot option "-1" to disable multiprocessor boot, and "-z" to set AB_SILENT flag.

diffstat:

 sys/arch/aarch64/aarch64/aarch64_machdep.c |   8 ++++++--
 sys/arch/aarch64/aarch64/cpu.c             |  14 ++++++++++++--
 sys/arch/evbarm/fdt/fdt_machdep.c          |  12 +++++++-----
 3 files changed, 25 insertions(+), 9 deletions(-)

diffs (118 lines):

diff -r d6f42d1a504f -r 8d380b237eb2 sys/arch/aarch64/aarch64/aarch64_machdep.c
--- a/sys/arch/aarch64/aarch64/aarch64_machdep.c        Wed Nov 28 09:14:03 2018 +0000
+++ b/sys/arch/aarch64/aarch64/aarch64_machdep.c        Wed Nov 28 09:16:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.22 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo 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.22 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -389,6 +389,8 @@
 {
        int val;
 
+       if (get_bootconf_option(args, "-1", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+               boothowto |= RB_MD1;
        if (get_bootconf_option(args, "-s", BOOTOPT_TYPE_BOOLEAN, &val) && val)
                boothowto |= RB_SINGLE;
        if (get_bootconf_option(args, "-d", BOOTOPT_TYPE_BOOLEAN, &val) && val)
@@ -401,6 +403,8 @@
                boothowto |= AB_VERBOSE;
        if (get_bootconf_option(args, "-x", BOOTOPT_TYPE_BOOLEAN, &val) && val)
                boothowto |= AB_DEBUG;
+       if (get_bootconf_option(args, "-z", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+               boothowto |= AB_SILENT;
 }
 
 void
diff -r d6f42d1a504f -r 8d380b237eb2 sys/arch/aarch64/aarch64/cpu.c
--- a/sys/arch/aarch64/aarch64/cpu.c    Wed Nov 28 09:14:03 2018 +0000
+++ b/sys/arch/aarch64/aarch64/cpu.c    Wed Nov 28 09:16:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -40,6 +40,7 @@
 #include <sys/device.h>
 #include <sys/cpu.h>
 #include <sys/kmem.h>
+#include <sys/reboot.h>
 #include <sys/sysctl.h>
 
 #include <aarch64/armreg.h>
@@ -109,6 +110,12 @@
                cpu_setup_id(ci);
        } else {
 #ifdef MULTIPROCESSOR
+               if ((boothowto & RB_MD1) != 0) {
+                       aprint_naive("\n");
+                       aprint_normal(": multiprocessor boot disabled\n");
+                       return;
+               }
+
                KASSERT(unit < MAXCPUS);
                ci = &cpu_info_store[unit];
 
@@ -485,6 +492,9 @@
 void
 cpu_boot_secondary_processors(void)
 {
+       if ((boothowto & RB_MD1) != 0)
+               return;
+
        mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
 
        VPRINTF("%s: writing mbox with %#x\n", __func__, arm_cpu_hatched);
diff -r d6f42d1a504f -r 8d380b237eb2 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Wed Nov 28 09:14:03 2018 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Wed Nov 28 09:16:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -545,9 +545,11 @@
        u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, fdt_physmem,
             nfdt_physmem);
 
-       VPRINTF("mpstart\n");
-       if (plat->ap_mpstart)
-               plat->ap_mpstart();
+       if ((boothowto & RB_MD1) == 0) {
+               VPRINTF("mpstart\n");
+               if (plat->ap_mpstart)
+                       plat->ap_mpstart();
+       }
 
        /*
         * Now we have APs started the pages used for stacks and L1PT can



Home | Main Index | Thread Index | Old Index