Print this page
10597 would like a way to set NMI behavior at boot
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>


   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  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2017 by Delphix. All rights reserved.
  24  */
  25 /*
  26  * Copyright 2018 Joyent, Inc.
  27  */
  28 
  29 #ifndef _SYS_APIC_COMMON_H
  30 #define _SYS_APIC_COMMON_H
  31 
  32 #include <sys/psm_types.h>
  33 #include <sys/avintr.h>
  34 #include <sys/privregs.h>
  35 #include <sys/pci.h>
  36 #include <sys/cyclic.h>
  37 
  38 #ifdef  __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 /*
  43  * Functions & Variables common to pcplusmp & apix
  44  */
  45 
  46 #include <sys/psm_common.h>


 138 extern volatile hrtime_t apic_nsec_since_boot;
 139 extern uint_t   apic_hertz_count;
 140 
 141 extern uint64_t apic_ticks_per_SFnsecs; /* # of ticks in SF nsecs */
 142 
 143 extern int      apic_hrtime_error;
 144 extern int      apic_remote_hrterr;
 145 extern int      apic_num_nmis;
 146 extern int      apic_apic_error;
 147 extern int      apic_num_apic_errors;
 148 extern int      apic_num_cksum_errors;
 149 
 150 extern int      apic_error;
 151 
 152 /* use to make sure only one cpu handles the nmi */
 153 extern lock_t   apic_nmi_lock;
 154 /* use to make sure only one cpu handles the error interrupt */
 155 extern lock_t   apic_error_lock;
 156 
 157 /* Patchable global variables. */
 158 extern int      apic_kmdb_on_nmi;       /* 0 - no, 1 - yes enter kmdb */
 159 extern uint32_t apic_divide_reg_init;   /* 0 - divide by 2 */
 160 
 161 extern apic_intrmap_ops_t *apic_vt_ops;
 162 
 163 #ifdef  DEBUG
 164 extern int      apic_break_on_cpu;
 165 extern int      apic_stretch_interrupts;
 166 extern int      apic_stretch_ISR;       /* IPL of 3 matches nothing now */
 167 #endif
 168 
 169 extern cyclic_id_t apic_cyclic_id;
 170 
 171 extern void apic_nmi_intr(caddr_t arg, struct regs *rp);
 172 extern int      apic_clkinit();
 173 extern hrtime_t apic_gettime();
 174 extern hrtime_t apic_gethrtime();
 175 extern int      apic_cpu_start(processorid_t cpuid, caddr_t ctx);
 176 extern int      apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
 177 extern int      apic_cpu_add(psm_cpu_request_t *reqp);
 178 extern int      apic_cpu_remove(psm_cpu_request_t *reqp);


 185 extern void     apic_preshutdown(int cmd, int fcn);
 186 extern processorid_t    apic_get_next_processorid(processorid_t cpun);
 187 extern uint64_t apic_calibrate();
 188 extern int      apic_get_pir_ipivect(void);
 189 extern void     apic_send_pir_ipi(processorid_t);
 190 
 191 extern int apic_error_intr();
 192 extern void apic_cpcovf_mask_clear(void);
 193 extern void apic_cmci_setup(processorid_t, boolean_t);
 194 extern void apic_intrmap_init(int apic_mode);
 195 extern processorid_t apic_find_cpu(int flag);
 196 extern processorid_t apic_get_next_bind_cpu(void);
 197 
 198 extern int      apic_support_msi;
 199 extern int      apic_multi_msi_enable;
 200 extern int      apic_msix_enable;
 201 
 202 extern uint32_t apic_get_localapicid(uint32_t cpuid);
 203 extern uchar_t apic_get_ioapicid(uchar_t ioapicindex);
 204 









 205 #ifdef  __cplusplus
 206 }
 207 #endif
 208 
 209 #endif  /* _SYS_APIC_COMMON_H */


   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  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2017 by Delphix. All rights reserved.
  24  */
  25 /*
  26  * Copyright 2019, Joyent, Inc.
  27  */
  28 
  29 #ifndef _SYS_APIC_COMMON_H
  30 #define _SYS_APIC_COMMON_H
  31 
  32 #include <sys/psm_types.h>
  33 #include <sys/avintr.h>
  34 #include <sys/privregs.h>
  35 #include <sys/pci.h>
  36 #include <sys/cyclic.h>
  37 
  38 #ifdef  __cplusplus
  39 extern "C" {
  40 #endif
  41 
  42 /*
  43  * Functions & Variables common to pcplusmp & apix
  44  */
  45 
  46 #include <sys/psm_common.h>


 138 extern volatile hrtime_t apic_nsec_since_boot;
 139 extern uint_t   apic_hertz_count;
 140 
 141 extern uint64_t apic_ticks_per_SFnsecs; /* # of ticks in SF nsecs */
 142 
 143 extern int      apic_hrtime_error;
 144 extern int      apic_remote_hrterr;
 145 extern int      apic_num_nmis;
 146 extern int      apic_apic_error;
 147 extern int      apic_num_apic_errors;
 148 extern int      apic_num_cksum_errors;
 149 
 150 extern int      apic_error;
 151 
 152 /* use to make sure only one cpu handles the nmi */
 153 extern lock_t   apic_nmi_lock;
 154 /* use to make sure only one cpu handles the error interrupt */
 155 extern lock_t   apic_error_lock;
 156 
 157 /* Patchable global variables. */

 158 extern uint32_t apic_divide_reg_init;   /* 0 - divide by 2 */
 159 
 160 extern apic_intrmap_ops_t *apic_vt_ops;
 161 
 162 #ifdef  DEBUG
 163 extern int      apic_break_on_cpu;
 164 extern int      apic_stretch_interrupts;
 165 extern int      apic_stretch_ISR;       /* IPL of 3 matches nothing now */
 166 #endif
 167 
 168 extern cyclic_id_t apic_cyclic_id;
 169 
 170 extern void apic_nmi_intr(caddr_t arg, struct regs *rp);
 171 extern int      apic_clkinit();
 172 extern hrtime_t apic_gettime();
 173 extern hrtime_t apic_gethrtime();
 174 extern int      apic_cpu_start(processorid_t cpuid, caddr_t ctx);
 175 extern int      apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
 176 extern int      apic_cpu_add(psm_cpu_request_t *reqp);
 177 extern int      apic_cpu_remove(psm_cpu_request_t *reqp);


 184 extern void     apic_preshutdown(int cmd, int fcn);
 185 extern processorid_t    apic_get_next_processorid(processorid_t cpun);
 186 extern uint64_t apic_calibrate();
 187 extern int      apic_get_pir_ipivect(void);
 188 extern void     apic_send_pir_ipi(processorid_t);
 189 
 190 extern int apic_error_intr();
 191 extern void apic_cpcovf_mask_clear(void);
 192 extern void apic_cmci_setup(processorid_t, boolean_t);
 193 extern void apic_intrmap_init(int apic_mode);
 194 extern processorid_t apic_find_cpu(int flag);
 195 extern processorid_t apic_get_next_bind_cpu(void);
 196 
 197 extern int      apic_support_msi;
 198 extern int      apic_multi_msi_enable;
 199 extern int      apic_msix_enable;
 200 
 201 extern uint32_t apic_get_localapicid(uint32_t cpuid);
 202 extern uchar_t apic_get_ioapicid(uchar_t ioapicindex);
 203 
 204 typedef enum nmi_action {
 205         NMI_ACTION_UNSET,
 206         NMI_ACTION_PANIC,
 207         NMI_ACTION_IGNORE,
 208         NMI_ACTION_KMDB
 209 } nmi_action_t;
 210 
 211 extern nmi_action_t nmi_action;
 212 
 213 #ifdef  __cplusplus
 214 }
 215 #endif
 216 
 217 #endif  /* _SYS_APIC_COMMON_H */