4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2016 by Delphix. All rights reserved.
25 */
26
27 #include <sys/machsystm.h>
28 #include <sys/archsystm.h>
29 #include <sys/vm.h>
30 #include <sys/cpu.h>
31 #include <sys/atomic.h>
32 #include <sys/reboot.h>
33 #include <sys/kdi.h>
34 #include <sys/bootconf.h>
35 #include <sys/memlist_plat.h>
36 #include <sys/memlist_impl.h>
37 #include <sys/prom_plat.h>
38 #include <sys/prom_isa.h>
39 #include <sys/autoconf.h>
40 #include <sys/ivintr.h>
41 #include <sys/fpu/fpusystm.h>
42 #include <sys/iommutsb.h>
43 #include <vm/vm_dep.h>
101 * External Data:
102 */
103 extern int vac_size; /* cache size in bytes */
104 extern uint_t vac_mask; /* VAC alignment consistency mask */
105 extern uint_t vac_colors;
106
107 /*
108 * Global Data Definitions:
109 */
110
111 /*
112 * XXX - Don't port this to new architectures
113 * A 3rd party volume manager driver (vxdm) depends on the symbol romp.
114 * 'romp' has no use with a prom with an IEEE 1275 client interface.
115 * The driver doesn't use the value, but it depends on the symbol.
116 */
117 void *romp; /* veritas driver won't load without romp 4154976 */
118 /*
119 * Declare these as initialized data so we can patch them.
120 */
121 pgcnt_t physmem = 0; /* memory size in pages, patch if you want less */
122 pgcnt_t segkpsize =
123 btop(SEGKPDEFSIZE); /* size of segkp segment in pages */
124 uint_t segmap_percent = 6; /* Size of segmap segment */
125
126 int use_cache = 1; /* cache not reliable (605 bugs) with MP */
127 int vac_copyback = 1;
128 char *cache_mode = NULL;
129 int use_mix = 1;
130 int prom_debug = 0;
131
132 caddr_t boot_tba; /* %tba at boot - used by kmdb */
133 uint_t tba_taken_over = 0;
134
135 caddr_t s_text; /* start of kernel text segment */
136 caddr_t e_text; /* end of kernel text segment */
137 caddr_t s_data; /* start of kernel data segment */
138 caddr_t e_data; /* end of kernel data segment */
139
140 caddr_t modtext; /* beginning of module text */
141 size_t modtext_sz; /* size of module text */
142 caddr_t moddata; /* beginning of module data reserve */
143 caddr_t e_moddata; /* end of module data reserve */
144
613 sync_handler(void)
614 {
615 struct panic_trap_info ti;
616 int i;
617
618 /*
619 * Prevent trying to talk to the other CPUs since they are
620 * sitting in the prom and won't reply.
621 */
622 for (i = 0; i < NCPU; i++) {
623 if ((i != CPU->cpu_id) && CPU_XCALL_READY(i)) {
624 cpu[i]->cpu_flags &= ~CPU_READY;
625 cpu[i]->cpu_flags |= CPU_QUIESCED;
626 CPUSET_DEL(cpu_ready_set, cpu[i]->cpu_id);
627 }
628 }
629
630 /*
631 * Force a serial dump, since there are no CPUs to help.
632 */
633 dump_plat_mincpu = 0;
634
635 /*
636 * We've managed to get here without going through the
637 * normal panic code path. Try and save some useful
638 * information.
639 */
640 if (!panicstr && (curthread->t_panic_trap == NULL)) {
641 ti.trap_type = sync_tt;
642 ti.trap_regs = &sync_reg_buf;
643 ti.trap_addr = NULL;
644 ti.trap_mmu_fsr = 0x0;
645
646 curthread->t_panic_trap = &ti;
647 }
648
649 /*
650 * If we're re-entering the panic path, update the signature
651 * block so that the SC knows we're in the second part of panic.
652 */
653 if (panicstr)
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
25 * Copyright (c) 2016 by Delphix. All rights reserved.
26 */
27
28 #include <sys/machsystm.h>
29 #include <sys/archsystm.h>
30 #include <sys/vm.h>
31 #include <sys/cpu.h>
32 #include <sys/atomic.h>
33 #include <sys/reboot.h>
34 #include <sys/kdi.h>
35 #include <sys/bootconf.h>
36 #include <sys/memlist_plat.h>
37 #include <sys/memlist_impl.h>
38 #include <sys/prom_plat.h>
39 #include <sys/prom_isa.h>
40 #include <sys/autoconf.h>
41 #include <sys/ivintr.h>
42 #include <sys/fpu/fpusystm.h>
43 #include <sys/iommutsb.h>
44 #include <vm/vm_dep.h>
102 * External Data:
103 */
104 extern int vac_size; /* cache size in bytes */
105 extern uint_t vac_mask; /* VAC alignment consistency mask */
106 extern uint_t vac_colors;
107
108 /*
109 * Global Data Definitions:
110 */
111
112 /*
113 * XXX - Don't port this to new architectures
114 * A 3rd party volume manager driver (vxdm) depends on the symbol romp.
115 * 'romp' has no use with a prom with an IEEE 1275 client interface.
116 * The driver doesn't use the value, but it depends on the symbol.
117 */
118 void *romp; /* veritas driver won't load without romp 4154976 */
119 /*
120 * Declare these as initialized data so we can patch them.
121 */
122 volatile pgcnt_t physmem = 0; /* memory size in pages, patch if you want less */
123 volatile pgcnt_t segkpsize =
124 btop(SEGKPDEFSIZE); /* size of segkp segment in pages */
125 volatile uint_t segmap_percent = 6; /* Size of segmap segment */
126
127 int use_cache = 1; /* cache not reliable (605 bugs) with MP */
128 int vac_copyback = 1;
129 char *cache_mode = NULL;
130 int use_mix = 1;
131 int prom_debug = 0;
132
133 caddr_t boot_tba; /* %tba at boot - used by kmdb */
134 uint_t tba_taken_over = 0;
135
136 caddr_t s_text; /* start of kernel text segment */
137 caddr_t e_text; /* end of kernel text segment */
138 caddr_t s_data; /* start of kernel data segment */
139 caddr_t e_data; /* end of kernel data segment */
140
141 caddr_t modtext; /* beginning of module text */
142 size_t modtext_sz; /* size of module text */
143 caddr_t moddata; /* beginning of module data reserve */
144 caddr_t e_moddata; /* end of module data reserve */
145
614 sync_handler(void)
615 {
616 struct panic_trap_info ti;
617 int i;
618
619 /*
620 * Prevent trying to talk to the other CPUs since they are
621 * sitting in the prom and won't reply.
622 */
623 for (i = 0; i < NCPU; i++) {
624 if ((i != CPU->cpu_id) && CPU_XCALL_READY(i)) {
625 cpu[i]->cpu_flags &= ~CPU_READY;
626 cpu[i]->cpu_flags |= CPU_QUIESCED;
627 CPUSET_DEL(cpu_ready_set, cpu[i]->cpu_id);
628 }
629 }
630
631 /*
632 * Force a serial dump, since there are no CPUs to help.
633 */
634 dump_ncpu_low = 0;
635
636 /*
637 * We've managed to get here without going through the
638 * normal panic code path. Try and save some useful
639 * information.
640 */
641 if (!panicstr && (curthread->t_panic_trap == NULL)) {
642 ti.trap_type = sync_tt;
643 ti.trap_regs = &sync_reg_buf;
644 ti.trap_addr = NULL;
645 ti.trap_mmu_fsr = 0x0;
646
647 curthread->t_panic_trap = &ti;
648 }
649
650 /*
651 * If we're re-entering the panic path, update the signature
652 * block so that the SC knows we're in the second part of panic.
653 */
654 if (panicstr)
|