diff options
author | John Levon <john.levon@joyent.com> | 2019-03-27 09:43:53 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2019-04-03 22:37:38 -0700 |
commit | 0c26abfe36e56b0d0ca74a046c85dc41f76d1d59 (patch) | |
tree | ecbcac9de9cdac7219642161b3d462789168c6d0 /usr/src/uts/i86pc/os/mlsetup.c | |
parent | e0f1c0afa46cc84d4b1e40124032a9a87310386e (diff) | |
download | illumos-joyent-0c26abfe36e56b0d0ca74a046c85dc41f76d1d59.tar.gz |
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>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/i86pc/os/mlsetup.c')
-rw-r--r-- | usr/src/uts/i86pc/os/mlsetup.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr/src/uts/i86pc/os/mlsetup.c b/usr/src/uts/i86pc/os/mlsetup.c index 7c17aab541..1f9149d5c4 100644 --- a/usr/src/uts/i86pc/os/mlsetup.c +++ b/usr/src/uts/i86pc/os/mlsetup.c @@ -23,7 +23,7 @@ * * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. - * Copyright 2018 Joyent, Inc. + * Copyright 2019, Joyent, Inc. */ /* * Copyright (c) 2010, Intel Corporation. @@ -61,6 +61,8 @@ #include <sys/archsystm.h> #include <sys/promif.h> #include <sys/pci_cfgspace.h> +#include <sys/apic.h> +#include <sys/apic_common.h> #include <sys/bootvfs.h> #include <sys/tsc.h> #ifdef __xpv @@ -79,6 +81,8 @@ extern uint32_t cpuid_feature_ecx_exclude; extern uint32_t cpuid_feature_edx_include; extern uint32_t cpuid_feature_edx_exclude; +nmi_action_t nmi_action = NMI_ACTION_UNSET; + /* * Set console mode */ @@ -103,6 +107,7 @@ void mlsetup(struct regs *rp) { u_longlong_t prop_value; + char prop_str[BP_MAX_STRLEN]; extern struct classfuncs sys_classfuncs; extern disp_t cpu0_disp; extern char t0stack[]; @@ -149,6 +154,19 @@ mlsetup(struct regs *rp) cpuid_feature_edx_exclude = (uint32_t)prop_value; #if !defined(__xpv) + if (bootprop_getstr("nmi", prop_str, sizeof (prop_str)) == 0) { + if (strcmp(prop_str, "ignore") == 0) { + nmi_action = NMI_ACTION_IGNORE; + } else if (strcmp(prop_str, "panic") == 0) { + nmi_action = NMI_ACTION_PANIC; + } else if (strcmp(prop_str, "kmdb") == 0) { + nmi_action = NMI_ACTION_KMDB; + } else { + prom_printf("unix: ignoring unknown nmi=%s\n", + prop_str); + } + } + /* * Check to see if KPTI has been explicitly enabled or disabled. * We have to check this before init_desctbls(). |