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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/pcplusmp/apic_common.c
          +++ new/usr/src/uts/i86pc/io/pcplusmp/apic_common.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  /*
  26      - * Copyright 2018 Joyent, Inc.
       26 + * Copyright 2019, Joyent, Inc.
  27   27   * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
  28   28   */
  29   29  
  30   30  /*
  31   31   * PSMI 1.1 extensions are supported only in 2.6 and later versions.
  32   32   * PSMI 1.2 extensions are supported only in 2.7 and later versions.
  33   33   * PSMI 1.3 and 1.4 extensions are supported in Solaris 10.
  34   34   * PSMI 1.5 extensions are supported in Solaris Nevada.
  35   35   * PSMI 1.6 extensions are supported in Solaris Nevada.
  36   36   * PSMI 1.7 extensions are supported in Solaris Nevada.
↓ open down ↓ 764 lines elided ↑ open up ↑
 801  801          intr_restore(oflags);
 802  802  
 803  803          return (temp);
 804  804  }
 805  805  
 806  806  /* apic NMI handler */
 807  807  /*ARGSUSED*/
 808  808  void
 809  809  apic_nmi_intr(caddr_t arg, struct regs *rp)
 810  810  {
      811 +        nmi_action_t action = nmi_action;
      812 +
 811  813          if (apic_shutdown_processors) {
 812  814                  apic_disable_local_apic();
 813  815                  return;
 814  816          }
 815  817  
 816  818          apic_error |= APIC_ERR_NMI;
 817  819  
 818  820          if (!lock_try(&apic_nmi_lock))
 819  821                  return;
 820  822          apic_num_nmis++;
 821  823  
 822      -        if (apic_kmdb_on_nmi && psm_debugger()) {
 823      -                debug_enter("NMI received: entering kmdb\n");
 824      -        } else if (apic_panic_on_nmi) {
 825      -                /* Keep panic from entering kmdb. */
 826      -                nopanicdebug = 1;
 827      -                panic("NMI received\n");
 828      -        } else {
      824 +        /*
      825 +         * "nmi_action" always over-rides the older way of doing this, unless we
      826 +         * can't actually drop into kmdb when requested.
      827 +         */
      828 +        if (action == NMI_ACTION_KMDB && !psm_debugger())
      829 +                action = NMI_ACTION_UNSET;
      830 +
      831 +        if (action == NMI_ACTION_UNSET) {
      832 +                if (apic_kmdb_on_nmi && psm_debugger())
      833 +                        action = NMI_ACTION_KMDB;
      834 +                else if (apic_panic_on_nmi)
      835 +                        action = NMI_ACTION_PANIC;
      836 +                else
      837 +                        action = NMI_ACTION_IGNORE;
      838 +        }
      839 +
      840 +        switch (action) {
      841 +        case NMI_ACTION_IGNORE:
 829  842                  /*
 830  843                   * prom_printf is the best shot we have of something which is
 831  844                   * problem free from high level/NMI type of interrupts
 832  845                   */
 833  846                  prom_printf("NMI received\n");
      847 +                break;
      848 +
      849 +        case NMI_ACTION_PANIC:
      850 +                /* Keep panic from entering kmdb. */
      851 +                nopanicdebug = 1;
      852 +                panic("NMI received\n");
      853 +                break;
      854 +
      855 +        case NMI_ACTION_KMDB:
      856 +        default:
      857 +                debug_enter("NMI received: entering kmdb\n");
      858 +                break;
 834  859          }
 835  860  
 836  861          lock_clear(&apic_nmi_lock);
 837  862  }
 838  863  
 839  864  processorid_t
 840  865  apic_get_next_processorid(processorid_t cpu_id)
 841  866  {
 842  867  
 843  868          int i;
↓ open down ↓ 961 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX