Print this page
13902 Fix for 13717 may break 8-disk raidz2
13915 installctx() blocking allocate causes problems
Portions contributed by: Jerry Jelinek <gjelinek@gmail.com>
Change-Id: I934d69946cec42630fc541fa8c7385b862b69ca2
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/sun4v/os/cpc_subr.c
+++ new/usr/src/uts/sun4v/os/cpc_subr.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright 2021 Joyent, Inc.
23 24 */
24 25
25 26 /*
26 27 * sun4u common CPC subroutines.
27 28 */
28 29
29 30 #include <sys/types.h>
30 31 #include <sys/time.h>
31 32 #include <sys/atomic.h>
32 33 #include <sys/thread.h>
33 34 #include <sys/regset.h>
34 35 #include <sys/archsystm.h>
35 36 #include <sys/machsystm.h>
36 37 #include <sys/cpc_impl.h>
37 38 #include <sys/cpc_ultra.h>
38 39 #include <sys/sunddi.h>
39 40 #include <sys/intr.h>
40 41 #include <sys/ivintr.h>
41 42 #include <sys/x_call.h>
42 43 #include <sys/cpuvar.h>
43 44 #include <sys/machcpuvar.h>
44 45 #include <sys/cpc_pcbe.h>
45 46 #include <sys/modctl.h>
46 47 #include <sys/sdt.h>
47 48
48 49 uint64_t cpc_level15_inum = 0; /* used in interrupt.s */
49 50 int cpc_has_overflow_intr; /* set in cheetah.c */
50 51
51 52 extern kcpc_ctx_t *kcpc_overflow_intr(caddr_t arg, uint64_t bitmap);
52 53 extern int kcpc_counts_include_idle;
53 54
54 55 /*
55 56 * Called on the boot CPU during startup.
56 57 */
57 58 void
58 59 kcpc_hw_init(void)
59 60 {
60 61 if ((cpc_has_overflow_intr) && (cpc_level15_inum == 0)) {
61 62 cpc_level15_inum = add_softintr(PIL_15,
62 63 kcpc_hw_overflow_intr, NULL, SOFTINT_MT);
63 64 }
64 65
65 66 /*
66 67 * Make sure the boot CPU gets set up.
67 68 */
68 69 kcpc_hw_startup_cpu(CPU->cpu_flags);
69 70 }
70 71
71 72 /*
72 73 * Prepare for CPC interrupts and install an idle thread CPC context.
73 74 */
74 75 void
75 76 kcpc_hw_startup_cpu(ushort_t cpflags)
76 77 {
77 78 cpu_t *cp = CPU;
78 79 kthread_t *t = cp->cpu_idle_thread;
79 80
80 81 ASSERT(t->t_bound_cpu == cp);
81 82
82 83 if (cpc_has_overflow_intr && (cpflags & CPU_FROZEN) == 0) {
83 84 int pstate_save = disable_vec_intr();
84 85
85 86 ASSERT(cpc_level15_inum != 0);
86 87
|
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
87 88 intr_enqueue_req(PIL_15, cpc_level15_inum);
88 89 enable_vec_intr(pstate_save);
89 90 }
90 91
91 92 mutex_init(&cp->cpu_cpc_ctxlock, "cpu_cpc_ctxlock", MUTEX_DEFAULT, 0);
92 93
93 94 if (kcpc_counts_include_idle)
94 95 return;
95 96
96 97 installctx(t, cp, kcpc_idle_save, kcpc_idle_restore, NULL, NULL,
97 - NULL, NULL);
98 + NULL, NULL, NULL);
98 99 }
99 100
100 101 /*
101 102 * Examine the processor and load an appropriate PCBE.
102 103 */
103 104 int
104 105 kcpc_hw_load_pcbe(void)
105 106 {
106 107 char modname[MODMAXNAMELEN+1];
107 108 char *p, *q;
108 109 int len, stat;
109 110 extern char *boot_cpu_compatible_list;
110 111
111 112 for (stat = -1, p = boot_cpu_compatible_list; p != NULL; p = q) {
112 113 /*
113 114 * Get next CPU module name from boot_cpu_compatible_list
114 115 */
115 116 q = strchr(p, ':');
116 117 len = (q) ? (q - p) : strlen(p);
117 118 if (len < sizeof (modname)) {
118 119 (void) strncpy(modname, p, len);
119 120 modname[len] = '\0';
120 121 stat = kcpc_pcbe_tryload(modname, 0, 0, 0);
121 122 if (stat == 0)
122 123 break;
123 124 }
124 125 if (q)
125 126 q++; /* skip over ':' */
126 127 }
127 128 return (stat);
128 129
129 130 }
130 131
131 132 /*ARGSUSED*/
132 133 int
133 134 kcpc_hw_cpu_hook(processorid_t cpuid, ulong_t *kcpc_cpumap)
134 135 {
135 136 return (0);
136 137 }
137 138
138 139 int
139 140 kcpc_hw_lwp_hook(void)
140 141 {
141 142 return (0);
142 143 }
|
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX