summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-07-22 11:45:15 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-07-22 11:45:15 +0000
commit11314710586b6f738a39dd0bf242b53b11c8c189 (patch)
treee285ade755d7088039aece5b4c0e3329039e8f16 /usr
parentb8ab5a60510415920db8a1d8d4e22249b00314c7 (diff)
parent7d91603476b740ff8f4c917d71ee5884ab39cb60 (diff)
downloadillumos-joyent-11314710586b6f738a39dd0bf242b53b11c8c189.tar.gz
[illumos-gate merge]
commit 7d91603476b740ff8f4c917d71ee5884ab39cb60 12966 imc driver blew up on missing channel commit 777a71cfc7f5d1d0c739d58698fe598f2cdb6f2d 11911 Inconsistent case handling for properties in dladm commit a963a5aa3ca3777616e2475ae05969f48439c694 12947 stand: this statement may fall through commit acdc433c352771bfb6a3cf85e6bc74782da919af 12948 dr_cpu: this statement may fall through commit 6a8fa7ea16d9870b21c82af67a2053cb47ed1fb4 12747 sigsetjmp should allow for 8 byte aligned buffer on amd64 commit 9b65801e8bd9a9007efed89ac479e99b9dab83d1 12950 pcicmu: this statement may fall through commit 6edddafdeaa7f4e95b88c106b4825057c934d52c 12946 want ability to dump smbios data from crash dump commit e98a9323520af2d37dd05c47dd174826c71b0c3a 12951 serengeti: this statement may fall through commit 88b620a7b440907cc75f1955c584204c6b79b6fd 12949 drctl: this statement may fall through
Diffstat (limited to 'usr')
-rw-r--r--usr/src/cmd/mdb/intel/modules/Makefile1
-rw-r--r--usr/src/cmd/mdb/intel/modules/smbios/Makefile20
-rw-r--r--usr/src/cmd/mdb/intel/modules/smbios/amd64/Makefile28
-rw-r--r--usr/src/cmd/mdb/intel/modules/smbios/smbios.c136
-rw-r--r--usr/src/lib/libc/amd64/gen/siglongjmp.c4
-rw-r--r--usr/src/lib/libc/amd64/threads/asm_subr.s8
-rw-r--r--usr/src/lib/libc/amd64/threads/machdep.c6
-rw-r--r--usr/src/lib/libc/inc/sigjmp_struct.h15
-rw-r--r--usr/src/lib/libdladm/common/linkprop.c31
-rw-r--r--usr/src/pkg/manifests/developer-debug-mdb.mf1
-rw-r--r--usr/src/stand/lib/inet/ipv4.c22
-rw-r--r--usr/src/stand/lib/sock/socket.c5
-rw-r--r--usr/src/uts/i86pc/io/imc/imc.c39
-rw-r--r--usr/src/uts/i86pc/io/imc/imc.h5
-rw-r--r--usr/src/uts/sun4u/opl/io/oplmsu/oplmsu_ioctl_uwp.c2
-rw-r--r--usr/src/uts/sun4u/opl/io/pcicmu/pcmu_util.c10
-rw-r--r--usr/src/uts/sun4u/os/plat_ecc_unum.c1
-rw-r--r--usr/src/uts/sun4v/io/dr_cpu.c2
-rw-r--r--usr/src/uts/sun4v/io/drctl_impl.c2
19 files changed, 303 insertions, 35 deletions
diff --git a/usr/src/cmd/mdb/intel/modules/Makefile b/usr/src/cmd/mdb/intel/modules/Makefile
index 96ccc108d6..0337032b76 100644
--- a/usr/src/cmd/mdb/intel/modules/Makefile
+++ b/usr/src/cmd/mdb/intel/modules/Makefile
@@ -27,6 +27,7 @@ SUBDIRS = mdb_kb \
generic_cpu \
amd_opteron \
sata \
+ smbios \
xhci
include ../../Makefile.subdirs
diff --git a/usr/src/cmd/mdb/intel/modules/smbios/Makefile b/usr/src/cmd/mdb/intel/modules/smbios/Makefile
new file mode 100644
index 0000000000..542ef6cffe
--- /dev/null
+++ b/usr/src/cmd/mdb/intel/modules/smbios/Makefile
@@ -0,0 +1,20 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Oxide Computer Company
+#
+
+include $(SRC)/Makefile.master
+
+$(BUILD64)SUBDIRS += $(MACH64)
+
+include ../../../Makefile.subdirs
diff --git a/usr/src/cmd/mdb/intel/modules/smbios/amd64/Makefile b/usr/src/cmd/mdb/intel/modules/smbios/amd64/Makefile
new file mode 100644
index 0000000000..94658c0d38
--- /dev/null
+++ b/usr/src/cmd/mdb/intel/modules/smbios/amd64/Makefile
@@ -0,0 +1,28 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Oxide Computer Company
+#
+
+
+MODULE = smbios.so
+MDBTGT = kvm
+
+MODSRCS = smbios.c
+
+include ../../../../../Makefile.cmd
+include ../../../../../Makefile.cmd.64
+include ../../../Makefile.amd64
+include ../../../../Makefile.module
+
+MODULE_BUILD_TYPE = mdb
+LDLIBS += -lsmbios
diff --git a/usr/src/cmd/mdb/intel/modules/smbios/smbios.c b/usr/src/cmd/mdb/intel/modules/smbios/smbios.c
new file mode 100644
index 0000000000..429a5fba0e
--- /dev/null
+++ b/usr/src/cmd/mdb/intel/modules/smbios/smbios.c
@@ -0,0 +1,136 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2020 Oxide Computer Company
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/mdb_modapi.h>
+#include <sys/smbios_impl.h>
+#include <unistd.h>
+
+/*
+ * Unfortunately, we're in a bit of a bind. Because of the situation we're in,
+ * we cannot use string.h directly as it declares ffs() which is also declared
+ * in sys/systm.h. sys/systm.h is being pulled in because mdb is building with
+ * _KERNEL. Therefore we have to manually declare an extern delaration for
+ * strerror().
+ */
+extern const char *strerror(int);
+
+/*
+ * Take an existing smbios_hdl_t from a dump and slurp out its memory so we can
+ * open up a new smbios handle to perform operations on.
+ */
+static int
+smbios_mdb_write(const char *path, uintptr_t addr)
+{
+ smbios_hdl_t shp, *hdl;
+ void *buf;
+ int err, fd = -1;
+ int ret = DCMD_ERR;
+
+ if (mdb_vread(&shp, sizeof (shp), addr) != sizeof (shp)) {
+ mdb_warn("failed to read smbios_hdl_t at %p", addr);
+ return (DCMD_ERR);
+ }
+
+ buf = mdb_alloc(shp.sh_buflen, UM_NOSLEEP | UM_GC);
+ if (buf == NULL) {
+ mdb_warn("failed to allocate %zu bytes for the smbios "
+ "data buffer", shp.sh_buflen);
+ return (DCMD_ERR);
+ }
+
+ if (mdb_vread(buf, shp.sh_buflen, (uintptr_t)shp.sh_buf) !=
+ shp.sh_buflen) {
+ mdb_warn("failed to copy smbios data at %p", shp.sh_buf);
+ return (DCMD_ERR);
+ }
+
+ hdl = smbios_bufopen(&shp.sh_ent, buf, shp.sh_buflen, SMB_VERSION, 0,
+ &err);
+ if (hdl == NULL) {
+ mdb_warn("failed to load smbios data: %s\n",
+ smbios_errmsg(err));
+ return (DCMD_ERR);
+ }
+
+ if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
+ mdb_warn("failed to open output file %s: %s\n", path,
+ strerror(errno));
+ goto out;
+ }
+
+ if (smbios_write(hdl, fd) != 0) {
+ mdb_warn("failed to write smbios data to %s: %s\n", path,
+ smbios_errmsg(smbios_errno(hdl)));
+ ret = DCMD_ERR;
+ } else {
+ ret = DCMD_OK;
+ }
+out:
+ if (fd != -1) {
+ (void) close(fd);
+ }
+ smbios_close(hdl);
+ return (ret);
+}
+
+static int
+smbios_mdb_smbios(uintptr_t addr, uint_t flags, int argc,
+ const mdb_arg_t *argv)
+{
+ const char *wpath = NULL;
+
+ if (!(flags & DCMD_ADDRSPEC)) {
+ mdb_warn("missing required smbios_hdl_t\n");
+ return (DCMD_USAGE);
+ }
+
+ if (mdb_getopts(argc, argv, 'w', MDB_OPT_STR, &wpath, NULL) != argc) {
+ return (DCMD_USAGE);
+ }
+
+ if (wpath != NULL) {
+ return (smbios_mdb_write(wpath, addr));
+ }
+
+ return (DCMD_USAGE);
+}
+
+static void
+smbios_mdb_help(void)
+{
+ mdb_printf("Given a pointer to an smbios_hdl_t take the following "
+ "actions:\n\n"
+ "\t-w path\t\tWrite SMBIOS data out to path\n");
+}
+
+static const mdb_dcmd_t smbios_dcmds[] = {
+ { "smbios", ":[-w path]", "Manipulate an smbios handle",
+ smbios_mdb_smbios, smbios_mdb_help },
+ { NULL }
+};
+
+static const mdb_modinfo_t smbios_modinfo = {
+ MDB_API_VERSION, smbios_dcmds, NULL
+};
+
+const mdb_modinfo_t *
+_mdb_init(void)
+{
+ return (&smbios_modinfo);
+}
diff --git a/usr/src/lib/libc/amd64/gen/siglongjmp.c b/usr/src/lib/libc/amd64/gen/siglongjmp.c
index d71f40a034..dda4c945d6 100644
--- a/usr/src/lib/libc/amd64/gen/siglongjmp.c
+++ b/usr/src/lib/libc/amd64/gen/siglongjmp.c
@@ -29,6 +29,7 @@
#include <sys/ucontext.h>
#include <setjmp.h>
#include <ucontext.h>
+#include "sigjmp_struct.h"
#include "libc.h"
#pragma weak _siglongjmp = siglongjmp
@@ -36,8 +37,7 @@
void
siglongjmp(sigjmp_buf env, int val)
{
- /* LINTED alignment */
- ucontext_t *ucp = (ucontext_t *)env;
+ ucontext_t *ucp = SIGJMP2UCONTEXT(env);
if (val)
ucp->uc_mcontext.gregs[REG_R0] = val;
diff --git a/usr/src/lib/libc/amd64/threads/asm_subr.s b/usr/src/lib/libc/amd64/threads/asm_subr.s
index 9feef4a2e2..3898e9c6e6 100644
--- a/usr/src/lib/libc/amd64/threads/asm_subr.s
+++ b/usr/src/lib/libc/amd64/threads/asm_subr.s
@@ -104,7 +104,11 @@ __sighndlrend:
#undef sigsetjmp
-#if SIZEOF_SIGJMP_BUF < SIZEOF_UCONTEXT_T
+/*
+ * Ensure that a "ucontext_t" will fit within a "sigjmp_buf", including the
+ * extra 8 bytes we may need for correct alignment on AMD64.
+ */
+#if SIZEOF_SIGJMP_BUF - _LONG_ALIGNMENT < SIZEOF_UCONTEXT_T
#error "sigjmp_buf is too small to contain a ucontext_t"
@@ -171,4 +175,4 @@ __sighndlrend:
SET_SIZE(sigsetjmp)
SET_SIZE(_sigsetjmp)
-#endif /* SIZEOF_SIGJMP_BUF < SIZEOF_UCONTEXT_T */
+#endif /* SIZEOF_SIGJMP_BUF - _LONG_ALIGNMENT < SIZEOF_UCONTEXT_T */
diff --git a/usr/src/lib/libc/amd64/threads/machdep.c b/usr/src/lib/libc/amd64/threads/machdep.c
index b1638e0b31..81b8ee37ec 100644
--- a/usr/src/lib/libc/amd64/threads/machdep.c
+++ b/usr/src/lib/libc/amd64/threads/machdep.c
@@ -28,6 +28,7 @@
#include <procfs.h>
#include <ucontext.h>
#include <setjmp.h>
+#include "sigjmp_struct.h"
extern int getlwpstatus(thread_t, lwpstatus_t *);
extern int putlwpregs(thread_t, prgregset_t);
@@ -66,7 +67,7 @@ setup_top_frame(void *stk, size_t stksize, ulwp_t *ulwp)
int
setup_context(ucontext_t *ucp, void *(*func)(ulwp_t *),
- ulwp_t *ulwp, caddr_t stk, size_t stksize)
+ ulwp_t *ulwp, caddr_t stk, size_t stksize)
{
uint64_t *stack;
@@ -172,8 +173,7 @@ setgregs(ulwp_t *ulwp, gregset_t rs)
int
__csigsetjmp(sigjmp_buf env, int savemask, gregset_t rs)
{
- /* LINTED alignment */
- ucontext_t *ucp = (ucontext_t *)env;
+ ucontext_t *ucp = SIGJMP2UCONTEXT(env);
ulwp_t *self = curthread;
ucp->uc_link = self->ul_siglink;
diff --git a/usr/src/lib/libc/inc/sigjmp_struct.h b/usr/src/lib/libc/inc/sigjmp_struct.h
index 988e6ca14c..7d347c2d3c 100644
--- a/usr/src/lib/libc/inc/sigjmp_struct.h
+++ b/usr/src/lib/libc/inc/sigjmp_struct.h
@@ -32,6 +32,7 @@ extern "C" {
#include <sys/types.h>
#include <sys/stack.h>
+#include <sys/sysmacros.h>
#include <ucontext.h>
#include <setjmp.h>
@@ -73,6 +74,20 @@ typedef struct {
#endif /* __sparc */
+#if defined(__amd64)
+/*
+ * The "sigjmp_buf" type is an array of long and thus can have 8-byte alignment
+ * on AMD64 systems. The "ucontext_t" type has a stricter 16-byte alignment
+ * requirement, so we must round the pointer up when casting.
+ *
+ * This is not required on other architectures:
+ * - SPARC does not store the ucontext_t in the sigjmp_buf
+ * - i386 only requires 4-byte alignment for ucontext_t
+ */
+#define SIGJMP2UCONTEXT(x) \
+ ((ucontext_t *)P2ROUNDUP((uintptr_t)(x), sizeof (upad128_t)))
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/lib/libdladm/common/linkprop.c b/usr/src/lib/libdladm/common/linkprop.c
index 3791784ab1..2c29e6ab80 100644
--- a/usr/src/lib/libdladm/common/linkprop.c
+++ b/usr/src/lib/libdladm/common/linkprop.c
@@ -1131,6 +1131,21 @@ dladm_set_linkprop(dladm_handle_t handle, datalink_id_t linkid,
}
/*
+ * For well-known property names, normalize the case. We can also
+ * save the property name itself, so that we can just do a pointer
+ * equality test later and avoid an extra strcmp.
+ */
+ if (prop_name != NULL) {
+ int i;
+ for (i = 0; i < DLADM_MAX_PROPS; i++) {
+ if (strcasecmp(prop_name, prop_table[i].pd_name) == 0) {
+ prop_name = prop_table[i].pd_name;
+ break;
+ }
+ }
+ }
+
+ /*
* Check for valid link property against the flags passed
* and set the link property when active flag is passed.
*/
@@ -1160,7 +1175,7 @@ dladm_set_linkprop(dladm_handle_t handle, datalink_id_t linkid,
if (!(pdp->pd_flags & PD_AFTER_PERM))
continue;
if (prop_name != NULL &&
- strcasecmp(prop_name, pdp->pd_name) != 0)
+ prop_name != pdp->pd_name)
continue;
status = pdp->pd_set(handle, pdp, linkid, NULL,
0, flags, 0);
@@ -1240,9 +1255,12 @@ dladm_get_linkprop(dladm_handle_t handle, datalink_id_t linkid,
prop_val == NULL || val_cntp == NULL || *val_cntp == 0)
return (DLADM_STATUS_BADARG);
- for (i = 0; i < DLADM_MAX_PROPS; i++)
- if (strcasecmp(prop_name, prop_table[i].pd_name) == 0)
+ for (i = 0; i < DLADM_MAX_PROPS; i++) {
+ if (strcasecmp(prop_name, prop_table[i].pd_name) == 0) {
+ prop_name = prop_table[i].pd_name;
break;
+ }
+ }
if (i == DLADM_MAX_PROPS) {
if (prop_name[0] == '_') {
@@ -1372,9 +1390,12 @@ dladm_get_linkprop_values(dladm_handle_t handle, datalink_id_t linkid,
ret_val == NULL || val_cntp == NULL || *val_cntp == 0)
return (DLADM_STATUS_BADARG);
- for (pdp = prop_table; pdp < prop_table + DLADM_MAX_PROPS; pdp++)
- if (strcasecmp(prop_name, pdp->pd_name) == 0)
+ for (pdp = prop_table; pdp < prop_table + DLADM_MAX_PROPS; pdp++) {
+ if (strcasecmp(prop_name, pdp->pd_name) == 0) {
+ prop_name = pdp->pd_name;
break;
+ }
+ }
if (pdp == prop_table + DLADM_MAX_PROPS)
return (DLADM_STATUS_NOTFOUND);
diff --git a/usr/src/pkg/manifests/developer-debug-mdb.mf b/usr/src/pkg/manifests/developer-debug-mdb.mf
index df8ea7b2b0..af99982b2c 100644
--- a/usr/src/pkg/manifests/developer-debug-mdb.mf
+++ b/usr/src/pkg/manifests/developer-debug-mdb.mf
@@ -200,6 +200,7 @@ $(i386_ONLY)file path=usr/lib/mdb/kvm/$(ARCH64)/sata.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/scsi_vhci.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/sctp.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/sd.so group=sys mode=0555
+$(i386_ONLY)file path=usr/lib/mdb/kvm/$(ARCH64)/smbios.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/sockfs.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/specfs.so group=sys mode=0555
file path=usr/lib/mdb/kvm/$(ARCH64)/sppp.so group=sys mode=0555
diff --git a/usr/src/stand/lib/inet/ipv4.c b/usr/src/stand/lib/inet/ipv4.c
index 89efef62ad..f29625c15f 100644
--- a/usr/src/stand/lib/inet/ipv4.c
+++ b/usr/src/stand/lib/inet/ipv4.c
@@ -219,7 +219,7 @@ frag_chk(void)
ipp = fragment[first_frag].ipp;
for (i = 0; i < FRAG_MAX; i++) {
if (fragment[i].mp != NULL && ip_id != fragment[i].ipid &&
- fragment[i].ipp != ipp) {
+ fragment[i].ipp != ipp) {
#ifdef FRAG_DEBUG
printf("ipv4: Frag id mismatch: %x != %x\n",
fragment[i].ipid, ip_id);
@@ -342,7 +342,7 @@ ipv4_route(int cmd, uint8_t flag, struct in_addr *destp,
{
static int routing_table_initialized;
int index;
- uint8_t tmp_flag;
+ uint8_t tmp_flag;
if (gatewayp == NULL) {
errno = EINVAL;
@@ -383,8 +383,10 @@ ipv4_route(int cmd, uint8_t flag, struct in_addr *destp,
table[index].flag = RT_UNUSED;
table[index].dest.s_addr = htonl(INADDR_ANY);
table[index].gateway.s_addr = htonl(INADDR_ANY);
- } else
+ } else {
table[index].flag = RT_NG;
+ }
+ break;
default:
errno = EINVAL;
return (-1);
@@ -716,7 +718,7 @@ ipv4_try_again:
iphp = (struct ip *)igp->igm_mp->b_rptr;
if (iphp->ip_v != IPVERSION) {
dprintf("ipv4_input(%d): IPv%d datagram discarded\n",
- index, iphp->ip_v);
+ index, iphp->ip_v);
del_gram(&sockets[index].inq, igp, TRUE);
continue;
}
@@ -1080,7 +1082,7 @@ ipv4_tcp_output(int sock_id, mblk_t *pkt)
/* Routing necessary? */
if (((datagram.igm_oflags & MSG_DONTROUTE) == 0) &&
- ((iph->ip_dst.s_addr & netmask.s_addr) != mynet.s_addr)) {
+ ((iph->ip_dst.s_addr & netmask.s_addr) != mynet.s_addr)) {
if ((rip = ipv4_get_route(RT_HOST, &iph->ip_dst,
NULL)) == NULL) {
rip = ipv4_get_route(RT_DEFAULT, NULL, NULL);
@@ -1141,7 +1143,7 @@ again:
while ((c = *cp) != '\0') {
if (isdigit(c)) {
if ((c - '0') >= base)
- break;
+ break;
val = (val * base) + (c - '0');
cp++;
continue;
@@ -1186,20 +1188,20 @@ again:
case 2: /* a.b -- 8.24 bits */
if (parts[1] > 0xffffff)
- return ((uint32_t)-1);
+ return ((uint32_t)-1);
val = (parts[0] << 24) | (parts[1] & 0xffffff);
break;
case 3: /* a.b.c -- 8.8.16 bits */
if (parts[2] > 0xffff)
- return ((uint32_t)-1);
+ return ((uint32_t)-1);
val = (parts[0] << 24) | ((parts[1] & 0xff) << 16) |
- (parts[2] & 0xffff);
+ (parts[2] & 0xffff);
break;
case 4: /* a.b.c.d -- 8.8.8.8 bits */
if (parts[3] > 0xff)
- return ((uint32_t)-1);
+ return ((uint32_t)-1);
val = (parts[0] << 24) | ((parts[1] & 0xff) << 16) |
((parts[2] & 0xff) << 8) | (parts[3] & 0xff);
break;
diff --git a/usr/src/stand/lib/sock/socket.c b/usr/src/stand/lib/sock/socket.c
index 1da6a335c9..c8a466f1ef 100644
--- a/usr/src/stand/lib/sock/socket.c
+++ b/usr/src/stand/lib/sock/socket.c
@@ -25,8 +25,6 @@
* socket.c, Code implementing a simple socket interface.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include "socket_impl.h"
#include <sys/isa_defs.h>
@@ -85,7 +83,7 @@ so_check_fd(int fd, int *errno)
*
* Notes:
* Only PF_INET communication domains are supported. Within
- * this domain, only SOCK_RAW, SOCK_DGRAM and SOCK_STREAM types are
+ * this domain, only SOCK_RAW, SOCK_DGRAM and SOCK_STREAM types are
* supported.
*/
int
@@ -242,6 +240,7 @@ getsockopt(int s, int level, int option, void *optval, socklen_t *optlen)
*optlen = 0;
errno = EINVAL;
}
+ break;
default:
errno = ENOPROTOOPT;
break;
diff --git a/usr/src/uts/i86pc/io/imc/imc.c b/usr/src/uts/i86pc/io/imc/imc.c
index 25ba86061b..e1dbfbfc2e 100644
--- a/usr/src/uts/i86pc/io/imc/imc.c
+++ b/usr/src/uts/i86pc/io/imc/imc.c
@@ -932,6 +932,40 @@ imc_fixup_stubs(imc_t *imc)
}
/*
+ * In the wild we've hit a few odd cases where not all devices are exposed that
+ * we might expect by firmware. In particular we've seen and validate the
+ * following cases:
+ *
+ * o We don't find all of the channel devices that we expect, e.g. we have the
+ * stubs for channels 1-3, but not 0. That has been seen on an Intel S2600CW
+ * with an E5-2630v3.
+ */
+static boolean_t
+imc_validate_stubs(imc_t *imc)
+{
+ for (uint_t sock = 0; sock < imc->imc_nsockets; sock++) {
+ imc_socket_t *socket = &imc->imc_sockets[sock];
+
+ for (uint_t mc = 0; mc < socket->isock_nimc; mc++) {
+ imc_mc_t *mcp = &socket->isock_imcs[mc];
+
+ for (uint_t chan = 0; chan < mcp->icn_nchannels;
+ chan++) {
+ if (mcp->icn_channels[chan].ich_desc == NULL) {
+ dev_err(imc->imc_dip, CE_WARN,
+ "!missing device for socket %u/"
+ "imc %u/channel %u", sock, mc,
+ chan);
+ return (B_FALSE);
+ }
+ }
+ }
+ }
+
+ return (B_TRUE);
+}
+
+/*
* Attempt to map all of the discovered sockets to the corresponding APIC based
* socket. We do these mappings by getting the node id of the socket and
* adjusting it to make sure that no home agent is present in it. We use the
@@ -2194,6 +2228,11 @@ imc_attach_complete(void *arg)
goto done;
}
+ if (!imc_validate_stubs(imc)) {
+ imc->imc_flags |= IMC_F_VALIDATE_FAILED;
+ goto done;
+ }
+
imc_fixup_stubs(imc);
imc_map_sockets(imc);
diff --git a/usr/src/uts/i86pc/io/imc/imc.h b/usr/src/uts/i86pc/io/imc/imc.h
index 7d07be20af..5f3def4930 100644
--- a/usr/src/uts/i86pc/io/imc/imc.h
+++ b/usr/src/uts/i86pc/io/imc/imc.h
@@ -500,12 +500,13 @@ typedef enum {
IMC_F_SCAN_COMPLETE = (1 << 2),
IMC_F_ATTACH_DISPATCHED = (1 << 3),
IMC_F_ATTACH_COMPLETE = (1 << 4),
- IMC_F_MCREG_FAILED = (1 << 5)
+ IMC_F_MCREG_FAILED = (1 << 5),
+ IMC_F_VALIDATE_FAILED = (1 << 6)
} imc_flags_t;
#define IMC_F_ALL_FLAGS (IMC_F_UNSUP_PLATFORM | IMC_F_SCAN_DISPATCHED | \
IMC_F_SCAN_COMPLETE | IMC_F_ATTACH_DISPATCHED | IMC_F_ATTACH_COMPLETE | \
- IMC_F_MCREG_FAILED)
+ IMC_F_MCREG_FAILED | IMC_F_VALIDATE_FAILED)
typedef enum imc_dimm_type {
IMC_DIMM_UNKNOWN,
diff --git a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu_ioctl_uwp.c b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu_ioctl_uwp.c
index 5fb81a1b14..2f5e51f50e 100644
--- a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu_ioctl_uwp.c
+++ b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu_ioctl_uwp.c
@@ -221,7 +221,7 @@ oplmsu_uwioctl_ipunlink(queue_t *uwq, mblk_t *mp)
* When traditional_status isn't MSU_SETID,
* the error is reported.
*/
-
+ /* FALLTHROUGH */
default :
/*
* When upath->status isn't MSU_PSTAT_STOP or
diff --git a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_util.c b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_util.c
index e21639264a..af6af63644 100644
--- a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_util.c
+++ b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_util.c
@@ -137,7 +137,7 @@ free_pcmu_properties(pcmu_t *pcmu_p)
*/
int
pcmu_reloc_reg(dev_info_t *dip, dev_info_t *rdip, pcmu_t *pcmu_p,
- pci_regspec_t *rp)
+ pci_regspec_t *rp)
{
int assign_len, assign_entries, i;
pci_regspec_t *assign_p;
@@ -507,11 +507,11 @@ pcmu_cfg_report(dev_info_t *dip, ddi_fm_error_t *derr,
switch (pci_err_tbl[i].reg_bit) {
case PCI_STAT_R_MAST_AB:
- aux_msg = "Recieved Master Abort";
- /* LINTED fallthrough on case statement */
+ aux_msg = "Receieved Master Abort";
+ /* FALLTHROUGH */
case PCI_STAT_R_TARG_AB:
if (aux_msg != NULL)
- aux_msg = "Recieved Target Abort";
+ aux_msg = "Receieved Target Abort";
if (prierr) {
/*
* piow case are already handled in
@@ -675,7 +675,7 @@ pcmu_dflag_to_str_t pcmu_dflag_strings [] = {
void
pcmu_debug(uint64_t flag, dev_info_t *dip, char *fmt,
- uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
+ uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
{
char *s = "pcmu unknown";
uint_t cont = 0;
diff --git a/usr/src/uts/sun4u/os/plat_ecc_unum.c b/usr/src/uts/sun4u/os/plat_ecc_unum.c
index b7145b5f5b..cd6b278a01 100644
--- a/usr/src/uts/sun4u/os/plat_ecc_unum.c
+++ b/usr/src/uts/sun4u/os/plat_ecc_unum.c
@@ -853,6 +853,7 @@ plat_ecc_capability_sc_get(int type)
if (plat_ecc_capability_map_sc &
PLAT_ECC_CAPABILITY_DIMM_SID)
return (1);
+ /* FALLTHROUGH */
default:
return (0);
}
diff --git a/usr/src/uts/sun4v/io/dr_cpu.c b/usr/src/uts/sun4v/io/dr_cpu.c
index e980cb55de..3b6ce50835 100644
--- a/usr/src/uts/sun4v/io/dr_cpu.c
+++ b/usr/src/uts/sun4v/io/dr_cpu.c
@@ -411,7 +411,7 @@ dr_cpu_list_wrk(dr_cpu_hdr_t *req, dr_cpu_hdr_t **resp, int *resp_len)
case DR_CPU_FORCE_UNCONFIG:
drctl_flags = DRCTL_FLAG_FORCE;
force = B_TRUE;
- _NOTE(FALLTHROUGH)
+ /* FALLTHROUGH */
case DR_CPU_UNCONFIGURE:
dr_fn = dr_cpu_unconfigure;
drctl_cmd = DRCTL_CPU_UNCONFIG_REQUEST;
diff --git a/usr/src/uts/sun4v/io/drctl_impl.c b/usr/src/uts/sun4v/io/drctl_impl.c
index 4f9c71f943..45a3fdf5b1 100644
--- a/usr/src/uts/sun4v/io/drctl_impl.c
+++ b/usr/src/uts/sun4v/io/drctl_impl.c
@@ -124,7 +124,7 @@ retry:
switch (up_err) {
case EINTR:
DR_DBG_CTL("%s: door call returned EINTR\n", me);
- _NOTE(FALLTHROUGH)
+ /* FALLTHROUGH */
case EAGAIN:
/*
* Server process may be forking, try again.