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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Support routines for managing per-CPU state.
33 #include <cmd_ecache.h>
44 #include <fm/fmd_api.h>
45 #include <sys/async.h>
46 #include <sys/fm/protocol.h>
49 #include <sys/cheetahregs.h>
50 #include <sys/fm/cpu/UltraSPARC-III.h>
52 #include <cmd_Lxcache.h>
54 #include <sys/niagararegs.h>
55 #include <sys/fm/cpu/UltraSPARC-T1.h>
56 #include <cmd_hc_sun4v.h>
59 #define CMD_CPU_UEC_INCR 10
61 /* Must be in sync with cmd_cpu_type_t */
62 static const char *const cpu_names
[] = {
69 "ultraSPARC-IIIiplus",
78 * This needs to be in sync with cpu_family_t.
80 static const faminfo_t fam_info_tbl
[] = {
81 { CMD_CPU_FAM_UNSUPPORTED
, B_FALSE
},
82 { CMD_CPU_FAM_CHEETAH
, B_TRUE
},
83 { CMD_CPU_FAM_NIAGARA
, B_FALSE
},
84 { CMD_CPU_FAM_SPARC64
, B_FALSE
}
87 static cmd_cpu_t
*cpu_lookup_by_cpuid(uint32_t, uint8_t);
88 static cmd_cpu_t
*cpu_create(fmd_hdl_t
*, nvlist_t
*, uint32_t,
89 uint8_t, cmd_cpu_type_t
);
90 static void cpu_buf_write(fmd_hdl_t
*, cmd_cpu_t
*);
93 cmd_cpu_type2name(fmd_hdl_t
*hdl
, cmd_cpu_type_t type
)
95 if (type
< 1 || type
> sizeof (cpu_names
) / sizeof (char *))
96 fmd_hdl_abort(hdl
, "illegal CPU type %d\n", type
);
98 return (cpu_names
[type
]);
101 static cmd_cpu_type_t
102 cpu_nname2type(fmd_hdl_t
*hdl
, const char *name
, size_t n
)
106 for (i
= 1; i
< sizeof (cpu_names
) / sizeof (char *); i
++) {
107 if (strlen(cpu_names
[i
]) == n
&&
108 strncmp(cpu_names
[i
], name
, n
) == 0)
112 fmd_hdl_abort(hdl
, "illegal CPU name %*.*s\n", n
, n
, name
);
117 const char *fmd_fmri_get_platform();
118 #define is_starcat (strcmp(fmd_fmri_get_platform(), \
119 "SUNW,Sun-Fire-15000") == 0)
120 #define is_serengeti (strcmp(fmd_fmri_get_platform(), \
121 "SUNW,Sun-Fire") == 0)
124 core2cpus(uint32_t core
, cmd_cpu_type_t type
, uint8_t level
,
125 uint32_t *cpuinit
, uint32_t *cpufinal
, uint32_t *cpustep
)
130 #define US4P_SCAT_CPUS_PER_CORE 2
131 #define US4P_SCAT_CPU_CORE_STEP 4
132 #define US4P_SGTI_CPUS_PER_CORE 2
133 #define US4P_SGTI_CPU_CORE_STEP 512
134 #define US4P_DAKC_CPUS_PER_CORE 2
135 #define US4P_DAKC_CPU_CORE_STEP 16
137 case CPU_ULTRASPARC_IVplus
:
139 case CMD_CPU_LEVEL_CORE
:
141 *cpustep
= US4P_SCAT_CPU_CORE_STEP
;
142 else if (is_serengeti
)
143 *cpustep
= US4P_SGTI_CPU_CORE_STEP
;
145 *cpustep
= US4P_DAKC_CPU_CORE_STEP
;
147 *cpufinal
= *cpuinit
+ *cpustep
;
150 *cpuinit
= *cpufinal
= core
;
154 #else /* i.e. sun4v */
156 #define UST1_CPUS_PER_CORE 4
157 #define UST1_CPU_CORE_STEP 1
158 #define UST1_CPUS_PER_CHIP 32
159 #define UST1_CPU_CHIP_STEP 1
160 #define UST2_CPUS_PER_CORE 8
161 #define UST2_CPU_CORE_STEP 1
162 #define UST2_CPUS_PER_CHIP 64
163 #define UST2_CPU_CHIP_STEP 1
165 case CPU_ULTRASPARC_T1
:
167 case CMD_CPU_LEVEL_CORE
:
168 *cpuinit
= core
* UST1_CPUS_PER_CORE
;
169 *cpufinal
= *cpuinit
+ UST1_CPUS_PER_CORE
- 1;
170 *cpustep
= UST1_CPU_CORE_STEP
;
172 case CMD_CPU_LEVEL_CHIP
:
173 *cpuinit
= core
* UST1_CPUS_PER_CHIP
;
174 *cpufinal
= *cpuinit
+ UST1_CPUS_PER_CHIP
- 1;
175 *cpustep
= UST1_CPU_CHIP_STEP
;
178 *cpuinit
= *cpufinal
= core
;
182 case CPU_ULTRASPARC_T2
:
183 case CPU_ULTRASPARC_T2plus
:
185 case CMD_CPU_LEVEL_CORE
:
186 *cpuinit
= core
* UST2_CPUS_PER_CORE
;
187 *cpufinal
= *cpuinit
+ UST2_CPUS_PER_CORE
- 1;
188 *cpustep
= UST2_CPU_CORE_STEP
;
190 case CMD_CPU_LEVEL_CHIP
:
191 *cpuinit
= core
* UST2_CPUS_PER_CHIP
;
192 *cpufinal
= *cpuinit
+ UST2_CPUS_PER_CHIP
- 1;
193 *cpustep
= UST2_CPU_CHIP_STEP
;
196 *cpuinit
= *cpufinal
= core
;
203 *cpuinit
= *cpufinal
= core
;
210 cmd_cpu2core(uint32_t cpuid
, cmd_cpu_type_t type
, uint8_t level
) {
215 #define US4P_SCAT_CORE_SYSBD_STEP 32
217 case CPU_ULTRASPARC_IVplus
:
219 case CMD_CPU_LEVEL_CORE
:
222 US4P_SCAT_CORE_SYSBD_STEP
) *
223 US4P_SCAT_CORE_SYSBD_STEP
+
224 (cpuid
% US4P_SCAT_CPU_CORE_STEP
));
225 else if (is_serengeti
)
226 return (cpuid
% US4P_SGTI_CPU_CORE_STEP
);
228 return (cpuid
% US4P_DAKC_CPU_CORE_STEP
);
232 #else /* i.e. sun4v */
233 case CPU_ULTRASPARC_T1
:
235 case CMD_CPU_LEVEL_CORE
:
236 return (cpuid
/UST1_CPUS_PER_CORE
);
237 case CMD_CPU_LEVEL_CHIP
:
238 return (cpuid
/UST1_CPUS_PER_CHIP
);
242 case CPU_ULTRASPARC_T2
:
243 case CPU_ULTRASPARC_T2plus
:
245 case CMD_CPU_LEVEL_CORE
:
246 return (cpuid
/UST2_CPUS_PER_CORE
);
247 case CMD_CPU_LEVEL_CHIP
:
248 return (cpuid
/UST2_CPUS_PER_CHIP
);
261 cpu_uec_write(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, cmd_cpu_uec_t
*uec
)
264 * The UE cache may change size. fmd expects statically-sized buffers,
265 * so we must delete and re-create it if the size has changed from the
266 * last time it was written.
268 if (fmd_buf_size(hdl
, NULL
, uec
->uec_bufname
) != sizeof (uint64_t) *
270 fmd_buf_destroy(hdl
, NULL
, uec
->uec_bufname
);
272 if (uec
->uec_cache
!= NULL
) {
273 fmd_buf_write(hdl
, NULL
, uec
->uec_bufname
, uec
->uec_cache
,
274 sizeof (uint64_t) * uec
->uec_nent
);
277 cpu_buf_write(hdl
, cpu
);
281 cpu_uec_create(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, cmd_cpu_uec_t
*uec
,
282 const char *fmt
, ...)
287 cmd_vbufname(uec
->uec_bufname
, sizeof (uec
->uec_bufname
), fmt
, ap
);
290 cpu_uec_write(hdl
, cpu
, uec
);
294 cpu_uec_restore(fmd_hdl_t
*hdl
, cmd_cpu_uec_t
*uec
)
296 if (uec
->uec_cache
!= NULL
) {
297 uec
->uec_cache
= cmd_buf_read(hdl
, NULL
, uec
->uec_bufname
,
298 sizeof (uint64_t) * uec
->uec_nent
);
303 cpu_uec_free(fmd_hdl_t
*hdl
, cmd_cpu_uec_t
*uec
, int destroy
)
305 if (uec
->uec_cache
== NULL
)
309 fmd_buf_destroy(hdl
, NULL
, uec
->uec_bufname
);
311 fmd_hdl_free(hdl
, uec
->uec_cache
, sizeof (uint64_t) * uec
->uec_nent
);
315 cpu_uec_flush_finish(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
317 fmd_hdl_debug(hdl
, "completing UE cache flush\n");
318 if (cpu
->cpu_olduec
.uec_cache
!= NULL
) {
319 fmd_hdl_free(hdl
, cpu
->cpu_olduec
.uec_cache
, sizeof (uint64_t) *
320 cpu
->cpu_olduec
.uec_nent
);
322 cpu
->cpu_olduec
.uec_cache
= NULL
;
323 cpu
->cpu_olduec
.uec_nent
= 0;
324 cpu
->cpu_olduec
.uec_flags
= 0;
325 cpu_uec_write(hdl
, cpu
, &cpu
->cpu_olduec
);
328 cpu
->cpu_uec_flush
= 0;
329 cpu_buf_write(hdl
, cpu
);
333 cpu_uec_flush(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
335 if (cpu
->cpu_uec
.uec_cache
== NULL
&& !cpu
->cpu_uec
.uec_flags
)
336 return; /* nothing to flush */
338 fmd_hdl_debug(hdl
, "flushing UE cache for CPU %d\n", cpu
->cpu_cpuid
);
340 if (cmd_ecache_flush(cpu
->cpu_cpuid
) < 0) {
341 fmd_hdl_debug(hdl
, "failed to flush E$ for CPU %d\n",
343 return; /* don't flush the UE cache unless we can flush E$ */
346 if (cpu
->cpu_olduec
.uec_cache
!= NULL
) {
348 * If there's already an old UE cache, we're racing with another
349 * flush. For safety, we'll add the current contents of the
350 * cache to the existing old cache.
352 size_t nent
= cpu
->cpu_olduec
.uec_nent
+ cpu
->cpu_uec
.uec_nent
;
353 uint64_t *new = fmd_hdl_alloc(hdl
, sizeof (uint64_t) * nent
,
356 bcopy(cpu
->cpu_olduec
.uec_cache
, new,
357 sizeof (uint64_t) * cpu
->cpu_olduec
.uec_nent
);
358 bcopy(cpu
->cpu_uec
.uec_cache
, new + cpu
->cpu_olduec
.uec_nent
,
359 sizeof (uint64_t) * cpu
->cpu_uec
.uec_nent
);
361 fmd_hdl_free(hdl
, cpu
->cpu_olduec
.uec_cache
,
362 sizeof (uint64_t) * cpu
->cpu_olduec
.uec_nent
);
363 fmd_hdl_free(hdl
, cpu
->cpu_uec
.uec_cache
,
364 sizeof (uint64_t) * cpu
->cpu_uec
.uec_nent
);
366 cpu
->cpu_olduec
.uec_cache
= new;
367 cpu
->cpu_olduec
.uec_nent
= nent
;
368 cpu
->cpu_olduec
.uec_flags
|= cpu
->cpu_uec
.uec_flags
;
370 cpu
->cpu_olduec
.uec_cache
= cpu
->cpu_uec
.uec_cache
;
371 cpu
->cpu_olduec
.uec_nent
= cpu
->cpu_uec
.uec_nent
;
372 cpu
->cpu_olduec
.uec_flags
= cpu
->cpu_uec
.uec_flags
;
374 cpu_uec_write(hdl
, cpu
, &cpu
->cpu_olduec
);
376 cpu
->cpu_uec
.uec_cache
= NULL
;
377 cpu
->cpu_uec
.uec_nent
= 0;
378 cpu
->cpu_uec
.uec_flags
= 0;
379 cpu_uec_write(hdl
, cpu
, &cpu
->cpu_uec
);
381 if (cpu
->cpu_uec_flush
!= 0)
382 fmd_timer_remove(hdl
, cpu
->cpu_uec_flush
);
384 cpu
->cpu_uec_flush
= fmd_timer_install(hdl
,
385 (void *)CMD_TIMERTYPE_CPU_UEC_FLUSH
, NULL
, NANOSEC
);
386 cpu_buf_write(hdl
, cpu
);
390 cmd_cpu_uec_add(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, uint64_t pa
)
392 cmd_cpu_uec_t
*uec
= &cpu
->cpu_uec
;
393 uint64_t *new, *tgt
= NULL
;
396 pa
= pa
& cmd
.cmd_pagemask
;
398 fmd_hdl_debug(hdl
, "adding 0x%llx to CPU %d's UE cache\n",
399 (u_longlong_t
)pa
, cpu
->cpu_cpuid
);
401 if (uec
->uec_cache
!= NULL
) {
402 for (tgt
= NULL
, i
= 0; i
< uec
->uec_nent
; i
++) {
403 if (tgt
== NULL
&& uec
->uec_cache
[i
] == 0)
404 tgt
= &uec
->uec_cache
[i
];
406 if (uec
->uec_cache
[i
] == pa
)
407 return; /* already there */
412 /* no space - resize the cache */
413 new = fmd_hdl_zalloc(hdl
, sizeof (uint64_t) *
414 (uec
->uec_nent
+ CMD_CPU_UEC_INCR
), FMD_SLEEP
);
416 if (uec
->uec_cache
!= NULL
) {
417 bcopy(uec
->uec_cache
, new, sizeof (uint64_t) *
419 fmd_hdl_free(hdl
, uec
->uec_cache
, sizeof (uint64_t) *
423 uec
->uec_cache
= new;
424 tgt
= &uec
->uec_cache
[uec
->uec_nent
];
425 uec
->uec_nent
+= CMD_CPU_UEC_INCR
;
429 cpu_uec_write(hdl
, cpu
, uec
);
433 cmd_cpu_uec_set_allmatch(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
435 fmd_hdl_debug(hdl
, "setting cpu %d's uec to allmatch\n",
438 cpu
->cpu_uec
.uec_flags
|= CPU_UEC_F_ALLMATCH
;
439 cpu_uec_write(hdl
, cpu
, &cpu
->cpu_uec
);
441 if (++cpu
->cpu_uec_nflushes
<= CPU_UEC_FLUSH_MAX
)
442 cpu_uec_flush(hdl
, cpu
);
446 cmd_cpu_uec_match(cmd_cpu_t
*cpu
, uint64_t pa
)
451 * The UE cache works as long as we are able to add an entry for every
452 * UE seen by a given CPU. If we see a UE with a non-valid AFAR, we
453 * can't guarantee our ability to filter a corresponding xxU, and must,
454 * for safety, assume that every subsequent xxU (until the E$ and UE
455 * cache are flushed) has a matching UE.
457 if ((cpu
->cpu_uec
.uec_flags
& CPU_UEC_F_ALLMATCH
) ||
458 (cpu
->cpu_olduec
.uec_flags
& CPU_UEC_F_ALLMATCH
))
461 pa
= pa
& cmd
.cmd_pagemask
;
463 for (i
= 0; i
< cpu
->cpu_uec
.uec_nent
; i
++) {
464 if (cpu
->cpu_uec
.uec_cache
[i
] == pa
)
468 for (i
= 0; i
< cpu
->cpu_olduec
.uec_nent
; i
++) {
469 if (cpu
->cpu_olduec
.uec_cache
[i
] == pa
)
478 cmd_xr_write(fmd_hdl_t
*hdl
, cmd_xr_t
*xr
)
480 fmd_hdl_debug(hdl
, "writing redelivery clcode %llx for case %s\n",
481 xr
->xr_clcode
, fmd_case_uuid(hdl
, xr
->xr_case
));
483 fmd_buf_write(hdl
, xr
->xr_case
, "redelivery", xr
,
487 static cmd_xr_hdlr_f
*
488 cmd_xr_id2hdlr(fmd_hdl_t
*hdl
, uint_t id
)
491 case CMD_XR_HDLR_XXC
:
492 return (cmd_xxc_resolve
);
493 case CMD_XR_HDLR_XXU
:
494 return (cmd_xxu_resolve
);
495 case CMD_XR_HDLR_NOP
:
496 return (cmd_nop_resolve
);
498 fmd_hdl_abort(hdl
, "cmd_xr_id2hdlr called with bad hdlrid %x\n",
506 cmd_xr_create(fmd_hdl_t
*hdl
, fmd_event_t
*ep
, nvlist_t
*nvl
,
507 cmd_cpu_t
*cpu
, cmd_errcl_t clcode
)
509 cmd_xr_t
*xr
= fmd_hdl_zalloc(hdl
, sizeof (cmd_xr_t
),
511 nvlist_t
*rsrc
= NULL
;
515 err
|= nvlist_lookup_uint64(nvl
, FM_EREPORT_ENA
, &xr
->xr_ena
);
517 err
|= cmd_xr_fill(hdl
, nvl
, xr
, clcode
);
519 err
|= cmd_xr_pn_cache_fill(hdl
, nvl
, xr
, cpu
, clcode
);
521 (void) nvlist_lookup_nvlist(nvl
, FM_EREPORT_PAYLOAD_NAME_RESOURCE
,
525 fmd_hdl_free(hdl
, xr
, sizeof (cmd_xr_t
));
530 xr
->xr_cpuid
= cpu
->cpu_cpuid
;
531 xr
->xr_clcode
= clcode
;
532 xr
->xr_case
= cmd_case_create(hdl
, &cpu
->cpu_header
,
533 CMD_PTR_CPU_XR_RETRY
, &uuid
);
534 fmd_case_setprincipal(hdl
, xr
->xr_case
, ep
);
537 cmd_fmri_init(hdl
, &xr
->xr_rsrc
, rsrc
, "%s_rsrc",
538 fmd_case_uuid(hdl
, xr
->xr_case
));
541 cmd_xr_write(hdl
, xr
);
546 cmd_xr_reschedule(fmd_hdl_t
*hdl
, cmd_xr_t
*xr
, uint_t hdlrid
)
549 fmd_hdl_debug(hdl
, "scheduling redelivery of %llx with xr %p\n",
552 xr
->xr_hdlrid
= hdlrid
;
553 xr
->xr_hdlr
= cmd_xr_id2hdlr(hdl
, hdlrid
);
555 xr
->xr_id
= fmd_timer_install(hdl
, (void *)CMD_TIMERTYPE_CPU_XR_WAITER
,
556 NULL
, cmd
.cmd_xxcu_trdelay
);
558 if (xr
->xr_ref
++ == 0)
559 cmd_list_append(&cmd
.cmd_xxcu_redelivs
, xr
);
561 cmd_xr_write(hdl
, xr
);
566 cmd_xr_destroy(fmd_hdl_t
*hdl
, cmd_xr_t
*xr
)
568 fmd_hdl_debug(hdl
, "destroying xr (clcode %llx) at %p\n",
571 fmd_case_reset(hdl
, xr
->xr_case
);
572 cmd_case_fini(hdl
, xr
->xr_case
, FMD_B_TRUE
);
574 if (xr
->xr_rsrc_nvl
!= NULL
)
575 cmd_fmri_fini(hdl
, &xr
->xr_rsrc
, FMD_B_TRUE
);
577 fmd_buf_destroy(hdl
, xr
->xr_case
, "redelivery");
578 fmd_hdl_free(hdl
, xr
, sizeof (cmd_xr_t
));
582 cmd_xr_deref(fmd_hdl_t
*hdl
, cmd_xr_t
*xr
)
585 fmd_hdl_abort(hdl
, "attempt to deref xr with zero ref\n");
587 fmd_hdl_debug(hdl
, "deref xr %p [%d]\n", xr
, xr
->xr_ref
);
589 if (--xr
->xr_ref
== 0) {
590 cmd_list_delete(&cmd
.cmd_xxcu_redelivs
, xr
);
591 cmd_xr_destroy(hdl
, xr
);
596 cmd_xr_restore(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, fmd_case_t
*cp
)
600 if ((xr
= cmd_buf_read(hdl
, cp
, "redelivery", sizeof (cmd_xr_t
))) ==
602 fmd_hdl_abort(hdl
, "failed to find redelivery for case %s\n",
603 fmd_case_uuid(hdl
, cp
));
607 xr
->xr_hdlr
= cmd_xr_id2hdlr(hdl
, xr
->xr_hdlrid
);
608 if (xr
->xr_rsrc_nvl
!= NULL
)
609 cmd_fmri_restore(hdl
, &xr
->xr_rsrc
);
613 * fmd is still in the process of starting up. If we reschedule this
614 * event with the normal redelivery timeout, it'll get redelivered
615 * before initialization has completed, we'll potentially fail to
616 * match the train, deref() the waiter (causing any subsequent side-
617 * effects to miss the waiter), and use this ereport to blame the CPU.
618 * The other side-effects will blame the CPU too, since we'll have
619 * deref()'d the waiter out of existence. We can get up to three
620 * additions to the SERD engine this way, which is bad. To keep that
621 * from happening, we're going to schedule an arbitrarily long timeout,
622 * which *should* be long enough. It's pretty bad, but there's no
623 * real way to keep the other side-effects from taking out the CPU.
625 xr
->xr_id
= fmd_timer_install(hdl
, (void *)CMD_TIMERTYPE_CPU_XR_WAITER
,
626 NULL
, fmd_prop_get_int64(hdl
, "xxcu_restart_delay"));
628 cmd_list_append(&cmd
.cmd_xxcu_redelivs
, xr
);
630 fmd_hdl_debug(hdl
, "revived xr for class %llx\n", xr
->xr_clcode
);
633 typedef struct cmd_xxcu_train
{
634 cmd_errcl_t tr_mask
; /* errors we must see to match this train */
635 cmd_errcl_t tr_cause
; /* the error at the root of this train */
638 #define CMD_TRAIN(cause, side_effects) { (cause) | (side_effects), (cause) }
640 static const cmd_xxcu_train_t cmd_xxcu_trains
[] = {
643 CMD_TRAIN(CMD_ERRCL_UCC
, CMD_ERRCL_WDC
),
645 /* UCU: WDU, WDU+L3_WDU */
646 CMD_TRAIN(CMD_ERRCL_UCU
, CMD_ERRCL_WDU
),
647 CMD_TRAIN(CMD_ERRCL_UCU
, CMD_ERRCL_L3_WDU
| CMD_ERRCL_WDU
),
650 CMD_TRAIN(CMD_ERRCL_EDC
, CMD_ERRCL_WDC
),
652 /* EDU: WDU, WDU+L3_WDU */
653 CMD_TRAIN(CMD_ERRCL_EDU_ST
, CMD_ERRCL_WDU
),
654 CMD_TRAIN(CMD_ERRCL_EDU_BL
, CMD_ERRCL_WDU
),
655 CMD_TRAIN(CMD_ERRCL_EDU_ST
, CMD_ERRCL_L3_WDU
| CMD_ERRCL_WDU
),
656 CMD_TRAIN(CMD_ERRCL_EDU_BL
, CMD_ERRCL_L3_WDU
| CMD_ERRCL_WDU
),
658 /* CPC: WDC, EDC+WDC, UCC+WDC, EDC+UCC+WDC */
659 CMD_TRAIN(CMD_ERRCL_CP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ERRCL_LDSU
, CMD_ERRCL_WBUE
),
1270 CMD_TRAIN(CMD_ERRCL_LDSU
, CMD_ERRCL_DCDP
),
1271 CMD_TRAIN(CMD_ERRCL_SBDLC
, CMD_ERRCL_SBDPC
),
1272 CMD_TRAIN(CMD_ERRCL_TCCP
, CMD_ERRCL_TCCD
),
1273 CMD_TRAIN(CMD_ERRCL_TCCD
, CMD_ERRCL_TCCD
),
1274 CMD_TRAIN(CMD_ERRCL_DBU
, CMD_ERRCL_DCDP
),
1275 CMD_TRAIN(CMD_ERRCL_DBU
, CMD_ERRCL_ICDP
),
1276 CMD_TRAIN(CMD_ERRCL_FBU
, CMD_ERRCL_DCDP
),
1277 CMD_TRAIN(CMD_ERRCL_FBU
, CMD_ERRCL_ICDP
),
1278 CMD_TRAIN(CMD_ERRCL_DAU
, CMD_ERRCL_DCDP
),
1279 CMD_TRAIN(CMD_ERRCL_DAU
, CMD_ERRCL_ICDP
),
1281 * sun4v also has the following trains, but the train
1282 * algorithm does an exhaustive search and compare
1283 * all pairs in the train mask, so we don't need
1284 * to define these trains
1285 * dl2nd->ldwu (wbue), dcdp
1286 * il2nd->ldwu (wbue), icdp
1287 * dxl2u->ldwu (wbue), dcdp
1288 * ixl2u->ldwu (wbue), icdp
1290 CMD_TRAIN(CMD_ERRCL_DL2ND
, CMD_ERRCL_DCDP
),
1291 CMD_TRAIN(CMD_ERRCL_DL2ND
, CMD_ERRCL_LDWU
),
1292 CMD_TRAIN(CMD_ERRCL_DL2ND
, CMD_ERRCL_WBUE
),
1293 CMD_TRAIN(CMD_ERRCL_IL2ND
, CMD_ERRCL_ICDP
),
1294 CMD_TRAIN(CMD_ERRCL_IL2ND
, CMD_ERRCL_LDWU
),
1295 CMD_TRAIN(CMD_ERRCL_IL2ND
, CMD_ERRCL_WBUE
),
1296 CMD_TRAIN(CMD_ERRCL_L2ND
, CMD_ERRCL_LDWU
),
1297 CMD_TRAIN(CMD_ERRCL_L2ND
, CMD_ERRCL_WBUE
),
1298 CMD_TRAIN(CMD_ERRCL_DL2U
, CMD_ERRCL_DCDP
),
1299 CMD_TRAIN(CMD_ERRCL_DL2U
, CMD_ERRCL_LDWU
),
1300 CMD_TRAIN(CMD_ERRCL_DL2U
, CMD_ERRCL_WBUE
),
1301 CMD_TRAIN(CMD_ERRCL_IL2U
, CMD_ERRCL_ICDP
),
1302 CMD_TRAIN(CMD_ERRCL_IL2U
, CMD_ERRCL_LDWU
),
1303 CMD_TRAIN(CMD_ERRCL_IL2U
, CMD_ERRCL_WBUE
),
1309 cmd_xxcu_train_match(cmd_errcl_t mask
)
1313 for (i
= 0; cmd_xxcu_trains
[i
].tr_mask
!= 0; i
++) {
1314 if (cmd_xxcu_trains
[i
].tr_mask
== mask
)
1315 return (cmd_xxcu_trains
[i
].tr_cause
);
1322 cmd_trw_alloc(uint64_t ena
, uint64_t afar
)
1326 for (i
= 0; i
< cmd
.cmd_xxcu_ntrw
; i
++) {
1327 cmd_xxcu_trw_t
*trw
= &cmd
.cmd_xxcu_trw
[i
];
1328 if (trw
->trw_ena
== NULL
) {
1330 trw
->trw_afar
= afar
;
1339 cmd_trw_write(fmd_hdl_t
*hdl
)
1341 fmd_buf_write(hdl
, NULL
, "waiters", cmd
.cmd_xxcu_trw
,
1342 cmd
.cmd_xxcu_ntrw
* sizeof (cmd_xxcu_trw_t
));
1347 cmd_trw_ref(fmd_hdl_t
*hdl
, cmd_xxcu_trw_t
*trw
, cmd_errcl_t clcode
)
1350 trw
->trw_mask
|= clcode
;
1355 cmd_trw_deref(fmd_hdl_t
*hdl
, cmd_xxcu_trw_t
*trw
)
1357 if (trw
->trw_ref
== 0)
1358 fmd_hdl_abort(hdl
, "attempt to deref trw with zero ref\n");
1360 if (--trw
->trw_ref
== 0)
1361 bzero(trw
, sizeof (cmd_xxcu_trw_t
));
1367 cmd_trw_restore(fmd_hdl_t
*hdl
)
1369 size_t sz
= fmd_buf_size(hdl
, NULL
, "waiters");
1370 if (sz
== cmd
.cmd_xxcu_ntrw
* sizeof (cmd_xxcu_trw_t
)) {
1372 * Previous size == current size. In absence of
1373 * versioning, assume that the structure and # of elements
1376 fmd_buf_read(hdl
, NULL
, "waiters", cmd
.cmd_xxcu_trw
,
1377 cmd
.cmd_xxcu_ntrw
* sizeof (cmd_xxcu_trw_t
));
1380 * Previous size != current size. Something has changed;
1381 * hence we cannot rely on the contents of this buffer.
1382 * Delete the buffer and start fresh.
1384 fmd_buf_destroy(hdl
, NULL
, "waiters");
1385 fmd_buf_write(hdl
, NULL
, "waiters", cmd
.cmd_xxcu_trw
,
1386 cmd
.cmd_xxcu_ntrw
* sizeof (cmd_xxcu_trw_t
));
1391 cmd_cpu_serdnm_create(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, const char *serdbase
)
1396 if (cpu
->cpu_level
== CMD_CPU_LEVEL_THREAD
) {
1397 fmt
= "cpu_%d_%s_serd";
1398 sz
= snprintf(NULL
, 0, fmt
, cpu
->cpu_cpuid
, serdbase
) + 1;
1399 nm
= fmd_hdl_alloc(hdl
, sz
, FMD_SLEEP
);
1400 (void) snprintf(nm
, sz
, fmt
, cpu
->cpu_cpuid
, serdbase
);
1402 fmt
= "cpu_%d_%d_%s_serd";
1403 sz
= snprintf(NULL
, 0, fmt
, cpu
->cpu_cpuid
, cpu
->cpu_level
,
1405 nm
= fmd_hdl_alloc(hdl
, sz
, FMD_SLEEP
);
1406 (void) snprintf(nm
, sz
, fmt
, cpu
->cpu_cpuid
, cpu
->cpu_level
,
1414 * cmd_cpu_create_faultlist is a combination of the former cmd_cpu_create_fault
1415 * and fmd_case_add_suspect. If a 'cpu' structure represents a set of threads
1416 * (level > CMD_CPU_LEVEL_THREAD), then we must add multiple faults to
1417 * this case, under loop control. Use call to cmd_cpu_create_faultlist to
1418 * replace the sequence
1420 * flt = cmd_cpu_create_fault(...);
1421 * fmd_case_add_suspect(hdl, cc->cp, flt);
1425 cmd_cpu_create_faultlist(fmd_hdl_t
*hdl
, fmd_case_t
*casep
, cmd_cpu_t
*cpu
,
1426 const char *type
, nvlist_t
*rsrc
, uint_t cert
)
1429 uint32_t cpuinit
, cpufinal
, cpustep
, i
;
1436 (void) snprintf(fltnm
, sizeof (fltnm
), "fault.cpu.%s.%s",
1437 cmd_cpu_type2name(hdl
, cpu
->cpu_type
), type
);
1439 cpu
->cpu_faulting
= FMD_B_TRUE
;
1440 cpu_buf_write(hdl
, cpu
);
1443 loc
= cmd_getfru_loc(hdl
, cpu
->cpu_asru_nvl
);
1446 * Add motherboard fault to t5440 lfu suspect.list.
1448 if ((strstr(loc
, CPUBOARD
) != NULL
) && (strstr(fltnm
, "lfu") != NULL
)) {
1449 /* get mb fmri from libtopo */
1450 mb_rsrc
= init_mb(hdl
);
1451 if (mb_rsrc
!= NULL
) {
1452 fmd_hdl_debug(hdl
, "cmd_cpu: create MB fault\n");
1453 cert
= BK_LFUFAULT_CERT
;
1454 flt
= cmd_boardfru_create_fault(hdl
, mb_rsrc
, fltnm
,
1456 fmd_case_add_suspect(hdl
, casep
, flt
);
1457 nvlist_free(mb_rsrc
);
1462 if (cpu
->cpu_level
> CMD_CPU_LEVEL_THREAD
) {
1463 core2cpus(cpu
->cpu_cpuid
, cpu
->cpu_type
, cpu
->cpu_level
,
1464 &cpuinit
, &cpufinal
, &cpustep
);
1465 for (i
= cpuinit
; i
<= cpufinal
; i
+= cpustep
) {
1466 cmd_cpu_t
*cpui
= cpu_lookup_by_cpuid(i
,
1467 CMD_CPU_LEVEL_THREAD
);
1470 if (nvlist_dup(cpu
->cpu_asru_nvl
,
1472 fmd_hdl_abort(hdl
, "unable to alloc"
1473 "ASRU for thread in core\n");
1475 (void) nvlist_remove_all(asru
,
1477 if (nvlist_add_uint32(asru
,
1478 FM_FMRI_CPU_ID
, i
) != 0) {
1480 "unable to create thread struct\n");
1482 cpui
= cpu_create(hdl
, asru
, i
,
1483 CMD_CPU_LEVEL_THREAD
, cpu
->cpu_type
);
1486 if (!fmd_nvl_fmri_present(hdl
, cpui
->cpu_asru_nvl
))
1488 cpui
->cpu_faulting
= FMD_B_TRUE
;
1489 cpu_buf_write(hdl
, cpui
);
1490 flt
= cmd_nvl_create_fault(hdl
, fltnm
, cert
,
1491 cpui
->cpu_asru_nvl
, cpu
->cpu_fru_nvl
, rsrc
);
1493 flt
= cmd_fault_add_location(hdl
, flt
, loc
);
1495 fmd_case_add_suspect(hdl
, casep
, flt
);
1498 flt
= cmd_nvl_create_fault(hdl
, fltnm
, cert
,
1499 cpu
->cpu_asru_nvl
, cpu
->cpu_fru_nvl
, rsrc
);
1501 flt
= cmd_fault_add_location(hdl
, flt
, loc
);
1504 fmd_case_add_suspect(hdl
, casep
, flt
);
1508 fmd_hdl_strfree(hdl
, loc
);
1513 cmd_cpu_free(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, int destroy
)
1517 cmd_Lxcache_t
*Lxcache
;
1520 for (i
= 0; i
< sizeof (cmd_cpu_cases_t
) / sizeof (cmd_case_t
); i
++) {
1521 cmd_case_t
*cc
= &(((cmd_case_t
*)&cpu
->cpu_cases
)[i
]);
1523 if (cc
->cc_cp
!= NULL
) {
1524 cmd_case_fini(hdl
, cc
->cc_cp
, destroy
);
1525 if (cc
->cc_serdnm
!= NULL
) {
1526 if (fmd_serd_exists(hdl
, cc
->cc_serdnm
) &&
1528 fmd_serd_destroy(hdl
, cc
->cc_serdnm
);
1529 fmd_hdl_strfree(hdl
, cc
->cc_serdnm
);
1536 * free Lxcache also.
1539 for (Lxcache
= cmd_list_next(&cpu
->cpu_Lxcaches
); Lxcache
!= NULL
;
1540 Lxcache
= cmd_list_next(&cpu
->cpu_Lxcaches
)) {
1541 (void) cmd_Lxcache_free(hdl
, cpu
, Lxcache
, destroy
);
1543 cpu_uec_free(hdl
, &cpu
->cpu_uec
, destroy
);
1544 cpu_uec_free(hdl
, &cpu
->cpu_olduec
, destroy
);
1547 cmd_fmri_fini(hdl
, &cpu
->cpu_asru
, destroy
);
1548 cmd_fmri_fini(hdl
, &cpu
->cpu_fru
, destroy
);
1550 cmd_list_delete(&cmd
.cmd_cpus
, cpu
);
1553 fmd_buf_destroy(hdl
, NULL
, cpu
->cpu_bufname
);
1554 fmd_hdl_free(hdl
, cpu
, sizeof (cmd_cpu_t
));
1558 cmd_cpu_destroy(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
1560 cmd_cpu_free(hdl
, cpu
, FMD_B_TRUE
);
1564 cpu_lookup_by_cpuid(uint32_t cpuid
, uint8_t level
)
1568 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
;
1569 cpu
= cmd_list_next(cpu
)) {
1570 if ((cpu
->cpu_cpuid
== cpuid
) &&
1571 (cpu
->cpu_level
== level
))
1579 cpu_getfru(fmd_hdl_t
*hdl
, cmd_cpu_t
*cp
)
1581 char *frustr
, *partstr
, *serialstr
;
1584 if ((frustr
= cmd_cpu_getfrustr(hdl
, cp
)) == NULL
) {
1587 partstr
= cmd_cpu_getpartstr(hdl
, cp
);
1588 serialstr
= cmd_cpu_getserialstr(hdl
, cp
);
1589 nvlp
= cmd_cpu_mkfru(hdl
, frustr
, serialstr
, partstr
);
1590 fmd_hdl_strfree(hdl
, frustr
);
1591 fmd_hdl_strfree(hdl
, partstr
);
1592 fmd_hdl_strfree(hdl
, serialstr
);
1598 cpu_buf_write(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
1600 if (fmd_buf_size(hdl
, NULL
, cpu
->cpu_bufname
) !=
1601 sizeof (cmd_cpu_pers_t
))
1602 fmd_buf_destroy(hdl
, NULL
, cpu
->cpu_bufname
);
1604 fmd_buf_write(hdl
, NULL
, cpu
->cpu_bufname
, &cpu
->cpu_pers
,
1605 sizeof (cmd_cpu_pers_t
));
1609 cpu_buf_create(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
1614 * We need to be tolerant of leaked CPU buffers, as their effects can
1615 * be severe. Consider the following scenario: we create a version 0
1616 * cmd_cpu_t in response to some error, commit it to a persistent
1617 * buffer, and then leak it. We then upgrade, and restart the DE using
1618 * version 1 cmd_cpu_t's. Another error comes along, for the same CPU
1619 * whose struct was leaked. Not knowing about the leaked buffer, we
1620 * create a new cmd_cpu_t for that CPU, and create a buffer for it. As
1621 * the v1 cmd_cpu_t is smaller than the v0 cmd_cpu_t, fmd will use the
1622 * pre-existing (leaked) buffer. We'll therefore have an x-byte, v1
1623 * cmd_cpu_t in a y-byte buffer, where y > x. Upon the next DE restart,
1624 * we'll attempt to restore the cmd_cpu_t, but will do version
1625 * validation using the size of the buffer (y). This won't match what
1626 * we're expecting (x), and the DE will abort.
1628 * To protect against such a scenario, we're going to check for and
1629 * remove the pre-existing cmd_cpu_t for this CPU, if one exists. While
1630 * this won't fix the leak, it'll allow us to continue functioning
1631 * properly in spite of it.
1633 if ((sz
= fmd_buf_size(hdl
, NULL
, cpu
->cpu_bufname
)) != 0 &&
1634 sz
!= sizeof (cmd_cpu_pers_t
)) {
1635 fmd_hdl_debug(hdl
, "removing unexpected pre-existing cpu "
1636 "buffer %s (size %u bytes)\n", cpu
->cpu_bufname
, sz
);
1637 fmd_buf_destroy(hdl
, NULL
, cpu
->cpu_bufname
);
1640 cpu_buf_write(hdl
, cpu
);
1644 cpu_create(fmd_hdl_t
*hdl
, nvlist_t
*asru
, uint32_t cpuid
, uint8_t level
,
1645 cmd_cpu_type_t type
)
1651 * No CPU state matches the CPU described in the ereport. Create a new
1652 * one, add it to the list, and pass it back.
1654 fmd_hdl_debug(hdl
, "cpu_lookup: creating new cpuid %u\n", cpuid
);
1655 CMD_STAT_BUMP(cpu_creat
);
1657 cpu
= fmd_hdl_zalloc(hdl
, sizeof (cmd_cpu_t
), FMD_SLEEP
);
1658 cpu
->cpu_nodetype
= CMD_NT_CPU
;
1659 cpu
->cpu_cpuid
= cpuid
;
1660 cpu
->cpu_level
= level
;
1661 cpu
->cpu_type
= type
;
1662 cpu
->cpu_version
= CMD_CPU_VERSION
;
1664 if (cpu
->cpu_level
== CMD_CPU_LEVEL_THREAD
) {
1665 cmd_bufname(cpu
->cpu_bufname
, sizeof (cpu
->cpu_bufname
),
1666 "cpu_%d", cpu
->cpu_cpuid
);
1668 cmd_bufname(cpu
->cpu_bufname
, sizeof (cpu
->cpu_bufname
),
1669 "cpu_%d_%d", cpu
->cpu_cpuid
, cpu
->cpu_level
);
1673 cpu_uec_create(hdl
, cpu
, &cpu
->cpu_uec
, "cpu_uec_%d", cpu
->cpu_cpuid
);
1674 cpu_uec_create(hdl
, cpu
, &cpu
->cpu_olduec
, "cpu_olduec_%d",
1678 if (cpu
->cpu_level
== CMD_CPU_LEVEL_THREAD
) {
1679 cmd_fmri_init(hdl
, &cpu
->cpu_asru
, asru
, "cpu_asru_%d",
1682 cmd_fmri_init(hdl
, &cpu
->cpu_asru
, asru
, "cpu_asru_%d_%d",
1683 cpu
->cpu_cpuid
, cpu
->cpu_level
);
1686 if ((fru
= cpu_getfru(hdl
, cpu
)) != NULL
) {
1687 if (cpu
->cpu_level
== CMD_CPU_LEVEL_THREAD
) {
1688 cmd_fmri_init(hdl
, &cpu
->cpu_fru
, fru
, "cpu_fru_%d",
1691 cmd_fmri_init(hdl
, &cpu
->cpu_fru
, fru
, "cpu_fru_%d_%d",
1692 cpu
->cpu_cpuid
, cpu
->cpu_level
);
1696 if (cpu
->cpu_level
== CMD_CPU_LEVEL_THREAD
) {
1697 cmd_fmri_init(hdl
, &cpu
->cpu_fru
, asru
, "cpu_fru_%d",
1700 cmd_fmri_init(hdl
, &cpu
->cpu_fru
, asru
, "cpu_fru_%d_%d",
1701 cpu
->cpu_cpuid
, cpu
->cpu_level
);
1705 cpu_buf_create(hdl
, cpu
);
1707 cmd_list_append(&cmd
.cmd_cpus
, cpu
);
1713 * As its name implies, 'cpu_all_threads_invalid' determines if all cpu
1714 * threads (level 0) contained within the cpu structure are invalid.
1715 * This is done by checking all the (level 0) threads which may be
1716 * contained within this chip, core, or thread; if all are invalid, return
1717 * FMD_B_TRUE; if any are valid, return FMD_B_FALSE.
1721 cpu_all_threads_invalid(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
1724 uint32_t cpuinit
, cpufinal
, cpustep
, i
;
1726 core2cpus(cpu
->cpu_cpuid
, cpu
->cpu_type
, cpu
->cpu_level
,
1727 &cpuinit
, &cpufinal
, &cpustep
);
1729 if (cpuinit
== cpufinal
) {
1730 if (fmd_nvl_fmri_present(hdl
, cpu
->cpu_asru_nvl
) &&
1731 !fmd_nvl_fmri_unusable(hdl
, cpu
->cpu_asru_nvl
))
1732 return (FMD_B_FALSE
);
1733 else return (FMD_B_TRUE
);
1736 if (nvlist_dup(cpu
->cpu_asru_nvl
, &asru
, 0) != 0)
1737 fmd_hdl_abort(hdl
, "cannot copy asru\n");
1738 for (i
= cpuinit
; i
<= cpufinal
; i
+= cpustep
) {
1739 (void) nvlist_remove_all(asru
, FM_FMRI_CPU_ID
);
1740 if (nvlist_add_uint32(asru
, FM_FMRI_CPU_ID
, i
) != 0) {
1741 fmd_hdl_abort(hdl
, "cpu_all_threads_invalid: ",
1742 "cannot add thread %d to asru\n", i
);
1744 if (fmd_nvl_fmri_present(hdl
, asru
) &&
1745 !fmd_nvl_fmri_unusable(hdl
, asru
)) {
1747 return (FMD_B_FALSE
);
1752 return (FMD_B_TRUE
);
1756 * Locate the state structure for this CPU, creating a new one if one doesn't
1757 * already exist. Before passing it back, we also need to validate it against
1758 * the current state of the world, checking to ensure that the CPU described by
1759 * the ereport, the CPU indicated in the cmd_cpu_t, and the CPU currently
1760 * residing at the indicated cpuid are the same. We do this by comparing the
1761 * serial IDs from the three entities.
1764 cmd_cpu_lookup(fmd_hdl_t
*hdl
, nvlist_t
*asru
, const char *class,
1769 const char *scheme
, *cpuname
;
1773 if (fmd_nvl_fmri_expand(hdl
, asru
) < 0) {
1774 CMD_STAT_BUMP(bad_cpu_asru
);
1778 if (nvlist_lookup_pairs(asru
, 0,
1779 FM_VERSION
, DATA_TYPE_UINT8
, &vers
,
1780 FM_FMRI_SCHEME
, DATA_TYPE_STRING
, &scheme
,
1781 FM_FMRI_CPU_ID
, DATA_TYPE_UINT32
, &cpuid
,
1782 NULL
) != 0 || (vers
!= CPU_SCHEME_VERSION0
&&
1783 vers
!= CPU_SCHEME_VERSION1
) ||
1784 strcmp(scheme
, FM_FMRI_SCHEME_CPU
) != 0) {
1785 CMD_STAT_BUMP(bad_cpu_asru
);
1790 * 'cpuid' at this point refers to a thread, because it
1791 * was extracted from a detector FMRI
1794 cpuname
= class + sizeof ("ereport.cpu");
1795 ct
= cpu_nname2type(hdl
, cpuname
,
1796 (size_t)(strchr(cpuname
, '.') - cpuname
));
1798 cpu
= cpu_lookup_by_cpuid(cmd_cpu2core(cpuid
, ct
, level
), level
);
1801 cpu_all_threads_invalid(hdl
, cpu
) == FMD_B_TRUE
) {
1802 fmd_hdl_debug(hdl
, "cpu_lookup: discarding old state\n");
1803 cmd_cpu_destroy(hdl
, cpu
);
1808 * Check to see if the CPU described by the ereport has been removed
1809 * from the system. If it has, return to the caller without a CPU.
1811 if (!fmd_nvl_fmri_present(hdl
, asru
) ||
1812 fmd_nvl_fmri_unusable(hdl
, asru
)) {
1813 fmd_hdl_debug(hdl
, "cpu_lookup: discarding old ereport\n");
1818 cpu
= cpu_create(hdl
, asru
,
1819 cmd_cpu2core(cpuid
, ct
, level
), level
, ct
);
1826 cmd_cpu_lookup_from_detector(fmd_hdl_t
*hdl
, nvlist_t
*nvl
, const char *class,
1831 (void) nvlist_lookup_nvlist(nvl
, FM_EREPORT_DETECTOR
, &det
);
1833 return (cmd_cpu_lookup(hdl
, det
, class, level
));
1837 cpu_v0tov3(fmd_hdl_t
*hdl
, cmd_cpu_0_t
*old
, size_t oldsz
)
1841 if (oldsz
!= sizeof (cmd_cpu_0_t
)) {
1842 fmd_hdl_abort(hdl
, "size of state doesn't match size of "
1843 "version 0 state (%u bytes).\n", sizeof (cmd_cpu_0_t
));
1846 new = fmd_hdl_zalloc(hdl
, sizeof (cmd_cpu_t
), FMD_SLEEP
);
1847 new->cpu_header
= old
->cpu0_header
;
1848 new->cpu_version
= CMD_CPU_VERSION
;
1849 new->cpu_cpuid
= old
->cpu0_cpuid
;
1850 new->cpu_type
= old
->cpu0_type
;
1851 new->cpu_faulting
= old
->cpu0_faulting
;
1852 new->cpu_level
= CMD_CPU_LEVEL_THREAD
;
1853 new->cpu_asru
= old
->cpu0_asru
;
1854 new->cpu_fru
= old
->cpu0_fru
;
1855 new->cpu_uec
= old
->cpu0_uec
;
1856 new->cpu_olduec
= old
->cpu0_olduec
;
1858 fmd_hdl_free(hdl
, old
, oldsz
);
1863 cpu_v1tov3(fmd_hdl_t
*hdl
, cmd_cpu_1_t
*old
, size_t oldsz
)
1867 if (oldsz
!= sizeof (cmd_cpu_1_t
)) {
1868 fmd_hdl_abort(hdl
, "size of state doesn't match size of "
1869 "version 1 state (%u bytes).\n", sizeof (cmd_cpu_1_t
));
1872 new = fmd_hdl_zalloc(hdl
, sizeof (cmd_cpu_t
), FMD_SLEEP
);
1873 new->cpu_header
= old
->cpu1_header
;
1874 new->cpu_version
= CMD_CPU_VERSION
;
1875 new->cpu_cpuid
= old
->cpu1_cpuid
;
1876 new->cpu_type
= old
->cpu1_type
;
1877 new->cpu_faulting
= old
->cpu1_faulting
;
1878 new->cpu_level
= CMD_CPU_LEVEL_THREAD
;
1879 new->cpu_asru
= old
->cpu1_asru
;
1880 new->cpu_fru
= old
->cpu1_fru
;
1881 new->cpu_uec
= old
->cpu1_uec
;
1882 new->cpu_olduec
= old
->cpu1_olduec
;
1884 fmd_hdl_free(hdl
, old
, oldsz
);
1889 cpu_v2tov3(fmd_hdl_t
*hdl
, cmd_cpu_2_t
*old
, size_t oldsz
)
1893 if (oldsz
!= sizeof (cmd_cpu_2_t
)) {
1894 fmd_hdl_abort(hdl
, "size of state doesn't match size of "
1895 "version 2 state (%u bytes).\n", sizeof (cmd_cpu_2_t
));
1898 new = fmd_hdl_zalloc(hdl
, sizeof (cmd_cpu_t
), FMD_SLEEP
);
1900 new->cpu_header
= old
->cpu2_header
;
1901 new->cpu_cpuid
= old
->cpu2_cpuid
;
1902 new->cpu_type
= old
->cpu2_type
;
1903 new->cpu_faulting
= old
->cpu2_faulting
;
1904 new->cpu_asru
= old
->cpu2_asru
;
1905 new->cpu_fru
= old
->cpu2_fru
;
1906 new->cpu_uec
= old
->cpu2_uec
;
1907 new->cpu_olduec
= old
->cpu2_olduec
;
1908 new->cpu_version
= CMD_CPU_VERSION
;
1909 new->cpu_level
= CMD_CPU_LEVEL_THREAD
;
1910 fmd_hdl_free(hdl
, old
, oldsz
);
1915 cpu_wrapv3(fmd_hdl_t
*hdl
, cmd_cpu_pers_t
*pers
, size_t psz
)
1919 if (psz
!= sizeof (cmd_cpu_pers_t
)) {
1920 fmd_hdl_abort(hdl
, "size of state doesn't match size of "
1921 "version 3 state (%u bytes).\n", sizeof (cmd_cpu_pers_t
));
1924 cpu
= fmd_hdl_zalloc(hdl
, sizeof (cmd_cpu_t
), FMD_SLEEP
);
1925 bcopy(pers
, cpu
, sizeof (cmd_cpu_pers_t
));
1926 fmd_hdl_free(hdl
, pers
, psz
);
1931 cpu_case_restore(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
, cmd_case_t
*cc
, fmd_case_t
*cp
,
1932 const char *serdbase
)
1934 cmd_case_restore(hdl
, cc
, cp
, cmd_cpu_serdnm_create(hdl
, cpu
,
1939 cmd_restore_cpu_only(fmd_hdl_t
*hdl
, fmd_case_t
*cp
, char *cpu_hdr_bufname
)
1943 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
;
1944 cpu
= cmd_list_next(cpu
)) {
1945 if (strcmp(cpu
->cpu_bufname
, cpu_hdr_bufname
) == 0)
1953 fmd_hdl_debug(hdl
, "restoring cpu from %s\n", cpu_hdr_bufname
);
1955 if ((cpusz
= fmd_buf_size(hdl
, NULL
, cpu_hdr_bufname
)) == 0) {
1956 if (fmd_case_solved(hdl
, cp
) ||
1957 fmd_case_closed(hdl
, cp
)) {
1958 fmd_hdl_debug(hdl
, "cpu buffer %s from case %s "
1959 "not found. Case is already solved or "
1961 cpu_hdr_bufname
, fmd_case_uuid(hdl
, cp
));
1964 fmd_hdl_abort(hdl
, "cpu referenced by case %s "
1965 "does not exist in saved state\n",
1966 fmd_case_uuid(hdl
, cp
));
1968 } else if (cpusz
> CMD_CPU_MAXSIZE
|| cpusz
< CMD_CPU_MINSIZE
) {
1969 fmd_hdl_abort(hdl
, "cpu buffer referenced by case %s "
1970 "is out of bounds (is %u bytes)\n",
1971 fmd_case_uuid(hdl
, cp
), cpusz
);
1974 if ((cpu
= cmd_buf_read(hdl
, NULL
, cpu_hdr_bufname
,
1976 fmd_hdl_abort(hdl
, "failed to read buf %s",
1980 fmd_hdl_debug(hdl
, "found %d in version field\n",
1983 if (CMD_CPU_VERSIONED(cpu
)) {
1984 switch (cpu
->cpu_version
) {
1985 case CMD_CPU_VERSION_1
:
1986 cpu
= cpu_v1tov3(hdl
, (cmd_cpu_1_t
*)cpu
,
1990 case CMD_CPU_VERSION_2
:
1991 cpu
= cpu_v2tov3(hdl
, (cmd_cpu_2_t
*)cpu
,
1995 case CMD_CPU_VERSION_3
:
1996 cpu
= cpu_wrapv3(hdl
, (cmd_cpu_pers_t
*)cpu
,
2000 fmd_hdl_abort(hdl
, "unknown version (found %d) "
2001 "for cpu state referenced by case %s.\n",
2002 cpu
->cpu_version
, fmd_case_uuid(hdl
, cp
));
2006 cpu
= cpu_v0tov3(hdl
, (cmd_cpu_0_t
*)cpu
, cpusz
);
2011 CMD_STAT_BUMP(cpu_migrat
);
2012 cpu_buf_write(hdl
, cpu
);
2015 cmd_fmri_restore(hdl
, &cpu
->cpu_asru
);
2016 cmd_fmri_restore(hdl
, &cpu
->cpu_fru
);
2018 cpu_uec_restore(hdl
, &cpu
->cpu_uec
);
2019 cpu_uec_restore(hdl
, &cpu
->cpu_olduec
);
2021 if (cpu
->cpu_uec
.uec_cache
!= NULL
)
2022 cpu_uec_flush(hdl
, cpu
);
2024 bzero(&cpu
->cpu_xxu_retries
, sizeof (cmd_list_t
));
2026 cmd_list_append(&cmd
.cmd_cpus
, cpu
);
2032 cmd_cpu_restore(fmd_hdl_t
*hdl
, fmd_case_t
*cp
, cmd_case_ptr_t
*ptr
)
2036 cpu
= cmd_restore_cpu_only(hdl
, cp
, ptr
->ptr_name
);
2040 switch (ptr
->ptr_subtype
) {
2041 case CMD_PTR_CPU_ICACHE
:
2042 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_icache
, cp
, "icache");
2044 case CMD_PTR_CPU_DCACHE
:
2045 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_dcache
, cp
, "dcache");
2047 case CMD_PTR_CPU_PCACHE
:
2048 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_pcache
, cp
, "pcache");
2050 case CMD_PTR_CPU_ITLB
:
2051 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_itlb
, cp
, "itlb");
2053 case CMD_PTR_CPU_DTLB
:
2054 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_dtlb
, cp
, "dtlb");
2056 case CMD_PTR_CPU_L2DATA
:
2057 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_l2data
, cp
,
2058 cmd
.cmd_l2data_serd
.cs_name
);
2060 case CMD_PTR_CPU_L2DATA_UERETRY
:
2061 /* No longer used -- discard */
2063 case CMD_PTR_CPU_L2TAG
:
2064 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_l2tag
, cp
, "l2tag");
2066 case CMD_PTR_CPU_L3DATA
:
2067 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_l3data
, cp
,
2068 cmd
.cmd_l3data_serd
.cs_name
);
2070 case CMD_PTR_CPU_L3DATA_UERETRY
:
2071 /* No longer used -- discard */
2073 case CMD_PTR_CPU_L3TAG
:
2074 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_l3tag
, cp
, "l3tag");
2076 case CMD_PTR_CPU_FPU
:
2077 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_fpu
, cp
, "fpu");
2079 case CMD_PTR_CPU_XR_RETRY
:
2080 cmd_xr_restore(hdl
, cpu
, cp
);
2082 case CMD_PTR_CPU_IREG
:
2083 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_ireg
, cp
, "ireg");
2085 case CMD_PTR_CPU_FREG
:
2086 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_freg
, cp
, "freg");
2088 case CMD_PTR_CPU_MAU
:
2089 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_mau
, cp
, "mau");
2091 case CMD_PTR_CPU_L2CTL
:
2092 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_l2ctl
, cp
, "l2ctl");
2094 case CMD_PTR_CPU_MISC_REGS
:
2095 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_misc_regs
, cp
,
2098 case CMD_PTR_CPU_LFU
:
2099 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_lfu
, cp
, "lfu");
2102 case CMD_PTR_CPU_INV_SFSR
:
2103 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_invsfsr
, cp
,
2106 case CMD_PTR_CPU_UE_DET_CPU
:
2107 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_oplue_detcpu
, cp
,
2110 case CMD_PTR_CPU_UE_DET_IO
:
2111 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_oplue_detio
, cp
,
2114 case CMD_PTR_CPU_MTLB
:
2115 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_mtlb
, cp
,
2118 case CMD_PTR_CPU_TLBP
:
2119 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_tlbp
, cp
,
2122 case CMD_PTR_CPU_UGESR_INV_URG
:
2123 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_inv_urg
, cp
,
2126 case CMD_PTR_CPU_UGESR_CRE
:
2127 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_cre
, cp
,
2130 case CMD_PTR_CPU_UGESR_TSB_CTX
:
2131 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_tsb_ctx
, cp
,
2134 case CMD_PTR_CPU_UGESR_TSBP
:
2135 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_tsbp
, cp
,
2138 case CMD_PTR_CPU_UGESR_PSTATE
:
2139 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_pstate
, cp
,
2142 case CMD_PTR_CPU_UGESR_TSTATE
:
2143 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_tstate
, cp
,
2146 case CMD_PTR_CPU_UGESR_IUG_F
:
2147 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_iug_f
, cp
,
2150 case CMD_PTR_CPU_UGESR_IUG_R
:
2151 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_iug_r
, cp
,
2154 case CMD_PTR_CPU_UGESR_SDC
:
2155 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_sdc
, cp
,
2158 case CMD_PTR_CPU_UGESR_WDT
:
2159 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_wdt
, cp
,
2162 case CMD_PTR_CPU_UGESR_DTLB
:
2163 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_dtlb
, cp
,
2166 case CMD_PTR_CPU_UGESR_ITLB
:
2167 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_itlb
, cp
,
2170 case CMD_PTR_CPU_UGESR_CORE_ERR
:
2171 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_core_err
, cp
,
2174 case CMD_PTR_CPU_UGESR_DAE
:
2175 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_dae
, cp
,
2178 case CMD_PTR_CPU_UGESR_IAE
:
2179 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_iae
, cp
,
2182 case CMD_PTR_CPU_UGESR_UGE
:
2183 cpu_case_restore(hdl
, cpu
, &cpu
->cpu_opl_uge
, cp
,
2188 fmd_hdl_abort(hdl
, "invalid %s subtype %d\n",
2189 ptr
->ptr_name
, ptr
->ptr_subtype
);
2196 cmd_cpu_validate(fmd_hdl_t
*hdl
)
2199 cmd_cpu_t
*cpu
, *cpun
;
2201 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
;
2202 cpu
= cmd_list_next(cpu
)) {
2203 if (cpu_all_threads_invalid(hdl
, cpu
) == FMD_B_TRUE
)
2204 cpu
->cpu_flags
|= CMD_CPU_F_DELETING
;
2207 for (xr
= cmd_list_next(&cmd
.cmd_xxcu_redelivs
); xr
!= NULL
; xr
= xrn
) {
2208 xrn
= cmd_list_next(xr
);
2210 if (xr
->xr_cpu
->cpu_flags
& CMD_CPU_F_DELETING
)
2211 cmd_xr_destroy(hdl
, xr
);
2214 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
; cpu
= cpun
) {
2215 cpun
= cmd_list_next(cpu
);
2217 if (cpu
->cpu_flags
& CMD_CPU_F_DELETING
)
2218 cmd_cpu_destroy(hdl
, cpu
);
2223 cmd_xxcu_timeout(fmd_hdl_t
*hdl
, id_t id
)
2227 for (xr
= cmd_list_next(&cmd
.cmd_xxcu_redelivs
); xr
!= NULL
;
2228 xr
= cmd_list_next(xr
)) {
2229 if (xr
->xr_id
== id
) {
2230 fmd_event_t
*ep
= fmd_case_getprincipal(hdl
,
2232 xr
->xr_hdlr(hdl
, xr
, ep
);
2233 cmd_xr_deref(hdl
, xr
);
2241 cmd_xxu_flush_timeout(fmd_hdl_t
*hdl
, id_t id
)
2246 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
;
2247 cpu
= cmd_list_next(cpu
)) {
2248 if (cpu
->cpu_uec_flush
== id
) {
2249 cpu_uec_flush_finish(hdl
, cpu
);
2259 cmd_cpu_timeout(fmd_hdl_t
*hdl
, id_t id
, void *type
)
2261 switch ((uintptr_t)type
) {
2262 case (uintptr_t)CMD_TIMERTYPE_CPU_UEC_FLUSH
:
2263 cmd_xxu_flush_timeout(hdl
, id
);
2265 case (uintptr_t)CMD_TIMERTYPE_CPU_XR_WAITER
:
2266 cmd_xxcu_timeout(hdl
, id
);
2272 cpu_gc_keep_one(fmd_hdl_t
*hdl
, cmd_cpu_t
*cpu
)
2276 if (cpu_all_threads_invalid(hdl
, cpu
) == FMD_B_TRUE
) {
2277 fmd_hdl_debug(hdl
, "GC of CPU %d: no longer working\n",
2282 for (i
= 0; i
< sizeof (cmd_cpu_cases_t
) / sizeof (cmd_case_t
); i
++) {
2283 cmd_case_t
*cp
= &((cmd_case_t
*)&cpu
->cpu_cases
)[i
];
2285 if (cp
->cc_cp
== NULL
|| cp
->cc_serdnm
== NULL
)
2288 if (fmd_serd_exists(hdl
, cp
->cc_serdnm
) &&
2289 !fmd_serd_empty(hdl
, cp
->cc_serdnm
))
2293 if (cmd_list_next(&cpu
->cpu_xxu_retries
) != NULL
)
2296 if (cpu
->cpu_uec
.uec_cache
!= NULL
||
2297 cpu
->cpu_olduec
.uec_cache
!= NULL
)
2305 cmd_cpu_gc(fmd_hdl_t
*hdl
)
2307 cmd_cpu_t
*cpu
, *next
;
2309 fmd_hdl_debug(hdl
, "GC of CPUs\n");
2311 for (cpu
= cmd_list_next(&cmd
.cmd_cpus
); cpu
!= NULL
; cpu
= next
) {
2312 next
= cmd_list_next(cpu
);
2314 if (!cpu_gc_keep_one(hdl
, cpu
)) {
2315 fmd_hdl_debug(hdl
, "GC of CPU %d: destroying\n",
2320 if (cpu
->cpu_uec
.uec_cache
!= NULL
)
2321 cpu_uec_flush(hdl
, cpu
);
2323 cpu
->cpu_uec_nflushes
= 0;
2328 cmd_cpu_fini(fmd_hdl_t
*hdl
)
2332 while ((cpu
= cmd_list_next(&cmd
.cmd_cpus
)) != NULL
)
2333 cmd_cpu_free(hdl
, cpu
, FMD_B_FALSE
);
2337 const char *fam_name
;
2338 cpu_family_t fam_value
;
2341 static famdata_t famdata_tbl
[] = {
2342 {"UltraSPARC-III", CMD_CPU_FAM_CHEETAH
},
2343 {"UltraSPARC-IV", CMD_CPU_FAM_CHEETAH
},
2344 {"UltraSPARC-T", CMD_CPU_FAM_NIAGARA
},
2345 {"SPARC64-VI", CMD_CPU_FAM_SPARC64
},
2346 {"SPARC64-VII", CMD_CPU_FAM_SPARC64
}
2350 cpu_family(char *knsp
)
2354 for (j
= 0; j
< sizeof (famdata_tbl
)/sizeof (famdata_t
); j
++) {
2355 if (strncmp(knsp
, famdata_tbl
[j
].fam_name
,
2356 strlen(famdata_tbl
[j
].fam_name
)) == 0) {
2357 return (famdata_tbl
[j
].fam_value
);
2360 return (CMD_CPU_FAM_UNSUPPORTED
);
2364 * Determine which CPU family this diagnosis is being run on.
2365 * This assumes that ereports are being generated by this system.
2369 cmd_cpu_check_support(void)
2376 if ((kc
= kstat_open()) == NULL
)
2377 return (CMD_CPU_FAM_UNSUPPORTED
);
2379 for (ksp
= kc
->kc_chain
; ksp
!= NULL
; ksp
= ksp
->ks_next
) {
2380 if (strcmp(ksp
->ks_module
, "cpu_info") != 0)
2383 if (kstat_read(kc
, ksp
, NULL
) == -1) {
2384 (void) kstat_close(kc
);
2385 return (CMD_CPU_FAM_UNSUPPORTED
);
2388 for (kn
= ksp
->ks_data
, i
= 0; i
< ksp
->ks_ndata
; i
++, kn
++) {
2389 cpu_family_t family
;
2390 if (strcmp(kn
->name
, "implementation") != 0)
2392 family
= cpu_family(KSTAT_NAMED_STR_PTR(kn
));
2393 (void) kstat_close(kc
);
2397 (void) kstat_close(kc
);
2398 return (CMD_CPU_FAM_UNSUPPORTED
);
2402 cmd_cpu_ecache_support(void)
2406 value
= cmd_cpu_check_support();
2407 return (fam_info_tbl
[value
].ecache_flush_needed
);
2411 * This function builds the fmri of the
2412 * given cpuid based on the cpu scheme.
2415 cmd_cpu_fmri_create(uint32_t cpuid
, uint8_t cpumask
)
2419 if ((errno
= nvlist_alloc(&fmri
, NV_UNIQUE_NAME
, 0)) != 0)
2422 if (nvlist_add_uint8(fmri
, FM_VERSION
,
2423 FM_CPU_SCHEME_VERSION
) != 0 || nvlist_add_string(fmri
,
2424 FM_FMRI_SCHEME
, FM_FMRI_SCHEME_CPU
) != 0 ||
2425 nvlist_add_uint32(fmri
, FM_FMRI_CPU_ID
, cpuid
) != 0 ||
2426 nvlist_add_uint8(fmri
, FM_FMRI_CPU_MASK
, cpumask
) != 0) {