summaryrefslogtreecommitdiff
path: root/usr/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/test')
-rw-r--r--usr/src/test/Makefile3
-rw-r--r--usr/src/test/crypto-tests/tests/modes/aes/ctr/aes_ctr.c2
-rw-r--r--usr/src/test/libc-tests/runfiles/default.run4
-rw-r--r--usr/src/test/libc-tests/tests/Makefile1
-rw-r--r--usr/src/test/libc-tests/tests/env-OS-4089.c73
-rw-r--r--usr/src/test/libc-tests/tests/random/Makefile10
-rw-r--r--usr/src/test/libc-tests/tests/random/chacha_tv.c4
-rw-r--r--usr/src/test/net-tests/Makefile20
-rw-r--r--usr/src/test/net-tests/cmd/Makefile36
-rw-r--r--usr/src/test/net-tests/cmd/nettest.ksh52
-rw-r--r--usr/src/test/net-tests/config/Makefile38
-rw-r--r--usr/src/test/net-tests/config/ip_forwarding.config22
-rw-r--r--usr/src/test/net-tests/runfiles/Makefile38
-rw-r--r--usr/src/test/net-tests/runfiles/default.run44
-rw-r--r--usr/src/test/net-tests/tests/Makefile42
-rw-r--r--usr/src/test/net-tests/tests/forwarding/Makefile67
-rw-r--r--usr/src/test/net-tests/tests/forwarding/README180
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_forwarding.ksh487
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_001.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_002.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_003.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_004.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_005.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_006.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_007.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_008.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_009.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_010.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_011.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_012.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_013.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_014.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_015.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_016.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_017.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_018.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_019.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_020.ksh22
-rw-r--r--usr/src/test/net-tests/tests/forwarding/ip_fwd_suite.ksh115
-rw-r--r--usr/src/test/net-tests/tests/net_common.ksh625
-rw-r--r--usr/src/test/os-tests/runfiles/default.run16
-rw-r--r--usr/src/test/os-tests/tests/Makefile61
-rw-r--r--usr/src/test/os-tests/tests/OS-6097.c74
-rw-r--r--usr/src/test/os-tests/tests/file-locking/Makefile9
-rw-r--r--[-rwxr-xr-x]usr/src/test/os-tests/tests/i386/ldt.c0
-rw-r--r--usr/src/test/os-tests/tests/imc/Makefile72
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test.c353
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test.h68
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_badaddr.c230
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_basic.c132
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_fail.c1494
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_rir.c856
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_sad.c3212
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_skx_loop.c175
-rw-r--r--usr/src/test/os-tests/tests/imc/imc_test_tad.c5228
-rw-r--r--usr/src/test/os-tests/tests/poll/Makefile4
-rw-r--r--usr/src/test/os-tests/tests/secflags/secflags_dts.sh8
-rw-r--r--usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh10
-rw-r--r--usr/src/test/os-tests/tests/timer/Makefile50
-rw-r--r--usr/src/test/os-tests/tests/timer/timer_limit.c83
-rw-r--r--usr/src/test/os-tests/tests/tmpfs/Makefile52
-rw-r--r--usr/src/test/os-tests/tests/tmpfs/tmpfs_badmount.ksh114
-rw-r--r--usr/src/test/os-tests/tests/tmpfs/tmpfs_enospc.ksh74
-rw-r--r--usr/src/test/os-tests/tests/tmpfs/tmpfs_full.c94
-rw-r--r--usr/src/test/smartos-test/Makefile49
-rw-r--r--usr/src/test/smartos-test/README103
-rwxr-xr-xusr/src/test/smartos-test/smartos-test.sh389
-rw-r--r--usr/src/test/test-runner/cmd/run60
-rw-r--r--usr/src/test/util-tests/runfiles/default.run5
-rw-r--r--usr/src/test/util-tests/tests/Makefile1
-rw-r--r--usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.awk2
-rw-r--r--usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.ok2
-rwxr-xr-xusr/src/test/util-tests/tests/awk/tests/T.misc4
-rw-r--r--usr/src/test/util-tests/tests/bunyan/Makefile68
-rw-r--r--usr/src/test/util-tests/tests/bunyan/btest.c316
-rw-r--r--usr/src/test/util-tests/tests/bunyan/bunyan.ksh26
-rw-r--r--usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.out3
-rw-r--r--usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s31
-rw-r--r--usr/src/test/util-tests/tests/dladm/Makefile2
-rw-r--r--usr/src/test/util-tests/tests/dladm/allowed-cids.ksh95
-rw-r--r--usr/src/test/util-tests/tests/dladm/allowed-ips.ksh43
-rw-r--r--usr/src/test/util-tests/tests/dladm/common.ksh57
-rw-r--r--usr/src/test/util-tests/tests/dladm/dynamic-methods.ksh45
-rw-r--r--usr/src/test/util-tests/tests/dladm/show-overlay-exit.ksh82
-rw-r--r--usr/src/test/util-tests/tests/dladm/vnic-mtu.ksh116
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh2
-rw-r--r--usr/src/test/util-tests/tests/libnvpair_json/Makefile19
-rw-r--r--usr/src/test/util-tests/tests/libnvpair_json/json_08_large_data.ksh37
-rw-r--r--usr/src/test/util-tests/tests/libnvpair_json/print_json.c2
-rw-r--r--usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh15
-rw-r--r--usr/src/test/zfs-tests/include/libtest.shlib7
-rw-r--r--usr/src/test/zfs-tests/runfiles/delphix.run4
-rw-r--r--usr/src/test/zfs-tests/runfiles/omnios.run3
-rw-r--r--usr/src/test/zfs-tests/runfiles/openindiana.run3
-rw-r--r--usr/src/test/zfs-tests/runfiles/smartos.run3
-rw-r--r--usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_dryrun.ksh169
-rw-r--r--usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh8
-rw-r--r--usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_002_neg.ksh51
-rw-r--r--usr/src/test/zfs-tests/tests/functional/mmp/mmp.cfg1
-rw-r--r--usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh5
-rw-r--r--usr/src/test/zfs-tests/tests/functional/slog/slog.cfg5
-rw-r--r--usr/src/test/zfs-tests/tests/functional/slog/slog_014_pos.ksh1
102 files changed, 16511 insertions, 95 deletions
diff --git a/usr/src/test/Makefile b/usr/src/test/Makefile
index fa57d36772..ad41f89400 100644
--- a/usr/src/test/Makefile
+++ b/usr/src/test/Makefile
@@ -12,6 +12,7 @@
#
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2019 Joyent, Inc.
#
.PARALLEL: $(SUBDIRS)
@@ -20,7 +21,9 @@ SUBDIRS = \
crypto-tests \
elf-tests \
libc-tests \
+ net-tests \
os-tests \
+ smartos-test \
smbclient-tests \
test-runner \
util-tests \
diff --git a/usr/src/test/crypto-tests/tests/modes/aes/ctr/aes_ctr.c b/usr/src/test/crypto-tests/tests/modes/aes/ctr/aes_ctr.c
index f5ef319478..fcaf042c10 100644
--- a/usr/src/test/crypto-tests/tests/modes/aes/ctr/aes_ctr.c
+++ b/usr/src/test/crypto-tests/tests/modes/aes/ctr/aes_ctr.c
@@ -27,7 +27,7 @@
* it has a remainder, so the result is different
* if len == 0 mod block_size vs len != 0 mod block_size
*/
-static size_t updatelens[] = { 16, CTEST_UPDATELEN_END };
+static size_t updatelens[] = { 16, 15, 17, CTEST_UPDATELEN_END };
int
main(void)
diff --git a/usr/src/test/libc-tests/runfiles/default.run b/usr/src/test/libc-tests/runfiles/default.run
index 64cdae5fcb..c2d08b54bc 100644
--- a/usr/src/test/libc-tests/runfiles/default.run
+++ b/usr/src/test/libc-tests/runfiles/default.run
@@ -71,6 +71,10 @@ timeout = 600
[/opt/libc-tests/tests/call_once.32]
[/opt/libc-tests/tests/call_once.64]
[/opt/libc-tests/tests/catopen]
+[/opt/libc-tests/tests/env-OS-4089.32]
+[/opt/libc-tests/tests/env-OS-4089.64]
+[/opt/libc-tests/tests/env-7076.32]
+[/opt/libc-tests/tests/env-7076.64]
[/opt/libc-tests/tests/endian.32]
[/opt/libc-tests/tests/endian.64]
[/opt/libc-tests/tests/env-7076.32]
diff --git a/usr/src/test/libc-tests/tests/Makefile b/usr/src/test/libc-tests/tests/Makefile
index f746498b0c..3342c04bc6 100644
--- a/usr/src/test/libc-tests/tests/Makefile
+++ b/usr/src/test/libc-tests/tests/Makefile
@@ -31,6 +31,7 @@ SUBDIRS = \
wctype
PROGS = \
+ env-OS-4089 \
aligned_alloc \
c11_threads \
c11_tss \
diff --git a/usr/src/test/libc-tests/tests/env-OS-4089.c b/usr/src/test/libc-tests/tests/env-OS-4089.c
new file mode 100644
index 0000000000..0f52201c79
--- /dev/null
+++ b/usr/src/test/libc-tests/tests/env-OS-4089.c
@@ -0,0 +1,73 @@
+/*
+ * 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 2016 Joyent, Inc.
+ */
+
+/*
+ * Regression test for OS-4089 where doing a putenv() call without an '=' sign
+ * may lead to a segmentation fault when doing a getenv() depending on the
+ * circumstances of the environment's layout. Verify putenv() mimics
+ * unsetenv().
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/debug.h>
+
+int
+main(void)
+{
+ if (putenv("FOO=bar") != 0) {
+ fprintf(stderr, "failed to put FOO into the environment: %s\n",
+ strerror(errno));
+ return (1);
+ }
+
+ if (getenv("FOO") == NULL) {
+ fprintf(stderr, "failed to retrieve FOO from the "
+ "environment!\n");
+ return (1);
+ }
+
+ VERIFY0(unsetenv("FOO"));
+
+ if (getenv("FOO") != NULL) {
+ fprintf(stderr, "Somehow retrieved FOO from the "
+ "environment after unsetenv()!\n");
+ return (1);
+ }
+
+ if (putenv("FOO=bar") != 0) {
+ fprintf(stderr, "failed to put FOO into the environment: %s\n",
+ strerror(errno));
+ return (1);
+ }
+
+ if (getenv("FOO") == NULL) {
+ fprintf(stderr, "failed to retrieve FOO from the "
+ "environment!\n");
+ return (1);
+ }
+
+ VERIFY0(putenv("FOO"));
+
+ if (getenv("FOO") != NULL) {
+ fprintf(stderr, "Somehow retrieved FOO from the "
+ "environment after putenv()!\n");
+ return (1);
+ }
+
+ return (0);
+}
diff --git a/usr/src/test/libc-tests/tests/random/Makefile b/usr/src/test/libc-tests/tests/random/Makefile
index ed480dacb9..c1a1a18e1f 100644
--- a/usr/src/test/libc-tests/tests/random/Makefile
+++ b/usr/src/test/libc-tests/tests/random/Makefile
@@ -17,7 +17,6 @@ include $(SRC)/Makefile.master
ROOTOPTPKG = $(ROOT)/opt/libc-tests
TESTDIR = $(ROOTOPTPKG)/tests/random
-ROOTBINDIR = $(ROOTOPTPKG)/bin
PROGS = arc4random \
arc4random_prefork \
@@ -74,17 +73,12 @@ arc4random_preforksig: arc4random_forksig.c
$(POST_PROCESS)
chacha: chacha_tv.c
- $(COMPILE.c) -DKEYSTREAM_ONLY -I$(SRC)/common/crypto/chacha -o chacha.o -c $(SRC)/common/crypto/chacha/chacha.c
+ $(COMPILE.c) -DKEYSTREAM_ONLY -I$(SRC)/common/crypto/chacha \
+ -o chacha.o -c $(SRC)/common/crypto/chacha/chacha.c
$(COMPILE.c) -I$(SRC)/common/crypto/chacha -o chacha_tv.o -c chacha_tv.c
$(LINK.c) -o $@ chacha_tv.o chacha.o $(LDLIBS)
$(POST_PROCESS)
-$(ROOTBINDIR):
- $(INS.dir)
-
-$(ROOTBINDIR)/%: %
- $(INS.file)
-
$(TESTDIR):
$(INS.dir)
diff --git a/usr/src/test/libc-tests/tests/random/chacha_tv.c b/usr/src/test/libc-tests/tests/random/chacha_tv.c
index 636ee114c8..a02c2905ab 100644
--- a/usr/src/test/libc-tests/tests/random/chacha_tv.c
+++ b/usr/src/test/libc-tests/tests/random/chacha_tv.c
@@ -10,7 +10,7 @@
*/
/*
- * Copyright (c) 2015, Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -285,7 +285,7 @@ chacha_test(uint8_t *key, uint8_t keylen, uint8_t *iv, uint8_t *bl0,
bzero(res0, sizeof (res0));
bzero(res1, sizeof (res1));
chacha_keysetup(&ctx, key, keylen * 8, 0);
- chacha_ivsetup(&ctx, iv);
+ chacha_ivsetup(&ctx, iv, NULL);
chacha_encrypt_bytes(&ctx, res0, res0, sizeof (res0));
chacha_encrypt_bytes(&ctx, res1, res1, sizeof (res1));
ret = bcmp(res0, bl0, sizeof (res0));
diff --git a/usr/src/test/net-tests/Makefile b/usr/src/test/net-tests/Makefile
new file mode 100644
index 0000000000..6536e70c59
--- /dev/null
+++ b/usr/src/test/net-tests/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 2019, Joyent Inc.
+#
+
+.PARALLEL: $(SUBDIRS)
+
+SUBDIRS = cmd config runfiles tests
+
+include $(SRC)/test/Makefile.com
diff --git a/usr/src/test/net-tests/cmd/Makefile b/usr/src/test/net-tests/cmd/Makefile
new file mode 100644
index 0000000000..b2770c84c6
--- /dev/null
+++ b/usr/src/test/net-tests/cmd/Makefile
@@ -0,0 +1,36 @@
+#
+# 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 2019 Joyent, Inc.
+#
+include $(SRC)/Makefile.master
+
+ROOTOPTPKG = $(ROOT)/opt/net-tests
+ROOTBIN = $(ROOTOPTPKG)/bin
+PROGS = nettest
+CMDS = $(PROGS:%=$(ROOTBIN)/%)
+$(CMDS) := FILEMODE = 0555
+
+include $(SRC)/test/Makefile.com
+
+install: $(CMDS)
+
+clobber: clean
+ $(RM) $(CMDS)
+
+$(CMDS): $(ROOTBIN)
+
+$(ROOTBIN):
+ $(INS.dir)
+
+$(ROOTBIN)/%: %.ksh
+ $(INS.rename)
diff --git a/usr/src/test/net-tests/cmd/nettest.ksh b/usr/src/test/net-tests/cmd/nettest.ksh
new file mode 100644
index 0000000000..e7d0e78865
--- /dev/null
+++ b/usr/src/test/net-tests/cmd/nettest.ksh
@@ -0,0 +1,52 @@
+#!/usr/bin/ksh
+
+#
+# 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 2019 Joyent, Inc.
+#
+
+export NET_TESTS="/opt/net-tests"
+runner="/opt/test-runner/bin/run"
+
+function fail
+{
+ echo $1 >&2
+ exit ${2:-1}
+}
+
+function find_runfile
+{
+ typeset distro=
+ if [[ -f $NET_TESTS/runfiles/default.run ]]; then
+ distro=default
+ fi
+
+ [[ -n $distro ]] && echo $NET_TESTS/runfiles/$distro.run
+}
+
+while getopts c: c; do
+ case $c in
+ 'c')
+ runfile=$OPTARG
+ [[ -f $runfile ]] || fail "Cannot read file: $runfile"
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+[[ -z $runfile ]] && runfile=$(find_runfile)
+[[ -z $runfile ]] && fail "Couldn't determine distro"
+
+$runner -c $runfile
+
+exit $?
diff --git a/usr/src/test/net-tests/config/Makefile b/usr/src/test/net-tests/config/Makefile
new file mode 100644
index 0000000000..c1d3f8c285
--- /dev/null
+++ b/usr/src/test/net-tests/config/Makefile
@@ -0,0 +1,38 @@
+#
+# 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 2019 Joyent, Inc.
+#
+
+include $(SRC)/Makefile.master
+
+CFGS = ip_forwarding.config
+ROOTOPTPKG = $(ROOT)/opt/net-tests
+ROOTOPTPKGCFG = $(ROOT)/opt/net-tests/config
+ROOTOPTPKGDIRS = $(ROOTOPTPKG) $(ROOTOPTPKGCFG)
+FILES = $(CFGS:%=$(ROOTOPTPKGCFG)/%)
+$(FILES) := FILEMODE = 0555
+
+include $(SRC)/test/Makefile.com
+
+all: $(CFGS)
+
+install: $(ROOTOPTPKG) $(ROOTOPTPKGCFG) $(FILES)
+
+clobber: clean
+ $(RM) $(FILES)
+
+$(ROOTOPTPKGDIRS):
+ $(INS.dir)
+
+$(ROOTOPTPKGCFG)/%: % $(ROOTOPTPKGDIRS)
+ $(INS.file)
diff --git a/usr/src/test/net-tests/config/ip_forwarding.config b/usr/src/test/net-tests/config/ip_forwarding.config
new file mode 100644
index 0000000000..4a839cd49d
--- /dev/null
+++ b/usr/src/test/net-tests/config/ip_forwarding.config
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+#
+# See the tests/forwarding/README file for information about how to
+# configure and run the tests.
+#
+export NT_CLIENT=client_zone_name
+export NT_ROUTER=router_zone_name
+export NT_SERVER=server_zone_name
diff --git a/usr/src/test/net-tests/runfiles/Makefile b/usr/src/test/net-tests/runfiles/Makefile
new file mode 100644
index 0000000000..d50a8deebf
--- /dev/null
+++ b/usr/src/test/net-tests/runfiles/Makefile
@@ -0,0 +1,38 @@
+#
+# 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 2019 Joyent, Inc.
+#
+include $(SRC)/Makefile.master
+
+SRCS = default.run
+ROOTOPTPKG = $(ROOT)/opt/net-tests
+RUNFILES = $(ROOTOPTPKG)/runfiles
+CMDS = $(SRCS:%=$(RUNFILES)/%)
+$(CMDS) := FILEMODE = 0444
+
+include $(SRC)/test/Makefile.com
+
+all: $(SRCS)
+
+install: $(CMDS)
+
+clobber: clean
+ $(RM) $(CMDS)
+
+$(CMDS): $(RUNFILES) $(SRCS)
+
+$(RUNFILES):
+ $(INS.dir)
+
+$(RUNFILES)/%: %
+ $(INS.file)
diff --git a/usr/src/test/net-tests/runfiles/default.run b/usr/src/test/net-tests/runfiles/default.run
new file mode 100644
index 0000000000..c5c6c7dc91
--- /dev/null
+++ b/usr/src/test/net-tests/runfiles/default.run
@@ -0,0 +1,44 @@
+#
+# 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 2019 Joyent, Inc.
+#
+
+[DEFAULT]
+outputdir = /var/tmp/test_results
+quiet = False
+timeout = 60
+
+[/opt/net-tests/tests/forwarding]
+tests = [
+ 'ip_fwd_001',
+ 'ip_fwd_002',
+ 'ip_fwd_003',
+ 'ip_fwd_004',
+ 'ip_fwd_005',
+ 'ip_fwd_006',
+ 'ip_fwd_007',
+ 'ip_fwd_008',
+ 'ip_fwd_009',
+ 'ip_fwd_010',
+ 'ip_fwd_011',
+ 'ip_fwd_012',
+ 'ip_fwd_013',
+ 'ip_fwd_014',
+ 'ip_fwd_015',
+ 'ip_fwd_016',
+ 'ip_fwd_017',
+ 'ip_fwd_018',
+ 'ip_fwd_019',
+ 'ip_fwd_020'
+ ]
+user = root
diff --git a/usr/src/test/net-tests/tests/Makefile b/usr/src/test/net-tests/tests/Makefile
new file mode 100644
index 0000000000..2712d62751
--- /dev/null
+++ b/usr/src/test/net-tests/tests/Makefile
@@ -0,0 +1,42 @@
+#
+# 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 2019 Joyent, Inc.
+#
+include $(SRC)/Makefile.master
+include $(SRC)/cmd/Makefile.cmd
+
+SUBDIRS = forwarding
+SCRIPTS = net_common
+ROOTOPTPKG = $(ROOT)/opt/net-tests
+TESTDIR = $(ROOTOPTPKG)/tests
+CMDS = $(SCRIPTS:%=$(TESTDIR)/%)
+FILEMODE=0444
+$(CMDS) := FILEMODE = 0555
+
+include $(SRC)/test/Makefile.com
+
+install: $(CMDS)
+
+clobber: clean
+ $(RM) $(CMDS)
+
+$(CMDS): $(TESTDIR)
+
+$(TESTDIR):
+ $(INS.dir)
+
+$(TESTDIR)/%: %
+ $(INS.file)
+
+$(TESTDIR)/%: %.ksh
+ $(INS.rename)
diff --git a/usr/src/test/net-tests/tests/forwarding/Makefile b/usr/src/test/net-tests/tests/forwarding/Makefile
new file mode 100644
index 0000000000..566db8c86d
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/Makefile
@@ -0,0 +1,67 @@
+#
+# 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 2019 Joyent, Inc.
+#
+include $(SRC)/Makefile.master
+include $(SRC)/cmd/Makefile.cmd
+
+ROOTOPTPKG = $(ROOT)/opt/net-tests
+TESTDIR = $(ROOTOPTPKG)/tests/forwarding
+
+PROG = \
+ ip_forwarding \
+ ip_fwd_suite \
+ ip_fwd_001 \
+ ip_fwd_002 \
+ ip_fwd_003 \
+ ip_fwd_004 \
+ ip_fwd_005 \
+ ip_fwd_006 \
+ ip_fwd_007 \
+ ip_fwd_008 \
+ ip_fwd_009 \
+ ip_fwd_010 \
+ ip_fwd_011 \
+ ip_fwd_012 \
+ ip_fwd_013 \
+ ip_fwd_014 \
+ ip_fwd_015 \
+ ip_fwd_016 \
+ ip_fwd_017 \
+ ip_fwd_018 \
+ ip_fwd_019 \
+ ip_fwd_020
+
+DOC = $(TESTDIR)/README
+
+CMDS = $(PROG:%=$(TESTDIR)/%)
+FILEMODE=0444
+$(CMDS) := FILEMODE = 0555
+
+include $(SRC)/test/Makefile.com
+
+install: $(CMDS) $(DOC)
+
+clobber: clean
+ $(RM) $(CMDS) $(DOC)
+
+$(CMDS) $(DOC): $(TESTDIR)
+
+$(TESTDIR):
+ $(INS.dir)
+
+$(TESTDIR)/%: %
+ $(INS.file)
+
+$(TESTDIR)/%: %.ksh
+ $(INS.rename)
diff --git a/usr/src/test/net-tests/tests/forwarding/README b/usr/src/test/net-tests/tests/forwarding/README
new file mode 100644
index 0000000000..b291d5d45b
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/README
@@ -0,0 +1,180 @@
+Running
+-------
+
+* Create three native zones and start them.
+
+* Edit config/ip_forwarding.config, entering the names of the zones
+ you created.
+
+* Run /opt/net-tests/bin/nettest.
+
+Overview
+--------
+
+The tests in this directory test the IP forwarding path under several
+different variations. All tests require three zones. The tests use
+these three zones, along with the simnet driver, to emulate a real IP
+forwarding scenario involving multiple hosts. All tests verify that
+TCP, UDP, ICMP, IPv4/IPv6, and fragmented IPv4/IPv6 traffic can cross
+the IP forwarding datapath. Each test differs in its emulation of
+various hardware offload features (which would typically be presented
+by real NICs). The diagrams below gives a visual representation of the
+situations we are testing and shows how the test components relate to
+each other.
+
+no mac-loopback
+---------------
+
+In this configuration we make sure that the packet travels from server
+to router via "the wire".
+
+ +----------------------------+
++----------------------------+ |router zone |
+|client zone | | +-------------------------+|
+|(ipft_client_nic0) | | |ipft_router_nic0 ||
+| +----------------------+ | | |+----------------------+ ||
+| |ipft_client0 | | | ||ipft_client_r0 | ||
+| |192.168.77.2 |<-+-- Wire --+->|192.168.77.1 | ||
+| |fd00:0:1:4d::2 | | | ||fd00:0:1:4d::1 | ||
+| +----------------------+ | | |+----------------------+ ||
++----------------------------+ | +-------------------------+|
+ | ^ |
+ | | |
+ | | |
+ | | |
+ | | |
+ | IP | |
+ | forwarding | |
+ | | |
+ | | |
+ | | |
++----------------------------+ | v |
+|server zone | |+-------------------------+ |
+|(ipft_server_nic0) | ||ipft_router_nic1 | |
+| +----------------------+ | || +----------------------+| |
+| |ipft_server0 | | || |ipft_server_r0 || |
+| |VLAN 5 | | Wire || |VLAN 5 || |
+| |192.168.88.2 |<-+----------++>|192.168.88.1 || |
+| |fd00:0:1:58::2 | | || |fd00:0:1:58::1 || |
+| +----------------------+ | || +----------------------+| |
++----------------------------+ |+-------------------------+ |
+ +----------------------------+
+
+mac-loopback
+------------
+
+In this configuration we make sure that the packet travels from server
+to router via mac-loopback.
+
+ +----------------------------+
++----------------------------+ |router zone |
+|client zone | | +-------------------------+|
+|(ipft_nic0) | | |ipft_nic1 ||
+| +----------------------+ | | |+----------------------+ ||
+| |ipft_client0 | | | ||ipft_client_r0 | ||
+| |192.168.77.2 |<-+-- Wire --+->|192.168.77.1 | ||
+| |fd00:0:1:4d::2 | | | ||fd00:0:1:4d::1 | ||
+| +----------------------+ | | |+----------------------+ ||
++----------------------------+ | +-------------------------+|
+ | ^ |
+ | | |
+ | | |
+ | | |
+ | | |
+ | IP | |
+ | forwarding | |
+ | | |
+ | | |
+ | | |
++----------------------------+ | v |
+|server zone | |+-------------------------+ |
+|(ipft_nic1) | ||ipft_nic1 | |
+| +----------------------+ | || +----------------------+| |
+| |ipft_server0 | | MAC || |ipft_server_r0 || |
+| |VLAN 5 | | loopback || |VLAN 5 || |
+| |192.168.88.2 |<-+----------++>|192.168.88.1 || |
+| |fd00:0:1:58::2 | | || |fd00:0:1:58::1 || |
+| +----------------------+ | || +----------------------+| |
++----------------------------+ |+-------------------------+ |
+ +----------------------------+
+
+Requirements
+------------
+
+* These tests are currently SmartOS specific as they rely on simnet
+ extensions only found in illumos-joyent.
+
+* The client and server zones must provide `/usr/bin/socat`. It would
+ be nice to use netcat but our native version is missing features
+ like connection timeout.
+
+* The user must both create and start the three required zones.
+
+* All three zones should be native zones.
+
+* You must edit the ip_forwarding.config file; providing it with the
+ names of the zones you have created.
+
+Files
+-----
+
+ip_fowarding
+
+ The main test script; it provides the logic for all the tests
+ below. The different test variations are controlled by options
+ and it takes the three zones as arguments. This script may be
+ run by hand but it's easier to use ip_fwd_suite for that
+ purpose.
+
+ip_fwd_suite
+
+ This script runs the various configurations of the IP
+ forwarding test suite. You can run the entire suite or just a
+ single test via the '-n' option. The "Test Matrix" section
+ below gives an overview of all the tests in the suite.
+
+ip_fwd_XXX
+
+ These scripts are mostly here to work around the fact that the
+ test-runner cannot pass arguments to individual tests. In
+ order to avoid running everything as the "ip_fwd_suite" test,
+ we create a file for each configuration. This gives individual
+ reporting of each test and steers us clear of tripping the
+ timeout. You can also run these scripts by hand like so:
+
+ NET_TESTS=/opt/net-tests /opt/net-tests/tests/forwarding/ip_fwd_001
+
+config/ip_forwarding.config
+
+ This file must be modified to contain the names of the zones
+ the user crated for running these tests.
+
+Test Matrix
+-----------
+
+This is a breakdown of all the tests in the IP forwarding test suite.
+If a given offload is enabled or disable, it is done so for all
+interfaces involved in the test.
+
+NAME Tx IP Tx ULP LSO Rx IP mac-loopback
+001 off none off off no
+002 on partial off off no
+003 on partial on off no
+004 on fullv4 off off no
+005 on fullv4 on off no
+006 off none off on no
+007 on partial off on no
+008 on partial on on no
+009 on fullv4 off on no
+010 on fullv4 on on no
+
+011 off none off off yes
+012 on partial off off yes
+013 on partial on off yes
+014 on fullv4 off off yes
+015 on fullv4 on off yes
+016 off none off on yes
+017 on partial off on yes
+018 on partial on on yes
+019 on fullv4 off on yes
+020 on fullv4 on on yes
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_forwarding.ksh b/usr/src/test/net-tests/tests/forwarding/ip_forwarding.ksh
new file mode 100644
index 0000000000..d93260f86d
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_forwarding.ksh
@@ -0,0 +1,487 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+#
+# Usage:
+#
+# ip_forwarding.ksh -bcflnpuv <client> <router> <server>
+#
+# Where client, router, and server are the UUIDs of three native
+# zones. The user must create and start these zones; but other
+# than that there is no special configuration required for them.
+#
+# -b Place server and router on same underlying simnet, causing
+# them to talk via MAC-loopback.
+#
+# -c Run cleanup only.
+#
+# -f Enable Tx ULP hardware checksum.
+#
+# -l Enable TCP LSO.
+#
+# -n No cleanup: the various artifacts created by this script will
+# remain after execution.
+#
+# -p Enabled partial Tx ULP hardware checksum.
+#
+# -r Enable Rx IPv4 header checksum offload.
+#
+# -u Run UDP tests.
+#
+# -v Vebose mode.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+. $NET_TESTS/tests/net_common
+
+function cleanup
+{
+ if ((nt_cleanup == 0)); then
+ dbg "skipping cleanup"
+ return 0
+ fi
+
+ rm -rf ${nt_tdirprefix}*
+ zlogin $nt_client rm -rf ${nt_tdirprefix}*
+ zlogin $nt_server rm -rf ${nt_tdirprefix}*
+
+ rm_route $nt_client $nt_server_ip $nt_server_subnet $nt_client_router_ip
+ rm_route $nt_server $nt_client_ip $nt_client_subnet $nt_server_router_ip
+ rm_route6 $nt_client $nt_server_ip6 $nt_server_subnet6 \
+ $nt_client_router_ip6
+ rm_route6 $nt_server $nt_client_ip6 $nt_client_subnet6 \
+ $nt_server_router_ip6
+
+ ip_fwd_disable $nt_router
+
+ delete_addr $nt_client ipft_client0 v4
+ delete_addr $nt_router ipft_client_r0 v4
+ delete_addr $nt_router ipft_server_r0 v4
+ delete_addr $nt_server ipft_server0 v4
+
+ delete_addr $nt_client ipft_client0 v6
+ delete_addr $nt_router ipft_client_r0 v6
+ delete_addr $nt_router ipft_server_r0 v6
+ delete_addr $nt_server ipft_server0 v6
+
+ delete_if $nt_client ipft_client0
+ delete_if $nt_router ipft_client_r0
+ delete_if $nt_router ipft_server_r0
+ delete_if $nt_server ipft_server0
+
+ delete_vnic ipft_client0 0 $nt_client
+ delete_vnic ipft_client_r0 0 $nt_router
+ delete_vnic ipft_server_r0 5 $nt_router
+ delete_vnic ipft_server0 5 $nt_server
+
+ for nt_name in ${nt_nics[@]}; do
+ delete_simnet $nt_name
+ done
+}
+
+function usage
+{
+ echo "$nt_tname -bcflnpruv <client> <router> <server>" >&2
+}
+
+#
+# Set test defaults.
+#
+nt_tname=${NT_TNAME:-$(basename $0)}
+nt_loopback=0
+nt_ulp_full=0
+nt_ulp_partial=0
+nt_tcp_lso=0
+nt_udp=0
+nt_rx_ip_cksum=0
+nt_cleanup=1
+nt_cleanup_only=0
+
+nt_tdirprefix=/tmp/${nt_tname}
+nt_tdir=${nt_tdirprefix}.$$
+nt_dfile=${nt_tdir}/${nt_tname}.data
+nt_efile=${nt_tdir}/${nt_tname}-expected-sha1
+nt_rfile=${nt_tdir}/${nt_tname}-received-sha1
+nt_ofile=${nt_tdir}/${nt_tname}-received
+nt_client_subnet=192.168.77.0/24
+nt_client_ip=192.168.77.2
+nt_client_router_ip=192.168.77.1
+nt_server_subnet=192.168.88.0/24
+nt_server_ip=192.168.88.2
+nt_server_router_ip=192.168.88.1
+nt_port=7774
+nt_client_subnet6=fd00:0:1:4d::2/64
+nt_client_ip6=fd00:0:1:4d::2
+nt_client_router_ip6=fd00:0:1:4d::1
+nt_server_subnet6=fd00:0:1:58::/64
+nt_server_router_ip6=fd00:0:1:58::1
+nt_server_ip6=fd00:0:1:58::2
+nt_port6=7776
+nt_bridge=ipft_switch
+typeset -A nt_nics
+
+while getopts "bcflnpruv" opt; do
+ case $opt in
+ b)
+ nt_loopback=1
+ ;;
+ c)
+ nt_cleanup_only=1
+ ;;
+ f)
+ nt_ulp_full=1
+ ;;
+ l)
+ nt_tcp_lso=1
+ ;;
+ n)
+ nt_cleanup=0
+ ;;
+ p)
+ nt_ulp_partial=1
+ ;;
+ r)
+ nt_rx_ip_cksum=1
+ ;;
+ u)
+ nt_udp=1
+ ;;
+ v)
+ DEBUG=1
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+if ((nt_ulp_partial == 1)) && ((nt_ulp_full == 1)); then
+ fail "both partial and full checksum enabled"
+fi
+
+if (( $# != 3 )); then
+ usage
+ fail "wrong number of arguments"
+fi
+
+nt_client=$1
+nt_router=$2
+nt_server=$3
+
+if [[ "$nt_client" == "$nt_router" || "$nt_router" == "$nt_server" ||
+ "$nt_client" == "$nt_server" ]]; then
+ fail "all zones must be unique"
+fi
+
+dbg "client zone: $nt_client"
+dbg "router zone: $nt_router"
+dbg "server zone: $nt_server"
+
+BAIL=1
+zone_exists $nt_client || fail "zone $nt_client not found"
+zone_exists $nt_router || fail "zone $nt_router not found"
+zone_exists $nt_server || fail "zone $nt_server not found"
+
+zone_running $nt_client
+zone_running $nt_router
+zone_running $nt_server
+
+if ! zlogin $nt_client ls /usr/bin/socat > /dev/null; then
+ fail "zone $nt_client missing socat"
+fi
+
+if ! zlogin $nt_server ls /usr/bin/socat > /dev/null; then
+ fail "zone $nt_client missing socat"
+fi
+
+if ((nt_loopback == 0)); then
+ nt_nics[0]=ipft_client_nic0
+ nt_nics[1]=ipft_router_nic0
+ nt_nics[2]=ipft_router_nic1
+ nt_nics[3]=ipft_server_nic0
+else
+ nt_nics[0]=ipft_nic0
+ nt_nics[1]=ipft_nic1
+fi
+
+#
+# Make a best effort to cleanup artifacts from a previous run.
+#
+if ((nt_cleanup_only == 1)); then
+ dbg "performing cleanup only"
+ BAIL=0
+ cleanup
+ BAIL=1
+ exit 0
+fi
+
+mkdir $nt_tdir
+zlogin $nt_client mkdir $nt_tdir
+zlogin $nt_server mkdir $nt_tdir
+
+trap cleanup ERR
+
+for nt_name in ${nt_nics[@]}; do
+ create_simnet $nt_name
+done
+
+if ((nt_loopback == 0)); then
+ link_simnets ${nt_nics[0]} ${nt_nics[1]}
+ link_simnets ${nt_nics[2]} ${nt_nics[3]}
+else
+ link_simnets ${nt_nics[0]} ${nt_nics[1]}
+fi
+
+for nt_name in ${nt_nics[@]}; do
+ if ((nt_ulp_partial == 1)); then
+ set_linkprop $nt_name _tx_ulp_cksum partial
+ fi
+
+ if ((nt_ulp_full == 1)); then
+ set_linkprop $nt_name _tx_ulp_cksum fullv4
+ fi
+
+ if ((nt_ulp_full == 1)) || ((nt_ulp_partial == 1)); then
+ set_linkprop $nt_name _tx_ipv4_cksum on
+ fi
+
+ if ((nt_tcp_lso == 1)); then
+ set_linkprop $nt_name _lso on
+ fi
+
+ if ((nt_rx_ip_cksum == 1)); then
+ set_linkprop $nt_name _rx_ipv4_cksum on
+ fi
+done
+
+if ((nt_loopback == 0)); then
+ create_vnic ipft_client0 ipft_client_nic0 0 $nt_client
+ create_vnic ipft_client_r0 ipft_router_nic0 0 $nt_router
+ create_vnic ipft_server_r0 ipft_router_nic1 5 $nt_router
+ create_vnic ipft_server0 ipft_server_nic0 5 $nt_server
+else
+ create_vnic ipft_client0 ipft_nic0 0 $nt_client
+ create_vnic ipft_client_r0 ipft_nic1 0 $nt_router
+ create_vnic ipft_server_r0 ipft_nic1 5 $nt_router
+ create_vnic ipft_server0 ipft_nic1 5 $nt_server
+fi
+
+ip_fwd_enable $nt_router
+
+create_addr $nt_client ipft_client0 $nt_client_ip/24
+create_addr $nt_router ipft_client_r0 $nt_client_router_ip/24
+create_addr $nt_router ipft_server_r0 $nt_server_router_ip/24
+create_addr $nt_server ipft_server0 $nt_server_ip/24
+
+add_route $nt_client $nt_server_ip $nt_server_subnet $nt_client_router_ip
+add_route $nt_server $nt_client_ip $nt_client_subnet $nt_server_router_ip
+
+create_addr6 $nt_client ipft_client0 $nt_client_ip6
+create_addr6 $nt_router ipft_client_r0 $nt_client_router_ip6
+create_addr6 $nt_router ipft_server_r0 $nt_server_router_ip6
+create_addr6 $nt_server ipft_server0 $nt_server_ip6
+
+add_route6 $nt_client $nt_server_ip6 $nt_server_subnet6 $nt_client_router_ip6
+add_route6 $nt_server $nt_client_ip6 $nt_client_subnet6 $nt_server_router_ip6
+
+dd if=/dev/urandom of=$nt_dfile bs=1024 count=1024 > /dev/null 2>&1
+if (($? != 0)); then
+ fail "failed to create data file: $nt_dfile"
+else
+ dbg "created data file: $nt_dfile"
+fi
+
+digest -a sha1 $nt_dfile > $nt_efile
+
+# ================================================================
+# client -> server
+# ================================================================
+ping $nt_client $nt_client_ip $nt_server_ip
+ping $nt_client $nt_client_ip6 $nt_server_ip6
+
+start_server $nt_server TCP4 $nt_server_ip $nt_port $nt_ofile
+nt_listener_ppid=$!
+
+# Give the server time to start.
+sleep 1
+
+dbg "sending 1M $nt_client ($nt_client_ip) -> $nt_server ($nt_server_ip)"
+zlogin $nt_client /usr/bin/socat -b 8192 STDIN \
+ TCP4:$nt_server_ip:$nt_port,connect-timeout=5 < $nt_dfile
+
+if (($? != 0)); then
+ pkill -TERM -P $nt_listener_ppid
+ fail "failed to run socat client"
+else
+ dbg "sent 1M $nt_client ($nt_client_ip) -> $nt_server ($nt_server_ip)"
+fi
+
+#
+# The client may have exited but make sure to give the server time to
+# exit and finish computing the SHA1.
+#
+dbg "waiting for listener $nt_listener_ppid"
+wait_for_pid $nt_listener_ppid 5
+dbg "listener $nt_listener_ppid exited"
+
+digest -a sha1 /zones/$nt_server/root/$nt_ofile > $nt_rfile
+
+if ! diff $nt_efile $nt_rfile; then
+ fail "SHA1 comparison failed"
+else
+ dbg "SHA1 comparison passed"
+fi
+
+start_server $nt_server TCP6 $nt_server_ip6 $nt_port6 $nt_rfile
+listener_ppid=$!
+
+# Give the server time to start.
+sleep 1
+
+zlogin $nt_client /usr/bin/socat -b 8192 STDIN \
+ TCP6:[${nt_server_ip6}]:$nt_port6,connect-timeout=5 < $nt_dfile
+
+if (($? != 0)); then
+ pkill -TERM -P $nt_listener_ppid
+ fail "failed to run socat client IPv6"
+else
+ dbg "sent 1M $nt_client ($nt_client_ip6)" \
+ "-> $nt_server ($nt_server_ip6) IPv6"
+fi
+
+#
+# The client may have exited but make sure to give the server time to
+# exit and finish computing the SHA1.
+#
+dbg "waiting for listener $nt_listener_ppid"
+wait_for_pid $nt_listener_ppid 5
+dbg "listener $nt_listener_ppid exited"
+
+digest -a sha1 /zones/$nt_server/root/$nt_ofile > $nt_rfile
+
+if ! diff $nt_efile $nt_rfile; then
+ fail "SHA1 comparison failed"
+else
+ dbg "SHA1 comparison passed"
+fi
+
+if ((nt_udp == 1)); then
+ ping_udp $nt_client $nt_client_ip $nt_server_ip 256 3
+ ping_udp $nt_client $nt_client_ip6 $nt_server_ip6 256 3
+
+ #
+ # Test IP fragmentation by sending a larger-than-MTU datagram.
+ # You can verify fragmentation is happening by dtracing the
+ # various "Frag" and "Reasm" mibs.
+ #
+ dbg "test IP fragmentation $nt_client_ip -> $nt_server_ip"
+ ping_udp $nt_client $nt_client_ip $nt_server_ip $((1024 * 16)) 3
+
+ dbg "test IPv6 fragmentation $nt_client_ip6 -> $nt_server_ip6"
+ ping_udp $nt_client $nt_client_ip6 $nt_server_ip6 $((1024 * 16)) 3
+fi
+
+# ================================================================
+# server -> client
+# ================================================================
+ping $nt_server $nt_server_ip $nt_client_ip
+ping $nt_server $nt_server_ip6 $nt_client_ip6
+
+start_server $nt_client TCP4 $nt_client_ip $nt_port $nt_ofile
+nt_listener_ppid=$!
+
+# Give the listener time to start.
+sleep 1
+
+zlogin $nt_server /usr/bin/socat -b 8192 STDIN \
+ TCP4:$nt_client_ip:$nt_port,bind=$nt_server_ip,connect-timeout=5 \
+ < $nt_dfile
+
+if (($? != 0)); then
+ pkill -TERM -P $nt_listener_ppid
+ fail "failed to run socat client"
+else
+ dbg "sent 1M $nt_server ($nt_server_ip) -> $nt_client ($nt_client_ip)"
+fi
+
+#
+# The client may have exited but make sure to give the server time to
+# exit and finish computing the SHA1.
+#
+dbg "waiting for listener $nt_listener_ppid"
+wait_for_pid $nt_listener_ppid 5
+dbg "listener $nt_listener_ppid exited"
+
+digest -a sha1 /zones/$nt_client/root/$nt_ofile > $nt_rfile
+
+if ! diff $nt_efile $nt_rfile; then
+ fail "SHA1 comparison failed"
+else
+ dbg "SHA1 comparison passed"
+fi
+
+start_server $nt_client TCP6 $nt_client_ip6 $nt_port6 $nt_ofile
+nt_listener_ppid=$!
+
+# Give the listener time to start.
+sleep 1
+
+zlogin $nt_server /usr/bin/socat -b 8192 STDIN \
+ TCP6:[$nt_client_ip6]:$nt_port6,connect-timeout=5 < $nt_dfile
+
+if (($? != 0)); then
+ pkill -TERM -P $nt_listener_ppid
+ fail "failed to run socat client IPv6"
+else
+ dbg "sent 1M $nt_server ($nt_server_ip6) -> $nt_client ($nt_client_ip6)"
+fi
+
+#
+# The client may have exited but make sure to give the server time to
+# exit and finish computing the SHA1.
+#
+dbg "waiting for listener $nt_listener_ppid"
+wait_for_pid $nt_listener_ppid 5
+dbg "server $nt_listener_ppid exited"
+
+digest -a sha1 /zones/$nt_client/root/$nt_ofile > $nt_rfile
+
+if ! diff $nt_efile $nt_rfile; then
+ fail "SHA1 comparison failed"
+else
+ dbg "SHA1 comparison passed"
+fi
+
+if ((nt_udp == 1)); then
+ ping_udp $nt_server $nt_server_ip $nt_client_ip 256 3
+ ping_udp $nt_server $nt_server_ip6 $nt_client_ip6 256 3
+
+ #
+ # Test IP fragmentation by sending a larger-than-MTU datagram.
+ # You can verify fragmentation is happening by dtracing the
+ # various "Frag" and "Reasm" mibs.
+ #
+ dbg "test IP fragmentation $nt_server_ip -> $nt_client_ip"
+ ping_udp $nt_server $nt_server_ip $nt_client_ip $((1024 * 16)) 3
+
+ dbg "test IPv6 fragmentation $nt_server_ip6 -> $nt_client_ip6"
+ ping_udp $nt_server $nt_server_ip6 $nt_client_ip6 $((1024 * 16)) 3
+fi
+
+cleanup
+echo "PASS [$nt_tname]"
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_001.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_001.ksh
new file mode 100644
index 0000000000..9f6c98d1b3
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_001.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 001
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_002.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_002.ksh
new file mode 100644
index 0000000000..06e5ec53ed
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_002.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 002
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_003.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_003.ksh
new file mode 100644
index 0000000000..ce84bc0866
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_003.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 003
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_004.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_004.ksh
new file mode 100644
index 0000000000..b5fa65ccd1
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_004.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 004
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_005.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_005.ksh
new file mode 100644
index 0000000000..9bbd536e19
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_005.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 005
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_006.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_006.ksh
new file mode 100644
index 0000000000..2267072a3d
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_006.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 006
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_007.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_007.ksh
new file mode 100644
index 0000000000..a0380eb92e
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_007.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 007
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_008.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_008.ksh
new file mode 100644
index 0000000000..aed5438f63
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_008.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 008
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_009.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_009.ksh
new file mode 100644
index 0000000000..8a0fa9674c
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_009.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 009
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_010.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_010.ksh
new file mode 100644
index 0000000000..3c45225597
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_010.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 010
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_011.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_011.ksh
new file mode 100644
index 0000000000..62785ff33e
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_011.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 011
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_012.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_012.ksh
new file mode 100644
index 0000000000..c09cd77258
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_012.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 012
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_013.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_013.ksh
new file mode 100644
index 0000000000..e3cc833f53
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_013.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 013
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_014.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_014.ksh
new file mode 100644
index 0000000000..6bd76de190
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_014.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 014
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_015.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_015.ksh
new file mode 100644
index 0000000000..d3b1e2fe1d
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_015.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 015
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_016.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_016.ksh
new file mode 100644
index 0000000000..aa5903cbe4
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_016.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 016
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_017.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_017.ksh
new file mode 100644
index 0000000000..38615b9f94
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_017.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 017
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_018.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_018.ksh
new file mode 100644
index 0000000000..e010141458
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_018.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 018
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_019.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_019.ksh
new file mode 100644
index 0000000000..e3b16bad43
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_019.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 019
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_020.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_020.ksh
new file mode 100644
index 0000000000..9710bae3c1
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_020.ksh
@@ -0,0 +1,22 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+$NET_TESTS/tests/forwarding/ip_fwd_suite -n 020
+exit $?
diff --git a/usr/src/test/net-tests/tests/forwarding/ip_fwd_suite.ksh b/usr/src/test/net-tests/tests/forwarding/ip_fwd_suite.ksh
new file mode 100644
index 0000000000..a1fdc444e3
--- /dev/null
+++ b/usr/src/test/net-tests/tests/forwarding/ip_fwd_suite.ksh
@@ -0,0 +1,115 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+#
+# Run the IP forwarding test suite.
+#
+# Usage
+#
+# ip_fwd_suite [-n <name>] [-a <args>]
+#
+# To run all tests:
+#
+# NET_TESTS=/opt/net-tests ip_fwd_suite
+#
+# To run one test:
+#
+# NET_TESTS=/opt/net-tests ip_fwd_suite -n 001
+#
+# To run one test with additional arguments passed to 'ip_forwarding':
+#
+# NET_TESTS=/opt/net-tests ip_fwd_suite -n 001 -a n
+#
+
+if [[ -z $NET_TESTS ]]; then
+ echo "NET_TESTS not set" >&2
+ exit 1
+fi
+
+. $NET_TESTS/tests/net_common
+. $NET_TESTS/config/ip_forwarding.config
+
+if [[ -z "$NT_CLIENT" ]]; then
+ fail "NT_CLIENT must be set"
+fi
+
+if [[ -z "$NT_ROUTER" ]]; then
+ fail "NT_ROUTER must be set"
+fi
+
+if [[ -z "$NT_SERVER" ]]; then
+ fail "NT_SERVER must be set"
+fi
+
+while getopts "a:n:" opt; do
+ case $opt in
+ a)
+ nt_args=$OPTARG
+ ;;
+ n)
+ nt_name=$OPTARG
+ ;;
+ esac
+done
+
+shift $((OPTIND - 1))
+
+nt_script=$NET_TESTS/tests/forwarding/ip_forwarding
+
+#
+# See the "Test Matrix" section of the README for a description of
+# each test.
+#
+typeset -A nt_name_args
+nt_name_args["001"]="uv"
+nt_name_args["002"]="puv"
+nt_name_args["003"]="lpuv"
+nt_name_args["004"]="fuv"
+nt_name_args["005"]="fluv"
+nt_name_args["006"]="ruv"
+nt_name_args["007"]="pruv"
+nt_name_args["008"]="lpruv"
+nt_name_args["009"]="fruv"
+nt_name_args["010"]="flruv"
+
+nt_name_args["011"]="buv"
+nt_name_args["012"]="bpuv"
+nt_name_args["013"]="blpuv"
+nt_name_args["014"]="bfuv"
+nt_name_args["015"]="bfluv"
+nt_name_args["016"]="bruv"
+nt_name_args["017"]="bpruv"
+nt_name_args["018"]="blpruv"
+nt_name_args["019"]="bfruv"
+nt_name_args["020"]="bflruv"
+
+if [[ -n $nt_name ]]; then
+ if [[ -z ${nt_name_args[$nt_name]} ]]; then
+ fail "invalid test name: $nt_name"
+ fi
+
+ export NT_TNAME="ip_fwd_$nt_name"
+ nt_args="-${nt_name_args[$nt_name]}${nt_args}"
+ $nt_script $nt_args $NT_CLIENT $NT_ROUTER $NT_SERVER
+ exit $?
+fi
+
+for nt_name in ${!nt_name_args[@]}; do
+ export NT_TNAME="ip_fwd_$nt_name"
+ nt_args="-${nt_name_args[$nt_name]}${nt_args}"
+ $nt_script $nt_args $NT_CLIENT $NT_ROUTER $NT_SERVER || exit $?
+done
+
+exit 0
diff --git a/usr/src/test/net-tests/tests/net_common.ksh b/usr/src/test/net-tests/tests/net_common.ksh
new file mode 100644
index 0000000000..0742775193
--- /dev/null
+++ b/usr/src/test/net-tests/tests/net_common.ksh
@@ -0,0 +1,625 @@
+#!/usr/bin/ksh
+#
+# 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 2019 Joyent, Inc.
+#
+
+#
+# Functions shared across the network tests.
+#
+
+DEBUG=0
+
+function dbg
+{
+ typeset msg="$*"
+ if (($DEBUG == 1)); then
+ echo "DBG [$nt_tname]: $msg"
+ fi
+}
+
+function fail
+{
+ typeset msg="$*"
+ echo "FAIL [$nt_tname]: $msg" >&2
+ exit 1
+}
+
+function maybe_fail
+{
+ typeset msg=$1
+
+ if ((BAIL == 1)); then
+ fail "$msg"
+ else
+ dbg "$msg"
+ return 1
+ fi
+}
+
+function zone_exists
+{
+ typeset name=$1
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "checking for existence of zone: $name"
+ if zoneadm -z $name list > /dev/null 2>&1; then
+ dbg "found zone: $name"
+ return 0
+ else
+ dbg "zone not found: $name"
+ return 1
+ fi
+}
+
+function zone_running
+{
+ typeset name=$1
+ typeset state=$(zoneadm -z $name list -p | awk -F: '{ print $3 }')
+ typeset err="zone $name is not running"
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "check if zone $name is running"
+ dbg "state of zone $name: $state"
+ if [[ "$state" == "running" ]]; then
+ dbg "zone $name is running"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function simnet_exists
+{
+ typeset name=$1
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if dladm show-simnet $name > /dev/null 2>&1; then
+ dbg "simnet $name found"
+ return 0
+ else
+ dbg "simnet $name not found"
+ return 1
+ fi
+}
+
+function create_simnet
+{
+ typeset name=$1
+ typeset err="failed to create simnet $name"
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "creating simnet $name"
+ if simnet_exists $name; then
+ dbg "simnet $name already exists"
+ maybe_fail "$err"
+ return 1
+ fi
+
+ if dladm create-simnet > /dev/null $name; then
+ dbg "created simnet $name"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function delete_simnet
+{
+ typeset name=$1
+ typeset err="failed to delete simnet $name"
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "deleting simnet $name"
+ if ! simnet_exists $name; then
+ dbg "simnet $name doesn't exist"
+ return 1
+ fi
+
+ if dladm delete-simnet $name; then
+ dbg "simnet $name deleted"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function link_simnets
+{
+ typeset sim1=$1
+ typeset sim2=$2
+ typeset err="failed to link simnet $sim1 to $sim2"
+
+ if (($# != 2)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "linking simnet $sim1 to $sim2"
+ if dladm modify-simnet -p $sim2 $sim1 > /dev/null; then
+ dbg "linked simnet $sim1 to $sim2"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function vnic_exists
+{
+ typeset name=$1
+ typeset vid=$2
+ typeset over=$3
+ typeset zone=$4
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if dladm show-vnic -z $zone $name > /dev/null 2>&1; then
+ typeset avid=$(dladm show-vnic -z $zone -p -o vid $name)
+ typeset aover=$(dladm show-vnic -z $zone -p -o over $name)
+ if (($avid == $vid)) && [ $aover == $over ]; then
+ return 0
+ else
+ return 1
+ fi
+ else
+ return 1
+ fi
+}
+
+function create_vnic
+{
+ typeset name=$1
+ typeset over=$2
+ typeset vid=$3
+ typeset zone=$4
+ typeset r=1
+ typeset vid_opt=""
+ typeset vnic_info="$name, vid: $vid, over: $over, zone: $zone"
+ typeset err="failed to create VNIC: $vnic_info"
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if ((vid != 0)); then
+ vid_opt="-v $vid"
+ fi
+
+ dbg "creating VNIC: $vnic_info"
+ if dladm create-vnic -t -p zone=$zone -l $over \
+ $vid_opt $name > /dev/null 2>&1
+ then
+ dbg "created VNIC: $vnic_info"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function delete_vnic
+{
+ typeset name=$1
+ typeset vid=$2
+ typeset zone=$3
+ typeset vnic_info="$name, vid: $vid, zone: $zone"
+ typeset err1="failed to assign VNIC $name from $zone to GZ"
+ typeset err2="failed to delete VNIC: $vnic_info"
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "assigning VNIC $name from $zone to GZ"
+ if ! dladm set-linkprop -t -z $zone -p zone=global $name; then
+ maybe_fail "$err1"
+ return 1
+ fi
+
+ dbg "deleting VNIC: $vnic_info"
+ if dladm delete-vnic $name > /dev/null; then
+ dbg "deleted VNIC: $vnic_info"
+ return 0
+ fi
+
+ maybe_fail "$err2"
+}
+
+function create_addr
+{
+ typeset zone=$1
+ typeset vnic=$2
+ typeset ip=$3
+ typeset ipname=${vnic}/v4
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone ipadm create-addr -t -T static -a $ip \
+ $ipname > /dev/null
+ then
+ dbg "created addr $ipname ($ip) in zone $zone"
+ return 0
+ fi
+
+ maybe_fail "failed to create addr $ipname ($ip) in zone $zone"
+}
+
+function create_addr6
+{
+ typeset zone=$1
+ typeset vnic=$2
+ typeset ip=$3
+ typeset ll_name=${vnic}/v6
+ typeset uni_name=${vnic}/v6add
+ typeset err1="failed to create link-local addr $ll_name in zone $zone"
+ typeset err2="failed to create unicast addr $uni_name in zone $zone"
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone ipadm create-addr -t -T addrconf $ll_name; then
+ dbg "created link-local addr $ll_name in zone $zone"
+ else
+ maybe_fail "$err1"
+ return 1
+ fi
+
+ if zlogin $zone ipadm create-addr -t -T static -a $ip/64 $uni_name; then
+ dbg "created unicast addr $uni_name in zone $zone"
+ else
+ maybe_fail "$err2"
+ fi
+}
+
+function delete_addr
+{
+ typeset zone=$1
+ typeset ifname=$2
+ typeset version=$3
+ typeset ipname=$ifname/$version
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone ipadm show-addr $ipname > /dev/null 2>&1; then
+ if zlogin $zone ipadm delete-addr $ipname > /dev/null; then
+ dbg "deleted addr $ipname in zone $zone"
+ else
+ maybe_fail "failed to delete addr $ipname in zone $zone"
+ return 1
+ fi
+ else
+ dbg "addr $ipname doesn't exist in zone $zone"
+ fi
+
+ if [[ "v6" == "$version" ]]; then
+ typeset ipname=$ifname/v6add
+ typeset err="failed to delete addr $ipname in zone $zone"
+
+ if zlogin $zone ipadm show-addr $ipname > /dev/null 2>&1; then
+ if zlogin $zone ipadm delete-addr $ipname > /dev/null
+ then
+ dbg "deleted addr $ipname in zone $zone"
+ else
+ maybe_fail "$err"
+ fi
+ else
+ dbg "addr $ipname doesn't exist in zone $zone"
+ fi
+ fi
+}
+
+function delete_if
+{
+ typeset zone=$1
+ typeset ifname=$2
+ typeset err="failed to delete interface $ifname in zone $zone"
+
+ if (($# != 2)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone ipadm show-if $ifname > /dev/null 2>&1; then
+ if zlogin $zone ipadm delete-if $ifname > /dev/null; then
+ dbg "deleted interface $ifname in zone $zone"
+ else
+ maybe_fail "$err"
+ fi
+ else
+ dbg "interface $ifname doesn't exist in zone $zone"
+ fi
+}
+
+function ip_fwd_enable
+{
+ typeset zone=$1
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone routeadm -p ipv4-forwarding | \
+ egrep 'current=enabled' > /dev/null
+ then
+ dbg "IPv4 forwarding already enabled for $zone"
+ else
+ if zlogin $zone routeadm -ue ipv4-forwarding; then
+ dbg "enabled IPv4 forwarding for $zone"
+ else
+ maybe_fail "failed to enable IPv4 forwarding for $zone"
+ return 1
+ fi
+ fi
+
+ if zlogin $zone routeadm -p ipv6-forwarding | \
+ egrep 'current=enabled' > /dev/null
+ then
+ dbg "IPv6 forwarding already enabled for $zone"
+ else
+ if zlogin $zone routeadm -ue ipv6-forwarding; then
+ dbg "enabled IPv6 forwarding for $zone"
+ else
+ maybe_fail "failed to enable IPv6 forwarding for $zone"
+ fi
+ fi
+}
+
+function ip_fwd_disable
+{
+ typeset zone=$1
+
+ if (($# != 1)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone routeadm -p ipv4-forwarding | \
+ egrep 'current=disabled' > /dev/null
+ then
+ dbg "IPv4 forwarding already disabled for $zone"
+ else
+ if zlogin $zone routeadm -ud ipv4-forwarding; then
+ dbg "disabled IPv4 forwarding in $zone"
+ else
+ maybe_fail "failed to disable IPv4 forwarding in $zone"
+ return 1
+ fi
+ fi
+
+ if zlogin $zone routeadm -p ipv6-forwarding | \
+ egrep 'current=disabled' > /dev/null
+ then
+ dbg "IPv6 forwarding already disabled for $zone"
+ else
+ if zlogin $zone routeadm -ud ipv6-forwarding; then
+ dbg "disabled IPv6 forwarding in $zone"
+ else
+ maybe_fail "failed to disable IPv6 forwarding in $zone"
+ fi
+ fi
+}
+
+function add_route
+{
+ typeset zone=$1
+ typeset dest=$2
+ typeset net=$3
+ typeset gateway=$4
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone route -n add $net $gateway > /dev/null; then
+ dbg "added route $gateway => $net to $zone"
+ return 0
+ fi
+
+ maybe_fail "failed to add route $gateway => $net to $zone"
+}
+
+function add_route6
+{
+ typeset zone=$1
+ typeset dest=$2
+ typeset net=$3
+ typeset gateway=$4
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if zlogin $zone route -n add -inet6 $net $gateway > /dev/null
+ then
+ dbg "added route $gateway => $net to $zone"
+ return 0
+ fi
+
+ maybe_fail "failed to add route $gateway => $net to $zone"
+}
+
+function rm_route
+{
+ typeset zone=$1
+ typeset dest=$2
+ typeset net=$3
+ typeset gateway=$4
+ typeset gw=$(zlogin $zone route -n get $dest | \
+ grep gateway | awk '{ print $2 }')
+ typeset err="failed to remove route $gateway => $net from $zone"
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if [[ "$gw" == "$gateway" ]]; then
+ if zlogin $zone route -n delete $net $gateway > /dev/null
+ then
+ dbg "removed route $gateway => $net from $zone"
+ else
+ maybe_fail "$err"
+ fi
+ else
+ dbg "$zone already lacked route $gateway => $net"
+ fi
+}
+
+function rm_route6
+{
+ typeset zone=$1
+ typeset dest=$2
+ typeset net=$3
+ typeset gateway=$4
+ typeset gw=$(zlogin $zone route -n get -inet6 $dest | \
+ grep gateway | awk '{ print $2 }')
+ typeset err="failed to remove route $gateway => $net from $zone"
+
+ if (($# != 4)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ if [[ "$gw" == "$gateway" ]]; then
+ if zlogin $zone route -n delete -inet6 $net $gateway > /dev/null
+ then
+ dbg "removed route $gateway => $net from $zone"
+ else
+ maybe_fail "$err"
+ fi
+ else
+ dbg "$zone already lacked route $gateway => $net"
+ fi
+}
+
+function set_linkprop
+{
+ typeset link=$1
+ typeset prop=$2
+ typeset val=$3
+ typeset err="failed to set $link prop: $prop=$val"
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "attempt to set $link prop: $prop=$val"
+ if dladm set-linkprop -p $prop=$val $link; then
+ dbg "set $link prop: $prop=$val"
+ return 0
+ fi
+
+ maybe_fail "$err"
+}
+
+function ping
+{
+ typeset zone=$1
+ typeset src=$2
+ typeset dst=$3
+ typeset info="$src -> $dst"
+
+ if (($# != 3)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "ping: $info"
+ if zlogin $zone ping $dst > /dev/null 2>&1; then
+ dbg "successful ping: $info"
+ return 0
+ fi
+
+ maybe_fail "could not ping: $info"
+}
+
+function ping_udp
+{
+ typeset client=$1
+ typeset client_ip=$2
+ typeset server_ip=$3
+ typeset size=$4
+ typeset num=$5
+ typeset info="$client_ip -> $server_ip (size: $size)"
+
+ if (($# != 5)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "UDP ping: $info"
+ if zlogin $client ping -ns -U $server_ip $size $num > /dev/null; then
+ dbg "UDP ping passed: $info"
+ return 0
+ fi
+
+ maybe_fail "UDP ping failed: $info"
+}
+
+function start_server
+{
+ typeset zone=$1
+ typeset type=$2
+ typeset ip=$3
+ typeset port=$4
+ typeset ofile=$5
+
+ if (($# != 5)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ dbg "start server $rfile"
+ zlogin $zone \
+ /usr/bin/socat -u ${type}-LISTEN:$port,bind=[$ip],reuseaddr \
+ CREATE:$ofile &
+ listener_ppid=$!
+ dbg "listener PPID: $listener_ppid, zone $zone"
+}
+
+function wait_for_pid
+{
+ typeset pid=$1
+ typeset seconds=$2
+ typeset s=0
+
+ if (($# != 2)); then
+ fail "$0: incorrect number of args provided"
+ fi
+
+ while true; do
+ if kill -0 $pid > /dev/null 2>&1; then
+ if ((seconds == s)); then
+ maybe_fail "timed out waiting for pid $pid"
+ return 1
+ fi
+ dbg "waiting for pid $pid"
+ sleep 1
+ ((s++))
+ else
+ return 0
+ fi
+ done
+}
diff --git a/usr/src/test/os-tests/runfiles/default.run b/usr/src/test/os-tests/runfiles/default.run
index af99f6efd1..9489c2faf6 100644
--- a/usr/src/test/os-tests/runfiles/default.run
+++ b/usr/src/test/os-tests/runfiles/default.run
@@ -22,7 +22,7 @@ timeout = 60
post =
outputdir = /var/tmp/test_results
-[/opt/os-tests/tests/poll_test]
+[/opt/os-tests/tests/poll]
user = root
tests = ['poll_test', 'epoll_test']
@@ -48,6 +48,14 @@ tests = ['sigqueue_queue_size']
user = root
tests = ['sdevfs_eisdir']
+[/opt/os-tests/tests/timer]
+user = root
+tests = ['timer_limit']
+
+[/opt/os-tests/tests/tmpfs]
+user = root
+tests = ['tmpfs_badmount', 'tmpfs_enospc']
+
[/opt/os-tests/tests/stress]
user = root
tests = ['dladm-kstat']
@@ -64,6 +72,9 @@ user = root
timeout = 180
tests = ['acquire-compare', 'kmc-update']
+[/opt/os-tests/tests/OS-6097.32]
+[/opt/os-tests/tests/OS-6097.64]
+
[/opt/os-tests/tests/ddi_ufm]
user = root
tests = ['ufm-test-setup', 'ufm-test', 'ufm-test-cleanup']
@@ -73,3 +84,6 @@ user = root
arch = i86pc
timeout = 300
tests = ['ldt', 'badseg']
+
+[/opt/os-tests/tests/imc_test]
+arch = i86pc
diff --git a/usr/src/test/os-tests/tests/Makefile b/usr/src/test/os-tests/tests/Makefile
index aab4828541..e3e756c946 100644
--- a/usr/src/test/os-tests/tests/Makefile
+++ b/usr/src/test/os-tests/tests/Makefile
@@ -14,7 +14,7 @@
# Copyright 2019 Joyent, Inc.
#
-SUBDIRS_i386 = i386
+SUBDIRS_i386 = i386 imc
SUBDIRS = \
ddi_ufm \
@@ -27,6 +27,63 @@ SUBDIRS = \
sockfs \
spoof-ras \
stress \
+ timer \
+ tmpfs \
$(SUBDIRS_$(MACH))
-include $(SRC)/test/Makefile.com
+PROGS = \
+ OS-6097
+
+PROGS32 = $(PROGS:%=%.32)
+PROGS64 = $(PROGS:%=%.64)
+
+OS-6097.32 := LDLIBS += -ldlpi
+OS-6097.64 := LDLIBS64 += -ldlpi
+
+ROOTOPTDIR = $(ROOT)/opt/os-tests/tests
+ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
+ $(PROGS64:%=$(ROOTOPTDIR)/%) \
+ $(SCRIPTS:%=$(ROOTOPTDIR)/%)
+
+include $(SRC)/cmd/Makefile.cmd
+
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
+lint := TARGET = lint
+
+.KEEP_STATE:
+
+install: $(SUBDIRS) $(ROOTOPTPROGS)
+
+all: $(SUBDIRS) $(PROGS32) $(PROGS64)
+
+clean lint: $(SUBDIRS)
+
+$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTDIR)
+
+$(ROOTOPTDIR):
+ $(INS.dir)
+
+$(ROOTOPTDIR)/%: %
+ $(INS.file)
+
+$(ROOTOPTDIR)/%: %.ksh
+ $(INS.rename)
+
+%.64: %.c
+ $(LINK64.c) -o $@ $< $(LDLIBS64)
+ $(POST_PROCESS)
+
+%.32: %.c
+ $(LINK.c) -o $@ $< $(LDLIBS)
+ $(POST_PROCESS)
+
+clobber: $(SUBDIRS)
+ $(RM) $(PROGS32) $(PROGS64)
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
diff --git a/usr/src/test/os-tests/tests/OS-6097.c b/usr/src/test/os-tests/tests/OS-6097.c
new file mode 100644
index 0000000000..160c01e9c7
--- /dev/null
+++ b/usr/src/test/os-tests/tests/OS-6097.c
@@ -0,0 +1,74 @@
+/*
+ * 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 (c) 2017, Joyent, Inc.
+ */
+
+/*
+ * Regression test for OS-6097.
+ */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <libdlpi.h>
+#include <sys/debug.h>
+
+int
+main(void)
+{
+ int ret;
+ char path[4096];
+ uint_t num = 4294967294U;
+ dlpi_handle_t dh;
+
+ /*
+ * First, we need to determine a path that doesn't exist to trigger this
+ * bug. We start with the highest possible number and just decrement
+ * until we find something.
+ */
+
+ while (num > 0) {
+ struct stat st;
+
+ (void) snprintf(path, sizeof (path), "/dev/net/net%u", num);
+
+ ret = stat(path, &st);
+ if (ret == -1 && errno == ENOENT)
+ break;
+ if (ret == -1) {
+ (void) fprintf(stderr, "test failed: unexpected error "
+ "running stat(2) on %s: %s\n", path,
+ strerror(errno));
+ return (1);
+ }
+ num--;
+ }
+
+ /*
+ * While technically this is a valid entry that we could try, at this
+ * point we've exhausted so many NICs, there's likely a bug.
+ */
+ if (num == 0) {
+ (void) fprintf(stderr, "failed to construct a non-existent "
+ "NIC with a name starting with 'net'\n");
+ return (1);
+ }
+
+ (void) snprintf(path, sizeof (path), "net%u", num);
+ ret = dlpi_open(path, &dh, 0);
+ VERIFY3U(ret, ==, DLPI_ENOLINK);
+ return (0);
+}
diff --git a/usr/src/test/os-tests/tests/file-locking/Makefile b/usr/src/test/os-tests/tests/file-locking/Makefile
index 2f8c6762ad..64011074c5 100644
--- a/usr/src/test/os-tests/tests/file-locking/Makefile
+++ b/usr/src/test/os-tests/tests/file-locking/Makefile
@@ -28,6 +28,9 @@ SRCS = $(PROGS:%=%.c) $(UTILS:%.o=%.c)
PROGS32 = $(PROGS:%=%.32)
PROGS64 = $(PROGS:%=%.64)
+runtests.32 := LDLIBS += -lgen
+runtests.64 := LDLIBS64 += -lgen
+
LINTS = $(PROGS:%=%.ln)
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
@@ -36,6 +39,12 @@ ROOTOPTDIR = $(ROOT)/opt/os-tests/tests/file-locking
ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTDIR)/%) \
$(PROGS64:%=$(ROOTOPTDIR)/%)
+all := TARGET = all
+install := TARGET = install
+clean := TARGET = clean
+clobber := TARGET = clobber
+lint := TARGET = lint
+
.KEEP_STATE:
install: $(ROOTOPTPROGS)
diff --git a/usr/src/test/os-tests/tests/i386/ldt.c b/usr/src/test/os-tests/tests/i386/ldt.c
index 1f39e1a9bd..1f39e1a9bd 100755..100644
--- a/usr/src/test/os-tests/tests/i386/ldt.c
+++ b/usr/src/test/os-tests/tests/i386/ldt.c
diff --git a/usr/src/test/os-tests/tests/imc/Makefile b/usr/src/test/os-tests/tests/imc/Makefile
new file mode 100644
index 0000000000..d62c8048f1
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/Makefile
@@ -0,0 +1,72 @@
+#
+# 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 2019 Joyent, Inc.
+#
+
+ROOTOPTPKG = $(ROOT)/opt/os-tests
+TESTDIR = $(ROOTOPTPKG)/tests
+
+#
+# Test objects
+#
+OBJS = imc_test.o \
+ imc_test_basic.o \
+ imc_test_badaddr.o \
+ imc_test_fail.o \
+ imc_test_rir.o \
+ imc_test_sad.o \
+ imc_test_skx_loop.o \
+ imc_test_tad.o
+
+#
+# Common objects that we need.
+#
+OBJS += imc_decode.o
+
+PROG = imc_test
+
+include $(SRC)/cmd/Makefile.cmd
+include $(SRC)/test/Makefile.com
+include $(SRC)/cmd/Makefile.ctf
+
+CPPFLAGS += -I$(SRC)/uts/i86pc/io/imc
+
+CMDS = $(PROG:%=$(TESTDIR)/%)
+$(CMDS) := FILEMODE = 0555
+
+all: $(PROG)
+
+install: all $(CMDS)
+
+clobber: clean
+ -$(RM) $(PROG)
+
+clean:
+ -$(RM) *.o
+
+$(CMDS): $(TESTDIR) $(PROG)
+
+$(TESTDIR)/%: %
+ $(INS.file)
+
+$(PROG): $(OBJS)
+ $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
+ $(POST_PROCESS)
+
+%.o: %.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
+
+%.o: $(SRC)/common/mc/imc/%.c
+ $(COMPILE.c) $<
+ $(POST_PROCESS_O)
diff --git a/usr/src/test/os-tests/tests/imc/imc_test.c b/usr/src/test/os-tests/tests/imc/imc_test.c
new file mode 100644
index 0000000000..7a916fc90f
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test.c
@@ -0,0 +1,353 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <err.h>
+
+#include "imc_test.h"
+
+/*
+ * Test runner for the IMC driver and its decoder. This operates by creating
+ * fake topologies and then building a copy of the decoder into this.
+ */
+
+static void
+imc_print(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ (void) vfprintf(stdout, fmt, ap);
+ va_end(ap);
+}
+
+static const char *
+imc_test_strerror(imc_decode_failure_t fail)
+{
+ switch (fail) {
+ case IMC_DECODE_F_NONE:
+ return ("Actually succeeded");
+ case IMC_DECODE_F_LEGACY_RANGE:
+ return ("Asked to decode legacy address");
+ case IMC_DECODE_F_BAD_SOCKET:
+ return ("BAD socket data");
+ case IMC_DECODE_F_BAD_SAD:
+ return ("BAD SAD data");
+ case IMC_DECODE_F_OUTSIDE_DRAM:
+ return ("Address not DRAM");
+ case IMC_DECODE_F_NO_SAD_RULE:
+ return ("No valid SAD rule");
+ case IMC_DECODE_F_BAD_SAD_INTERLEAVE:
+ return ("SAD bad interleave target");
+ case IMC_DECODE_F_BAD_REMOTE_MC_ROUTE:
+ return ("SAD MC_ROUTE refers to non-existent socket");
+ case IMC_DECODE_F_SAD_SEARCH_LOOP:
+ return ("SAD search looped");
+ case IMC_DECODE_F_SAD_BAD_MOD:
+ return ("SAD has a bad mod rule");
+ case IMC_DECODE_F_SAD_BAD_SOCKET:
+ return ("SAD has a bad Socket target");
+ case IMC_DECODE_F_SAD_BAD_TAD:
+ return ("SAD has a bad TAD target");
+ case IMC_DECODE_F_NO_TAD_RULE:
+ return ("No valid TAD rule");
+ case IMC_DECODE_F_TAD_3_ILEAVE:
+ return ("Unsupported 3-way channel interleave");
+ case IMC_DECODE_F_TAD_BAD_TARGET_INDEX:
+ return ("Bad TAD target index");
+ case IMC_DECODE_F_BAD_CHANNEL_ID:
+ return ("Bad channel ID");
+ case IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET:
+ return ("Bad channel tad offset");
+ case IMC_DECODE_F_NO_RIR_RULE:
+ return ("No valid rank interleave rule");
+ case IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET:
+ return ("Bad rank interleave target");
+ case IMC_DECODE_F_BAD_DIMM_INDEX:
+ return ("Bad DIMM target index");
+ case IMC_DECODE_F_DIMM_NOT_PRESENT:
+ return ("DIMM not present");
+ case IMC_DECODE_F_BAD_DIMM_RANK:
+ return ("Bad DIMM rank");
+ case IMC_DECODE_F_CHANOFF_UNDERFLOW:
+ return ("Channel address offset calculation underflow");
+ case IMC_DECODE_F_RANKOFF_UNDERFLOW:
+ return ("Rank address offset calculation underflow");
+ default:
+ return ("<unknown>");
+ }
+}
+
+static const char *
+imc_test_strenum(imc_decode_failure_t fail)
+{
+ switch (fail) {
+ case IMC_DECODE_F_NONE:
+ return ("IMC_DECODE_F_NONE");
+ case IMC_DECODE_F_LEGACY_RANGE:
+ return ("IMC_DECODE_F_LEGACY_RANGE");
+ case IMC_DECODE_F_BAD_SOCKET:
+ return ("IMC_DECODE_F_BAD_SOCKET");
+ case IMC_DECODE_F_BAD_SAD:
+ return ("IMC_DECODE_F_BAD_SAD");
+ case IMC_DECODE_F_OUTSIDE_DRAM:
+ return ("IMC_DECODE_F_OUTSIDE_DRAM");
+ case IMC_DECODE_F_NO_SAD_RULE:
+ return ("IMC_DECODE_F_NO_SAD_RULE");
+ case IMC_DECODE_F_BAD_SAD_INTERLEAVE:
+ return ("IMC_DECODE_F_BAD_SAD_INTERLEAVE");
+ case IMC_DECODE_F_BAD_REMOTE_MC_ROUTE:
+ return ("IMC_DECODE_F_BAD_REMOTE_MC_ROUTE");
+ case IMC_DECODE_F_SAD_SEARCH_LOOP:
+ return ("IMC_DECODE_F_SAD_SEARCH_LOOP");
+ case IMC_DECODE_F_SAD_BAD_MOD:
+ return ("IMC_DECODE_F_SAD_BAD_MOD");
+ case IMC_DECODE_F_SAD_BAD_SOCKET:
+ return ("IMC_DECODE_F_SAD_BAD_SOCKET");
+ case IMC_DECODE_F_SAD_BAD_TAD:
+ return ("IMC_DECODE_F_SAD_BAD_TAD");
+ case IMC_DECODE_F_NO_TAD_RULE:
+ return ("IMC_DECODE_F_NO_TAD_RULE");
+ case IMC_DECODE_F_TAD_3_ILEAVE:
+ return ("IMC_DECODE_F_TAD_3_ILEAVE");
+ case IMC_DECODE_F_TAD_BAD_TARGET_INDEX:
+ return ("IMC_DECODE_F_TAD_BAD_TARGET_INDEX");
+ case IMC_DECODE_F_BAD_CHANNEL_ID:
+ return ("IMC_DECODE_F_BAD_CHANNEL_ID");
+ case IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET:
+ return ("IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET");
+ case IMC_DECODE_F_NO_RIR_RULE:
+ return ("IMC_DECODE_F_NO_RIR_RULE");
+ case IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET:
+ return ("IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET");
+ case IMC_DECODE_F_BAD_DIMM_INDEX:
+ return ("IMC_DECODE_F_BAD_DIMM_INDEX");
+ case IMC_DECODE_F_DIMM_NOT_PRESENT:
+ return ("IMC_DECODE_F_DIMM_NOT_PRESENT");
+ case IMC_DECODE_F_BAD_DIMM_RANK:
+ return ("IMC_DECODE_F_BAD_DIMM_RANK");
+ case IMC_DECODE_F_CHANOFF_UNDERFLOW:
+ return ("IMC_DECODE_F_CHANOFF_UNDERFLOW");
+ case IMC_DECODE_F_RANKOFF_UNDERFLOW:
+ return ("IMC_DECODE_F_RANKOFF_UNDERFLOW");
+ default:
+ return ("<unknown>");
+ }
+}
+
+static uint_t
+imc_test_run_one(const imc_test_case_t *test)
+{
+ imc_decode_state_t dec;
+ boolean_t pass;
+
+ imc_print("Running test: %s\n", test->itc_desc);
+ imc_print("\tDecoding address: 0x%" PRIx64 "\n", test->itc_pa);
+
+ (void) memset(&dec, '\0', sizeof (dec));
+ pass = imc_decode_pa(test->itc_imc, test->itc_pa, &dec);
+ if (pass && !test->itc_pass) {
+ imc_print("\tdecode unexpectedly succeeded\n");
+ imc_print("\texpected error '%s' (%s/0x%x)\n",
+ imc_test_strerror(test->itc_fail),
+ imc_test_strenum(test->itc_fail),
+ test->itc_fail);
+ imc_print("\t\tdecoded socket: %u\n", dec.ids_nodeid);
+ imc_print("\t\tdecoded tad: %u\n", dec.ids_tadid);
+ imc_print("\t\tdecoded channel: %u\n",
+ dec.ids_channelid);
+ imc_print("\t\tdecoded channel address: 0x%" PRIx64 "\n",
+ dec.ids_chanaddr);
+ imc_print("\t\tdecoded rank: %u\n", dec.ids_rankid);
+ imc_print("\t\tdecoded rank address: 0x%" PRIx64 "\n",
+ dec.ids_rankaddr);
+ imc_print("\ttest failed\n");
+
+ return (1);
+ } else if (pass) {
+ uint_t err = 0;
+
+ if (test->itc_nodeid != UINT32_MAX &&
+ test->itc_nodeid != dec.ids_nodeid) {
+ imc_print("\tsocket mismatch\n"
+ "\t\texpected %u\n\t\tfound %u\n",
+ test->itc_nodeid, dec.ids_nodeid);
+ err |= 1;
+ }
+
+ if (test->itc_tadid != UINT32_MAX &&
+ test->itc_tadid != dec.ids_tadid) {
+ imc_print("\tTAD mismatch\n"
+ "\t\texpected %u\n\t\tfound %u\n",
+ test->itc_tadid, dec.ids_tadid);
+ err |= 1;
+ }
+
+ if (test->itc_channelid != UINT32_MAX &&
+ test->itc_channelid != dec.ids_channelid) {
+ imc_print("\tchannel mismatch\n"
+ "\t\texpected %u\n\t\tfound %u\n",
+ test->itc_channelid, dec.ids_channelid);
+ err |= 1;
+ }
+
+ if (test->itc_chanaddr != UINT64_MAX &&
+ test->itc_chanaddr != dec.ids_chanaddr) {
+ imc_print("\tchannel address mismatch\n"
+ "\t\texpected 0x%" PRIx64 "\n\t\t"
+ "found 0x%" PRIx64 "\n",
+ test->itc_chanaddr, dec.ids_chanaddr);
+ err |= 1;
+ }
+
+ if (test->itc_dimmid != UINT32_MAX &&
+ test->itc_dimmid != dec.ids_dimmid) {
+ imc_print("\tDIMM mismatch\n"
+ "\t\texpected %u\n\t\tfound %u\n",
+ test->itc_dimmid, dec.ids_dimmid);
+ err |= 1;
+ }
+
+ if (test->itc_rankid != UINT32_MAX &&
+ test->itc_rankid != dec.ids_rankid) {
+ imc_print("\trank mismatch\n"
+ "\t\texpected %u\n\t\tfound %u\n",
+ test->itc_rankid, dec.ids_rankid);
+ err |= 1;
+ }
+
+ if (test->itc_rankaddr != UINT64_MAX &&
+ test->itc_rankaddr != dec.ids_rankaddr) {
+ imc_print("\trank address mismatch\n"
+ "\t\texpected 0x%" PRIx64 "\n\t\t"
+ "found 0x%" PRIx64 "\n",
+ test->itc_rankaddr, dec.ids_rankaddr);
+ err |= 1;
+ }
+
+ if (err) {
+ imc_print("\tDecoding failed\n");
+ } else {
+ imc_print("\tDecoded successfully\n");
+ }
+
+ return (err);
+ } else if (!pass && !test->itc_pass) {
+ if (dec.ids_fail != test->itc_fail) {
+ imc_print("\terror mismatch\n"
+ "\t\texpected '%s' (%s/0x%x)\n\t\tfound '%s' "
+ "(%s/0x%x)\n", imc_test_strerror(test->itc_fail),
+ imc_test_strenum(test->itc_fail), test->itc_fail,
+ imc_test_strerror(dec.ids_fail),
+ imc_test_strenum(dec.ids_fail), dec.ids_fail);
+ return (1);
+ }
+
+ imc_print("\tCorrect decoding error generated\n");
+ return (0);
+ } else {
+ imc_print("\tdecode failed with '%s' (%s/0x%x)\n",
+ imc_test_strerror(dec.ids_fail),
+ imc_test_strenum(dec.ids_fail),
+ dec.ids_fail);
+ if (test->itc_nodeid != UINT32_MAX) {
+ imc_print("\t\texpected socket: %u\n",
+ test->itc_nodeid);
+ }
+
+ if (test->itc_tadid != UINT32_MAX) {
+ imc_print("\t\texpected tad: %u\n", test->itc_tadid);
+ }
+
+ if (test->itc_channelid != UINT32_MAX) {
+ imc_print("\t\texpected channel: %u\n",
+ test->itc_channelid);
+ }
+
+ if (test->itc_chanaddr != UINT64_MAX) {
+ imc_print("\t\texpected channel address: 0x%" PRIx64
+ "\n", test->itc_chanaddr);
+ }
+
+ if (test->itc_rankid != UINT32_MAX) {
+ imc_print("\t\texpected rank: %u\n",
+ test->itc_rankid);
+ }
+
+ if (test->itc_rankaddr != UINT64_MAX) {
+ imc_print("\t\texpected rank address: 0x%" PRIx64 "\n",
+ test->itc_rankaddr);
+ }
+
+ imc_print("\tdecode failed, expected pass\n");
+
+ return (1);
+ }
+}
+
+static void
+imc_test_run(const imc_test_case_t *tests, uint_t *ntests, uint_t *nfail)
+{
+ while (tests[0].itc_desc != NULL) {
+ *nfail += imc_test_run_one(tests);
+ *ntests += 1;
+ tests++;
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ uint_t ntests = 0, nfail = 0;
+ int i;
+
+ if (argc > 1) {
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "basic") == 0) {
+ imc_test_run(imc_test_basics, &ntests, &nfail);
+ } else if (strcmp(argv[i], "badaddr") == 0) {
+ imc_test_run(imc_test_badaddr, &ntests, &nfail);
+ } else if (strcmp(argv[i], "sad") == 0) {
+ imc_test_run(imc_test_sad, &ntests, &nfail);
+ } else if (strcmp(argv[i], "skx_loop") == 0) {
+ imc_test_run(imc_test_skx_loop, &ntests,
+ &nfail);
+ } else if (strcmp(argv[i], "tad") == 0) {
+ imc_test_run(imc_test_tad, &ntests, &nfail);
+ } else if (strcmp(argv[i], "rir") == 0) {
+ imc_test_run(imc_test_rir, &ntests, &nfail);
+ } else if (strcmp(argv[i], "fail") == 0) {
+ imc_test_run(imc_test_fail, &ntests, &nfail);
+ } else {
+ errx(EXIT_FAILURE, "Unknown test argument %s",
+ argv[i]);
+ }
+ }
+ } else {
+ imc_test_run(imc_test_basics, &ntests, &nfail);
+ imc_test_run(imc_test_badaddr, &ntests, &nfail);
+ imc_test_run(imc_test_skx_loop, &ntests, &nfail);
+ imc_test_run(imc_test_rir, &ntests, &nfail);
+ imc_test_run(imc_test_tad, &ntests, &nfail);
+ imc_test_run(imc_test_sad, &ntests, &nfail);
+ imc_test_run(imc_test_fail, &ntests, &nfail);
+ }
+
+ imc_print("%u/%u tests passed\n", ntests - nfail, ntests);
+ return (nfail > 0);
+}
diff --git a/usr/src/test/os-tests/tests/imc/imc_test.h b/usr/src/test/os-tests/tests/imc/imc_test.h
new file mode 100644
index 0000000000..d1785dd837
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test.h
@@ -0,0 +1,68 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#ifndef _IMC_TEST_H
+#define _IMC_TEST_H
+
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "imc.h"
+
+/*
+ * Standard interfaces for the IMC test files.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct imc_test_case {
+ const char *itc_desc;
+ uint64_t itc_pa;
+ const imc_t *itc_imc;
+ boolean_t itc_pass;
+ imc_decode_failure_t itc_fail;
+ /*
+ * These will all be checked on the success case unless set to the
+ * respective UINTXX_MAX value.
+ */
+ uint32_t itc_nodeid;
+ uint32_t itc_tadid;
+ uint32_t itc_channelid;
+ uint64_t itc_chanaddr;
+ uint32_t itc_dimmid;
+ uint32_t itc_rankid;
+ uint64_t itc_rankaddr;
+} imc_test_case_t;
+
+/*
+ * Arrays of tests cases that exist. They are terminated with a NULL itc_desc
+ * member.
+ */
+extern const imc_test_case_t imc_test_basics[];
+extern const imc_test_case_t imc_test_badaddr[];
+extern const imc_test_case_t imc_test_fail[];
+extern const imc_test_case_t imc_test_rir[];
+extern const imc_test_case_t imc_test_sad[];
+extern const imc_test_case_t imc_test_skx_loop[];
+extern const imc_test_case_t imc_test_tad[];
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _IMC_TEST_H */
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_badaddr.c b/usr/src/test/os-tests/tests/imc/imc_test_badaddr.c
new file mode 100644
index 0000000000..b45b3b4773
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_badaddr.c
@@ -0,0 +1,230 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * This file does a bunch of tests to make sure that we correctly handle cases
+ * where we're asked to decode the following types of addresses:
+ *
+ * - Legacy Reserved Addresses
+ * - Between TOLM, TOHM
+ * - Above TOHM
+ */
+
+/*
+ * This IMC represents a basic case where we have a single 8 GiB dual rank DIMM.
+ * We have system memory in the lower 2 GiB and then the remaining 6 GiB starts
+ * at the bottom of high memory (4 GiB).
+ */
+static const imc_t imc_badaddr = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+const imc_test_case_t imc_test_badaddr[] = { {
+ .itc_desc = "Bad Address, legacy VGA (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xa0000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, legacy VGA (2)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xbffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, legacy VGA (3)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xafc89,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, legacy PAM (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xc0000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, legacy PAM (2)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xfffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, Reserved (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, Reserved (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, System (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x00fe000000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, System (2)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x00fe123446,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, System (3)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x00ff000000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, System (4)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x00ffffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Bad Address, System (5)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x00ff5abc32,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_LEGACY_RANGE
+}, {
+ .itc_desc = "Outside TOLM (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x80000000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = "Outside TOLM (2)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xF0000000,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = "Outside TOLM (3)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0xfdffffffULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = "Outside TOHM (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x280000000ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = "Outside TOHM (2)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = UINT64_MAX,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = "Outside TOHM (1)",
+ .itc_imc = &imc_badaddr,
+ .itc_pa = 0x1280000000ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_OUTSIDE_DRAM
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_basic.c b/usr/src/test/os-tests/tests/imc/imc_test_basic.c
new file mode 100644
index 0000000000..b65506ead1
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_basic.c
@@ -0,0 +1,132 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * This represents a basic configuration with a single socket, channel, and
+ * DIMM that is 2 GiB in size. This entirely punts on the fact that the legacy
+ * ranges overlap here.
+ */
+static const imc_t imc_basic_snb = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_TRUE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x80000000,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+const imc_test_case_t imc_test_basics[] = { {
+ .itc_desc = "decode basic single socket/channel/DIMM, dual rank (1)",
+ .itc_imc = &imc_basic_snb,
+ .itc_pa = 0x0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "decode basic single socket/channel/DIMM, dual rank (2)",
+ .itc_imc = &imc_basic_snb,
+ .itc_pa = 0x1000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = "decode basic single socket/channel/DIMM, dual rank (3)",
+ .itc_imc = &imc_basic_snb,
+ .itc_pa = 0x7fffffff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x7fffffff,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x3fffffff,
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_fail.c b/usr/src/test/os-tests/tests/imc/imc_test_fail.c
new file mode 100644
index 0000000000..ef0cb003a2
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_fail.c
@@ -0,0 +1,1494 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * This file tests several different miscellaneous failure modes by using
+ * incomplete imc_t and imc_t with bad data.
+ */
+
+/*
+ * This IMC is a nominally valid IMC; however, it has flags indicate that the
+ * socket has bad data.
+ */
+static const imc_t imc_badsock = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_BAD_NODEID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_invalid_sad = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = 0,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_BAD_DRAM_ATTR,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_invalid_sad_rule = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = 0,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x34,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x42,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_invalid_sad_interleave = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = 0,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = 0
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = 0
+ }
+ }
+ }
+};
+
+static const imc_t imc_invalid_sad_target = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = 0,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 9, 9, 9, 9, 9, 9, 9, 9 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_tad_rule = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x2,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x277777777ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_tad_3way = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 3,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 3,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_tad_target = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 0,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 0,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_tad_channelid = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 17, 23, 42, 167 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 17, 23, 42, 167 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_channel_offset = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 0,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_rir_rule = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x1,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_rir_ileave = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 0
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_dimm_index = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x23, 0x0 },
+ .irle_entries[1] = { 0x42, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_missing_dimm = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_FALSE
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_bad_rank_index = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x2, 0x0 },
+ .irle_entries[1] = { 0x3, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_chanoff_underflow = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL,
+ 0x1000000000ULL
+ },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_riroff_underflow = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000, /* 2 GiB */
+ .isad_tohm = 0x280000000ULL, /* 10 GiB */
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x80000000,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x80000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x200000000ULL,
+ .irle_nentries = 5,
+ .irle_entries[0] = { 0x0,
+ 0x100000000000ULL },
+ .irle_entries[1] = { 0x1,
+ 0x100000000000ULL }
+ }
+ }
+ }
+ }
+};
+
+const imc_test_case_t imc_test_fail[] = { {
+ .itc_desc = "Bad Socket data (1)",
+ .itc_imc = &imc_badsock,
+ .itc_pa = 0x34,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SOCKET
+}, {
+ .itc_desc = "Bad Socket data (2)",
+ .itc_imc = &imc_badsock,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SOCKET
+}, {
+ .itc_desc = "Bad Socket data (3)",
+ .itc_imc = &imc_badsock,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SOCKET
+}, {
+ .itc_desc = "Bad SAD data (1)",
+ .itc_imc = &imc_invalid_sad,
+ .itc_pa = 0x34,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD
+}, {
+ .itc_desc = "Bad SAD data (2)",
+ .itc_imc = &imc_invalid_sad,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD
+}, {
+ .itc_desc = "Bad SAD data (3)",
+ .itc_imc = &imc_invalid_sad,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD
+}, {
+ .itc_desc = "Bad SAD rule (1)",
+ .itc_imc = &imc_invalid_sad_rule,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_SAD_RULE
+}, {
+ .itc_desc = "Bad SAD rule (2)",
+ .itc_imc = &imc_invalid_sad_rule,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_SAD_RULE
+}, {
+ .itc_desc = "Bad SAD rule (3)",
+ .itc_imc = &imc_invalid_sad_rule,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_SAD_RULE
+}, {
+ .itc_desc = "Bad SAD interleave (1)",
+ .itc_imc = &imc_invalid_sad_interleave,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD_INTERLEAVE
+}, {
+ .itc_desc = "Bad SAD interleave (2)",
+ .itc_imc = &imc_invalid_sad_interleave,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD_INTERLEAVE
+}, {
+ .itc_desc = "Bad SAD interleave (3)",
+ .itc_imc = &imc_invalid_sad_interleave,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_SAD_INTERLEAVE
+}, {
+ .itc_desc = "Bad SAD TAD target (1)",
+ .itc_imc = &imc_invalid_sad_target,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_BAD_SOCKET
+}, {
+ .itc_desc = "Bad SAD TAD target (2)",
+ .itc_imc = &imc_invalid_sad_target,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_BAD_SOCKET
+}, {
+ .itc_desc = "Bad SAD TAD target (3)",
+ .itc_imc = &imc_invalid_sad_target,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_BAD_TAD
+}, {
+ .itc_desc = "Bad TAD rule (1)",
+ .itc_imc = &imc_bad_tad_rule,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_TAD_RULE
+}, {
+ .itc_desc = "Bad TAD rule (2)",
+ .itc_imc = &imc_bad_tad_rule,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_TAD_RULE
+}, {
+ .itc_desc = "Bad TAD rule (3)",
+ .itc_imc = &imc_bad_tad_rule,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_TAD_RULE
+}, {
+ .itc_desc = "Unsupported 3 way interleave (1)",
+ .itc_imc = &imc_bad_tad_3way,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_3_ILEAVE
+}, {
+ .itc_desc = "Unsupported 3 way interleave (2)",
+ .itc_imc = &imc_bad_tad_3way,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_3_ILEAVE
+}, {
+ .itc_desc = "Unsupported 3 way interleave (3)",
+ .itc_imc = &imc_bad_tad_3way,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_3_ILEAVE
+}, {
+ .itc_desc = "Bad TAD target index (1)",
+ .itc_imc = &imc_bad_tad_target,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_BAD_TARGET_INDEX
+}, {
+ .itc_desc = "Bad TAD target index (2)",
+ .itc_imc = &imc_bad_tad_target,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_BAD_TARGET_INDEX
+}, {
+ .itc_desc = "Bad TAD target index (3)",
+ .itc_imc = &imc_bad_tad_target,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_TAD_BAD_TARGET_INDEX
+}, {
+ .itc_desc = "Bad TAD target channel (1)",
+ .itc_imc = &imc_bad_tad_channelid,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_ID
+}, {
+ .itc_desc = "Bad TAD target channel (2)",
+ .itc_imc = &imc_bad_tad_channelid,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_ID
+}, {
+ .itc_desc = "Bad TAD target channel (3)",
+ .itc_imc = &imc_bad_tad_channelid,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_ID
+}, {
+ .itc_desc = "Bad channel offset target (1)",
+ .itc_imc = &imc_bad_channel_offset,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET
+}, {
+ .itc_desc = "Bad channel offset target (2)",
+ .itc_imc = &imc_bad_channel_offset,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET
+}, {
+ .itc_desc = "Bad channel offset target (3)",
+ .itc_imc = &imc_bad_channel_offset,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_CHANNEL_TAD_OFFSET
+}, {
+ .itc_desc = "Bad RIR rule (1)",
+ .itc_imc = &imc_bad_rir_rule,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_RIR_RULE
+}, {
+ .itc_desc = "Bad RIR rule (2)",
+ .itc_imc = &imc_bad_rir_rule,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_NO_RIR_RULE
+}, {
+ .itc_desc = "Bad RIR rule (3)",
+ .itc_pa = 0x123456789ULL,
+ .itc_imc = &imc_bad_rir_rule,
+ .itc_fail = IMC_DECODE_F_NO_RIR_RULE
+}, {
+ .itc_desc = "Bad RIR interleave target (1)",
+ .itc_imc = &imc_bad_rir_ileave,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET
+}, {
+ .itc_desc = "Bad RIR interleave target (2)",
+ .itc_imc = &imc_bad_rir_ileave,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET
+}, {
+ .itc_desc = "Bad RIR interleave target (3)",
+ .itc_imc = &imc_bad_rir_ileave,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_RIR_ILEAVE_TARGET
+}, {
+ .itc_desc = "Bad RIR DIMM target (1)",
+ .itc_imc = &imc_bad_dimm_index,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_INDEX
+}, {
+ .itc_desc = "Bad RIR DIMM target (2)",
+ .itc_imc = &imc_bad_dimm_index,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_INDEX
+}, {
+ .itc_desc = "Bad RIR DIMM target (3)",
+ .itc_imc = &imc_bad_dimm_index,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_INDEX
+}, {
+ .itc_desc = "Bad RIR DIMM target (1)",
+ .itc_imc = &imc_missing_dimm,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_DIMM_NOT_PRESENT
+}, {
+ .itc_desc = "Bad RIR DIMM target (2)",
+ .itc_imc = &imc_missing_dimm,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_DIMM_NOT_PRESENT
+}, {
+ .itc_desc = "Bad RIR DIMM target (3)",
+ .itc_imc = &imc_missing_dimm,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_DIMM_NOT_PRESENT
+}, {
+ .itc_desc = "Bad RIR rank target (1)",
+ .itc_imc = &imc_bad_rank_index,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_RANK
+}, {
+ .itc_desc = "Bad RIR rank target (2)",
+ .itc_imc = &imc_bad_rank_index,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_RANK
+}, {
+ .itc_desc = "Bad RIR rank target (3)",
+ .itc_imc = &imc_bad_rank_index,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_DIMM_RANK
+}, {
+ .itc_desc = "Bad channel offset underflow (1)",
+ .itc_imc = &imc_chanoff_underflow,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_CHANOFF_UNDERFLOW
+}, {
+ .itc_desc = "Bad channel offset underflow (2)",
+ .itc_imc = &imc_chanoff_underflow,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_CHANOFF_UNDERFLOW
+}, {
+ .itc_desc = "Bad channel offset underflow (3)",
+ .itc_imc = &imc_chanoff_underflow,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_CHANOFF_UNDERFLOW
+}, {
+ .itc_desc = "Bad rank offset underflow (1)",
+ .itc_imc = &imc_riroff_underflow,
+ .itc_pa = 0x45,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_RANKOFF_UNDERFLOW
+}, {
+ .itc_desc = "Bad rank offset underflow (2)",
+ .itc_imc = &imc_riroff_underflow,
+ .itc_pa = 0x7fffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_RANKOFF_UNDERFLOW
+}, {
+ .itc_desc = "Bad rank offset underflow (3)",
+ .itc_imc = &imc_riroff_underflow,
+ .itc_pa = 0x123456789ULL,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_RANKOFF_UNDERFLOW
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_rir.c b/usr/src/test/os-tests/tests/imc/imc_test_rir.c
new file mode 100644
index 0000000000..8feedc690d
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_rir.c
@@ -0,0 +1,856 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * Test various aspects of RIR decoding and rank interleaving.
+ *
+ * The first test series uses imc_rir_8w_4r_closed which basically tests our
+ * rank interleaving across a single DIMM/channel in a closed page
+ * configuration. Technically such a configuration has aliasing, so it
+ * shouldn't be used in the wild. This is to validate that we're doing
+ * interleaving with a single rule across closed pages.
+ *
+ * The second test set, imc_rir_4w_4r_open is similar; however, it uses open
+ * pages instead.
+ *
+ * The third test set, imc_rir_8w_4r_2dpc, is used to make sure that we can
+ * properly perform interleaving across two DIMMs in a single channel
+ * configuration.
+ *
+ * The fourth test set, imc_rir_2w_1r_3dpc, is used to make sure that we can use
+ * multiple rank interleaving rules to point us to different parts of a DIMM on
+ * a single channel.
+ */
+
+static const imc_t imc_rir_8w_4r_closed = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_TRUE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 4,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 8,
+ .irle_nwaysbits = 3,
+ .irle_limit = 0x80000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x3, 0x0 },
+ .irle_entries[1] = { 0x2, 0x0 },
+ .irle_entries[2] = { 0x1, 0x0 },
+ .irle_entries[3] = { 0x0, 0x0 },
+ .irle_entries[4] = { 0x2, 0x0 },
+ .irle_entries[5] = { 0x3, 0x0 },
+ .irle_entries[6] = { 0x0, 0x0 },
+ .irle_entries[7] = { 0x1, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_rir_4w_4r_open = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 8,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 4,
+ .irle_nwaysbits = 2,
+ .irle_limit = 0x80000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x2, 0x0 },
+ .irle_entries[1] = { 0x0, 0x0 },
+ .irle_entries[2] = { 0x3, 0x0 },
+ .irle_entries[3] = { 0x1, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_rir_8w_4r_2dpc = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_TRUE,
+ .icn_channels[0] = {
+ .ich_ndimms = 2,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 4,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_dimms[1] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 4,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 8,
+ .irle_nwaysbits = 3,
+ .irle_limit = 0x100000000ULL,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ .irle_entries[1] = { 0x4, 0x0 },
+ .irle_entries[2] = { 0x1, 0x0 },
+ .irle_entries[3] = { 0x5, 0x0 },
+ .irle_entries[4] = { 0x2, 0x0 },
+ .irle_entries[5] = { 0x6, 0x0 },
+ .irle_entries[6] = { 0x3, 0x0 },
+ .irle_entries[7] = { 0x7, 0x0 }
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_rir_2w_1r_3dpc = {
+ .imc_gen = IMC_GEN_HASWELL,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x180000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x180000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x180000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_TRUE,
+ .icn_channels[0] = {
+ .ich_ndimms = 3,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 1,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_dimms[1] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 1,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_dimms[2] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 1,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x80000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x80000000,
+ .irle_nentries = 2,
+ .irle_entries[0] = { 0x4, 0x0 },
+ .irle_entries[1] = { 0x0, 0x0 },
+ },
+ .ich_rankileaves[1] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x100000000ULL,
+ .irle_nentries = 2,
+ .irle_entries[0] = { 0x8, 0x40000000 },
+ .irle_entries[1] = { 0x4, 0x0 },
+ },
+ .ich_rankileaves[2] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 2,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x180000000ULL,
+ .irle_nentries = 2,
+ .irle_entries[0] = { 0x8, 0x40000000 },
+ .irle_entries[1] = { 0x0, 0x40000000 },
+ }
+ }
+ }
+ }
+};
+
+
+const imc_test_case_t imc_test_rir[] = { {
+ .itc_desc = "RIR target 0, 8-way/4-rank, closed (1)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 1, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x40,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x40,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 2, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x80,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x80,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 3, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0xc0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xc0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 4, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x100,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x100,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 5, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x140,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 6, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x180,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x180,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "RIR target 7, 8-way/4-rank, closed",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x1c0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1c0,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (1)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x4000012f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x4000012f,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x800002f
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (2)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x76543210,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x76543210,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0xeca8650
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (3)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x12345678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x12345678,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x2468af8
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (4)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x232023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x232023,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (5)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x232063,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x232063,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (6)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x2320a3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2320a3,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (7)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x2320e3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2320e3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (8)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x232123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x232123,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (9)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x232163,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x232163,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (10)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x2321a3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2321a3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "8-way/4-rank misc, closed (11)",
+ .itc_imc = &imc_rir_8w_4r_closed,
+ .itc_pa = 0x2321e3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2321e3,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x46423,
+}, {
+ .itc_desc = "4-way/4-rank, open (1)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x0,
+}, {
+ .itc_desc = "4-way/4-rank, open (2)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x2000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "4-way/4-rank, open (3)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x4000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x4000,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "4-way/4-rank, open (4)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x6000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x6000,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "4-way/4-rank, open (5)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x1234567,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1234567,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x48c567
+}, {
+ .itc_desc = "4-way/4-rank, open (6)",
+ .itc_imc = &imc_rir_4w_4r_open,
+ .itc_pa = 0x76543210,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x76543210,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1d951210
+}, {
+ .itc_desc = "2DPC (1)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabcfe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabcfe,
+ .itc_dimmid = 1,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x1d9b57be
+}, {
+ .itc_desc = "2DPC (2)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabd3e,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabd3e,
+ .itc_dimmid = 0,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x1d9b57be,
+}, {
+ .itc_desc = "2DPC (3)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabd7e,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabd7e,
+ .itc_dimmid = 1,
+ .itc_rankid = 2,
+ .itc_rankaddr = 0x1d9b57be
+}, {
+ .itc_desc = "2DPC (4)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabdbe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabdbe,
+ .itc_dimmid = 0,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x1d9b57be
+}, {
+ .itc_desc = "2DPC (5)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabdfe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabdfe,
+ .itc_dimmid = 1,
+ .itc_rankid = 3,
+ .itc_rankaddr = 0x1d9b57be
+}, {
+ .itc_desc = "2DPC (6)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabe3e,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabe3e,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1d9b57fe
+}, {
+ .itc_desc = "2DPC (7)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabe7e,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabe7e,
+ .itc_dimmid = 1,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1d9b57fe
+}, {
+ .itc_desc = "2DPC (8)",
+ .itc_imc = &imc_rir_8w_4r_2dpc,
+ .itc_pa = 0xecdabebe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xecdabebe,
+ .itc_dimmid = 0,
+ .itc_rankid = 1,
+ .itc_rankaddr = 0x1d9b57fe
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (1)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0x0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 1,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (2)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0x80000000ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x80000000ULL,
+ .itc_dimmid = 2,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (3)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0x100000000ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x100000000ULL,
+ .itc_dimmid = 2,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x40000000
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (4)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0x654321f5,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x654321f5,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x32a190f5
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (5)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0xdaddadf5,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0xdaddadf5,
+ .itc_dimmid = 1,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x6d6ed6f5
+}, {
+ .itc_desc = "Multi-RIR 1R 3DPC (6)",
+ .itc_imc = &imc_rir_2w_1r_3dpc,
+ .itc_pa = 0x170ff6099ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x170ff6099ULL,
+ .itc_dimmid = 2,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x787fb059
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_sad.c b/usr/src/test/os-tests/tests/imc/imc_test_sad.c
new file mode 100644
index 0000000000..ea10963585
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_sad.c
@@ -0,0 +1,3212 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * This tests various aspects of the source address decoder. We need to test
+ * several of the following:
+ *
+ * o SAD rules with different interleave options
+ * - XOR (SNB->BRD)
+ * - 10t8, 14t12, 32t30 (SKX)
+ * o SAD rules with a7mode (IVB->BRD)
+ * - And XOR
+ * o Different SAD rules for different regions
+ */
+
+/*
+ * This tests basics SAD interleaving with a 2 socket system that has a single
+ * channel and DIMM. The other aspects are simplified to try and make life
+ * easier.
+ */
+
+static const imc_t imc_sad_2s_basic = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This is a 4 socket variants of the previous one. Each DIMM now has a much
+ * smaller amount of memory in it.
+ */
+static const imc_t imc_sad_4s_basic = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 4,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[2] = {
+ .isock_nodeid = 2,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[3] = {
+ .isock_nodeid = 3,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This is similar to imc_sad_2s_basic; however, it enables the XOR mode.
+ */
+static const imc_t imc_sad_2s_xor = {
+ .imc_gen = IMC_GEN_IVY,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6XOR,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6XOR,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_sad_2s_a7 = {
+ .imc_gen = IMC_GEN_IVY,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This is a 4 socket variants of the previous one. Each DIMM now has a much
+ * smaller amount of memory in it.
+ */
+static const imc_t imc_sad_4s_a7 = {
+ .imc_gen = IMC_GEN_HASWELL,
+ .imc_nsockets = 4,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[2] = {
+ .isock_nodeid = 2,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[3] = {
+ .isock_nodeid = 3,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 2, 3, 0, 1, 2, 3 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 4,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x20000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x20000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This is similar to imc_sad_2s_basic; however, it enables the XOR mode.
+ */
+static const imc_t imc_sad_2s_a7_xor = {
+ .imc_gen = IMC_GEN_BROADWELL,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6XOR,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6XOR,
+ .isr_a7mode = B_TRUE,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This constructs an IMC that has multiple SAD rules that change how we
+ * interleave across different regions of memory.
+ */
+static const imc_t imc_sad_2s_multirule = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x20000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x40000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 1, 1, 1, 1, 1, 1, 1, 1 }
+ },
+ .isad_rules[2] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x60000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[3] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 1, 0, 1, 0, 1, 0, 1, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x20000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x20000000,
+ .itr_limit = 0x60000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[2] = {
+ .itr_base = 0x60000000,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x30000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x20000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 1, 0, 1, 0, 1, 0, 1 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x40000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 1, 1, 1, 1, 1, 1, 1, 1 }
+ },
+ .isad_rules[2] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x60000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[3] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 1, 0, 1, 0, 1, 0, 1, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x20000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x20000000,
+ .itr_limit = 0x60000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[2] = {
+ .itr_base = 0x60000000,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x10000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+static const imc_t imc_sad_2s_skx_10t8 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_10t8,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 1, 8, 1, 8, 1, 8, 1 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_256B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_10t8,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 8, 0, 8, 0, 8, 0, 8 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_256B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0x100, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This performs 2 way interleaving across memory controllers, rather than
+ * across sockets.
+ */
+static const imc_t imc_sad_1s_skx_14t12 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_14t12,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_4KB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 2,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_4KB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+};
+
+static const imc_t imc_sad_4s_8w_skx_32t30 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 4,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0x280000000ULL,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 3, 3, 0, 0, 1, 1, 2, 2 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0x280000000ULL,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 3, 3, 0, 0, 8, 9, 2, 2 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[2] = {
+ .isock_nodeid = 2,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0x280000000ULL,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 3, 3, 0, 0, 1, 1, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[3] = {
+ .isock_nodeid = 3,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0x280000000ULL,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_rules[1] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x280000000ULL,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0, 0, 1, 1, 2, 2 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x100000000ULL,
+ .itr_limit = 0x280000000ULL,
+ .itr_sock_way = 8,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x200000000ULL, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 1,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x240000000ULL, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+};
+
+const imc_test_case_t imc_test_sad[] = {
+/*
+ * This first set of tests just makes sure that we properly handle SAD
+ * interleaving rules and get routed to the right socket.
+ */
+{
+ .itc_desc = "2 Socket SAD 8-6 Interleave (1)",
+ .itc_imc = &imc_sad_2s_basic,
+ .itc_pa = 0x0,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "2 Socket SAD 8-6 Interleave (2)",
+ .itc_imc = &imc_sad_2s_basic,
+ .itc_pa = 0x12345678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91a2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91a2b38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 Interleave (3)",
+ .itc_imc = &imc_sad_2s_basic,
+ .itc_pa = 0x12345638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91a2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91a2b38
+},
+/*
+ * This is the same as above, but uses a 4-socket configuration instead.
+ */
+{
+ .itc_desc = "4 Socket SAD 8-6 Interleave (1)",
+ .itc_imc = &imc_sad_4s_basic,
+ .itc_pa = 0x12345638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x48d15b8,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x48d15b8
+}, {
+ .itc_desc = "4 Socket SAD 8-6 Interleave (2)",
+ .itc_imc = &imc_sad_4s_basic,
+ .itc_pa = 0x12345678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x48d15b8,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x48d15b8
+}, {
+ .itc_desc = "4 Socket SAD 8-6 Interleave (3)",
+ .itc_imc = &imc_sad_4s_basic,
+ .itc_pa = 0x123456b8,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x48d15b8,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x48d15b8
+}, {
+ .itc_desc = "4 Socket SAD 8-6 Interleave (4)",
+ .itc_imc = &imc_sad_4s_basic,
+ .itc_pa = 0x123456f8,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x48d15b8,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x48d15b8
+},
+/*
+ * This is a variant on the basic 2s tests. XOR mode is enabled, so we use that
+ * to see that we actually have differences versus the basic 2s tests.
+ */
+{
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (1)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12345638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91a2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91a2b38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (2)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12345678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91a2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91a2b38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (3)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12355638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91aab38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91aab38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (4)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12355678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91aab38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91aab38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (5)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12365638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91b2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91b2b38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (6)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12365678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91b2b38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91b2b38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (7)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12375638,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91bab38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91bab38
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR Interleave (8)",
+ .itc_imc = &imc_sad_2s_xor,
+ .itc_pa = 0x12375678,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x91bab38,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x91bab38
+},
+/*
+ * Next, we're going to repeat the same initial set of tests that we had, but
+ * we're also going to turn on a7 mode. First up is the 2 socket case.
+ */
+{
+ .itc_desc = "2 Socket SAD 8-6 A7 Interleave (1)",
+ .itc_imc = &imc_sad_2s_a7,
+ .itc_pa = 0x2342000f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x11a1000f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x11a1000f
+}, {
+ .itc_desc = "2 Socket SAD 8-6 A7 Interleave (2)",
+ .itc_imc = &imc_sad_2s_a7,
+ .itc_pa = 0x2342004f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x11a1004f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x11a1004f
+}, {
+ .itc_desc = "2 Socket SAD 8-6 A7 Interleave (3)",
+ .itc_imc = &imc_sad_2s_a7,
+ .itc_pa = 0x2342020f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x11a1010f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x11a1010f
+}, {
+ .itc_desc = "2 Socket SAD 8-6 A7 Interleave (4)",
+ .itc_imc = &imc_sad_2s_a7,
+ .itc_pa = 0x2342024f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x11a1014f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x11a1014f
+},
+/*
+ * Next, we're going to repeat the same initial set of tests that we had, but
+ * we're also going to turn on a7 mode. First up is the 4 socket case.
+ */
+{
+ .itc_desc = "4 Socket SAD 8-6 A7 (1)",
+ .itc_imc = &imc_sad_4s_a7,
+ .itc_pa = 0x2342000f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08d0800f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08d0800f
+}, {
+ .itc_desc = "4 Socket SAD 8-6 A7 (2)",
+ .itc_imc = &imc_sad_4s_a7,
+ .itc_pa = 0x2342008f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08d0800f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08d0800f
+}, {
+ .itc_desc = "4 Socket SAD 8-6 A7 (3)",
+ .itc_imc = &imc_sad_4s_a7,
+ .itc_pa = 0x2342020f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08d0808f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08d0808f
+}, {
+ .itc_desc = "4 Socket SAD 8-6 A7 (4)",
+ .itc_imc = &imc_sad_4s_a7,
+ .itc_pa = 0x2342028f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08d0808f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08d0808f
+}, {
+ .itc_desc = "4 Socket SAD 8-6 A7 (5)",
+ .itc_imc = &imc_sad_4s_a7,
+ .itc_pa = 0x23420f8f,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08d0838f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08d0838f
+},
+/*
+ * 2 Socket 8-6 XOR mode, with a7 set. Here, we'll end up working through all of
+ * the XOR permutations to make sure that we're in good shape.
+ */
+{
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (1)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4200000b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2100000b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2100000b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (2)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4200020b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2100010b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2100010b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (3)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4201000b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2100800b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2100800b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (4)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4201020b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2100810b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2100810b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (5)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4202000b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2101000b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2101000b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (6)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4202020b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2101010b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2101010b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (7)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4203000b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2101800b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2101800b
+}, {
+ .itc_desc = "2 Socket SAD 8-6 XOR A7 (8)",
+ .itc_imc = &imc_sad_2s_a7_xor,
+ .itc_pa = 0x4203020b,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2101810b,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2101810b
+},
+/*
+ * This is a multi-rule SAD that alternates how we target socket interleaving
+ * depending on which address range we're at.
+ */
+{
+ .itc_desc = "SAD Multi-rule (1)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x0ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x07fb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x07fb0003
+}, {
+ .itc_desc = "SAD Multi-rule (2)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x0ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x07fb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x07fb0003
+}, {
+ .itc_desc = "SAD Multi-rule (3)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x1ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0ffb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0ffb0003
+}, {
+ .itc_desc = "SAD Multi-rule (4)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x1ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0ffb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0ffb0003
+}, {
+ .itc_desc = "SAD Multi-rule (5)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x2ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1ff60003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1ff60003
+},
+{
+ .itc_desc = "SAD Multi-rule (6)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x2ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1ff60043,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1ff60043
+}, {
+ .itc_desc = "SAD Multi-rule (7)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x3ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2ff60003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2ff60003
+}, {
+ .itc_desc = "SAD Multi-rule (8)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x3ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2ff60043,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2ff60043
+}, {
+ .itc_desc = "SAD Multi-rule (9)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x4ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1ff60003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1ff60003
+}, {
+ .itc_desc = "SAD Multi-rule (10)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x4ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1ff60043,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1ff60043
+}, {
+ .itc_desc = "SAD Multi-rule (11)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x5ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2ff60003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2ff60003
+}, {
+ .itc_desc = "SAD Multi-rule (12)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x5ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x2ff60043,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2ff60043
+}, {
+ .itc_desc = "SAD Multi-rule (13)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x6ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x37fb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x37fb0003
+}, {
+ .itc_desc = "SAD Multi-rule (14)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x6ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x37fb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x37fb0003
+}, {
+ .itc_desc = "SAD Multi-rule (15)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x7ff60003,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3ffb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3ffb0003
+}, {
+ .itc_desc = "SAD Multi-rule (16)",
+ .itc_imc = &imc_sad_2s_multirule,
+ .itc_pa = 0x7ff60043,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3ffb0003,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3ffb0003
+},
+/*
+ * Verify that SAD interleaving at 10-8 works.
+ */
+{
+ .itc_desc = "SAD 2s SKX 10-8 (1)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x11220000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910000
+}, {
+ .itc_desc = "SAD 2s SKX 10-8 (2)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x11220100,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910000
+}, {
+ .itc_desc = "SAD 2s SKX 10-8 (3)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x112200ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089100ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089100ff
+}, {
+ .itc_desc = "SAD 2s SKX 10-8 (4)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x112201ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089100ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089100ff
+}, {
+ .itc_desc = "SAD 2s SKX 10-8 (5)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x7ffffeff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fffffff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fffffff
+}, {
+ .itc_desc = "SAD 2s SKX 10-8 (6)",
+ .itc_imc = &imc_sad_2s_skx_10t8,
+ .itc_pa = 0x7fffffff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fffffff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fffffff
+},
+/*
+ * Again with SKX; however, now with 15-12.
+ */
+{
+ .itc_desc = "SAD 2s SKX 14-12 (1)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x11220000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910000
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (2)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x11220100,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910100,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910100
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (3)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x112200ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089100ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089100ff
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (4)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x112201ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089101ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089101ff
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (5)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x11221000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910000
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (6)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x11221100,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x08910100,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x08910100
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (7)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x112210ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089100ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089100ff
+}, {
+ .itc_desc = "SAD 2s SKX 14-12 (8)",
+ .itc_imc = &imc_sad_1s_skx_14t12,
+ .itc_pa = 0x112211ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x089101ff,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x089101ff
+},
+/*
+ * This set covers using an 8-way socket granularity on Skylake. This means that
+ * we have two IMCs per socket as well. We're also using 1 GiB granularity here.
+ * So we want to verify that is working as well.
+ */
+{
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (1)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x0badcafe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (2)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x4badcafe,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (3)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x10badcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (4)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x14badcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (5)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x18badcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (6)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x1cbadcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (7)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x20badcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (8)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x24badcafeULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badcafe,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badcafe
+},
+
+{
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (9)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x0badca77,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (10)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x4badca77,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (11)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x10badca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (12)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x14badca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (13)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x18badca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (14)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x1cbadca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 2,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (15)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x20badca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = "SAD 4s 8-way SKX 32-30 (16)",
+ .itc_imc = &imc_sad_4s_8w_skx_32t30,
+ .itc_pa = 0x24badca77ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 3,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0badca77,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0badca77
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_skx_loop.c b/usr/src/test/os-tests/tests/imc/imc_test_skx_loop.c
new file mode 100644
index 0000000000..5efa0998f1
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_skx_loop.c
@@ -0,0 +1,175 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * Verify that we properly detect loops on Skylake based multi-socket systems.
+ * This represents an erroneous condition.
+ */
+
+/*
+ * This is a multi-socket bare bones Skylake structure (we don't bother with
+ * anything past the SAD as we should never need it. This checks to make sure
+ * that we detect such a loop.
+ */
+static const imc_t imc_skx_loop_2s = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 1, 1, 1, 1, 1, 1, 1, 1 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ }
+ }
+ }
+};
+
+/*
+ * This has a target that causes us to loop back to ourselves.
+ */
+static const imc_t imc_skx_loop_self = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ }
+ }
+ }
+};
+
+/*
+ * This referes to a non-existant socket in the search loop.
+ */
+static const imc_t imc_skx_loop_badsock = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 5, 5, 5, 5, 5, 5, 5, 5 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ }
+ }
+ }
+};
+
+const imc_test_case_t imc_test_skx_loop[] = { {
+ .itc_desc = "Skylake loop detection, 2s (1)",
+ .itc_imc = &imc_skx_loop_2s,
+ .itc_pa = 0x0,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_SEARCH_LOOP
+}, {
+ .itc_desc = "Skylake loop detection, 2s (2)",
+ .itc_imc = &imc_skx_loop_2s,
+ .itc_pa = 0x7fffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_SEARCH_LOOP
+}, {
+ .itc_desc = "Skylake loop detection, self (1)",
+ .itc_imc = &imc_skx_loop_self,
+ .itc_pa = 0x0,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_SEARCH_LOOP
+}, {
+ .itc_desc = "Skylake loop detection, self (2)",
+ .itc_imc = &imc_skx_loop_self,
+ .itc_pa = 0x7fffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_SAD_SEARCH_LOOP
+}, {
+ .itc_desc = "Skylake loop detection, bad sock (1)",
+ .itc_imc = &imc_skx_loop_badsock,
+ .itc_pa = 0x0,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_REMOTE_MC_ROUTE
+}, {
+ .itc_desc = "Skylake loop detection, bad sock (2)",
+ .itc_imc = &imc_skx_loop_badsock,
+ .itc_pa = 0x7fffffff,
+ .itc_pass = B_FALSE,
+ .itc_fail = IMC_DECODE_F_BAD_REMOTE_MC_ROUTE
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/imc/imc_test_tad.c b/usr/src/test/os-tests/tests/imc/imc_test_tad.c
new file mode 100644
index 0000000000..b16edbd7b2
--- /dev/null
+++ b/usr/src/test/os-tests/tests/imc/imc_test_tad.c
@@ -0,0 +1,5228 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+#include "imc_test.h"
+
+/*
+ * This tests various aspects of the target address decoder.
+ *
+ * o TAD rules with different channel interleaving
+ * o TAD rules with channel shifting (IVB->BRD)
+ * o TAD rules with channel hashing (IVB->BRD)
+ * o TAD rules with different granularities (SKX)
+ * o Channel rules with mod2/3 variants (SKX)
+ *
+ * We use the most basic of SAD rules and RIR rules when constructing these.
+ * Those are more generally exercised elsewhere. Basic socket granularity rules
+ * are tested in imc_test_sad.c.
+ *
+ * There are currently no tests for mirroring or lockstep mode as that's not
+ * more generally supported.
+ */
+
+static const imc_t imc_tad_1s_2cw = {
+ .imc_gen = IMC_GEN_SANDY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This IMC has the a7mode/McChanShiftUp set. This means that instead of using
+ * bits 0-6 for an address, it should use bits 0-7.
+ */
+static const imc_t imc_tad_1s_2cw_shiftup = {
+ .imc_gen = IMC_GEN_IVY,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_a7mode = B_TRUE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANSHIFT,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This IMC has the channel hashing mode set on all of the channels in question.
+ * This means that the TAD will hash the upper address bits into the channel
+ * determination.
+ */
+static const imc_t imc_tad_1s_2cw_chanhash = {
+ .imc_gen = IMC_GEN_HASWELL,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = IMC_TAD_FLAG_CHANHASH,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This IMC has different TAD rules that cover different ranges, which change
+ * how we interleave. The main goal is to make sure that we're always going to
+ * the right place. This also requires us to set TAD offsets on a
+ * per-channel/TAD rule basis. These are required to correctly make sure that we
+ * map things. The following is how the address space should in theory look. We
+ * have 2 GiB (0x80000000) of address space. We break that into 4 512 MiB
+ * chunks. The first and last are 2-way interleaved. The middle two are 1-way
+ * interleaved to a specific channel.
+ */
+static const imc_t imc_tad_1s_multirule = {
+ .imc_gen = IMC_GEN_BROADWELL,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 0, 0, 0, 0, 0, 0, 0 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x20000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ },
+ .itad_rules[1] = {
+ .itr_base = 0x20000000,
+ .itr_limit = 0x40000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 1, 1, 0, 0 }
+ },
+ .itad_rules[2] = {
+ .itr_base = 0x40000000,
+ .itr_limit = 0x60000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 1,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ },
+ .itad_rules[3] = {
+ .itr_base = 0x60000000,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 1, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0x30000000, 0, 0,
+ 0, 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0x10000000, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * The purpse of this IMC is to use a combination of both socket and channel
+ * interleaving. It employs a system with two sockets, each which have 2 IMCs.
+ * Each IMC has two channels. We have a 4-way socket interleave followed by a
+ * 2-way channel interleave. We use a simplified memory layout (TOLM = 4 GiB) to
+ * simplify other rules.
+ */
+static const imc_t imc_tad_2s_2cw_4sw = {
+ .imc_gen = IMC_GEN_IVY,
+ .imc_nsockets = 2,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0x200000000ULL,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x200000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 4, 1, 5, 0, 4, 1, 5 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x200000000ULL,
+ .itr_sock_way = 4,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x200000000ULL,
+ .itr_sock_way = 4,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 1, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ },
+ .imc_sockets[1] = {
+ .isock_nodeid = 1,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 10,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 0, 4, 1, 5, 0, 4, 1, 5 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x200000000ULL,
+ .itr_sock_way = 4,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 1, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 12,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x200000000ULL,
+ .itr_sock_way = 4,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 1, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR3,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 8,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This IMC has a single socket with two IMCs and two channels. It uses the
+ * default granularities and sizes. This just serves as a basis for the
+ * subsequent tests.
+ */
+static const imc_t imc_skx_64b_gran = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This tests a different channel granularity. Note the channel and socket
+ * granulariites match at this point in time to simplify the test.
+ */
+static const imc_t imc_skx_256b_gran = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_10t8,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_256B,
+ .itr_chan_gran = IMC_TAD_GRAN_256B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This time, use a 4k granularity.
+ */
+static const imc_t imc_skx_4k_gran = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_14t12,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_4KB,
+ .itr_chan_gran = IMC_TAD_GRAN_4KB,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * Once more, with 1 GiB granularity.
+ */
+static const imc_t imc_skx_1g_gran = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x80000000,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x80000000,
+ .isr_imode = IMC_SAD_IMODE_32t30,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 8, 9, 8, 9, 8, 9 }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 }
+ }
+ },
+ .isock_ntad = 1,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x80000000,
+ .itr_sock_way = 1,
+ .itr_chan_way = 2,
+ .itr_sock_gran = IMC_TAD_GRAN_1GB,
+ .itr_chan_gran = IMC_TAD_GRAN_1GB,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 1,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * This tests a 1 socket, 4 channel-way configuration.
+ */
+static const imc_t imc_tad_1s_4cw = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 1, 1 },
+ .ismc_mcroutes[3] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 2,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on 1imc_tad_1s_4cw that uses Skylake mod3 rules to change how the
+ * target channel is determined. While we have six channels here, technically
+ * this configuration has wasted memory. This is on purpose to simplify the
+ * rules below.
+ */
+static const imc_t imc_tad_skx_mod3_45t6 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t6,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD3,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on imc_tad_skx_mod3_45t6, but here we test the 45t8 mod variant.
+ */
+static const imc_t imc_tad_skx_mod3_45t8 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t8,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD3,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on imc_tad_skx_mod3_45t6, but here we test the 45t12 mod variant.
+ */
+static const imc_t imc_tad_skx_mod3_45t12 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t12,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD3,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on imc_tad_skx_mod3_45t12, but instead of using mod3, we use the
+ * mod2 variant that favors 0/1. This menas we can only output route entries, 0,
+ * 1, 2, and 3.
+ */
+static const imc_t imc_tad_skx_mod2_01_45t12 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t12,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD2_01,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on imc_tad_skx_mod3_45t12, but instead of using mod3, we use the
+ * mod2 variant that favors 1/2. This menas we can only output route entries, 2,
+ * 3, 4, and 5.
+ */
+static const imc_t imc_tad_skx_mod2_12_45t12 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t12,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD2_12,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+/*
+ * A variant on imc_tad_skx_mod3_45t12, but instead of using mod3, we use the
+ * mod2 variant that favors 0/2. This means we can only output route entries, 0,
+ * 1, 4, and 5.
+ */
+static const imc_t imc_tad_skx_mod2_02_45t12 = {
+ .imc_gen = IMC_GEN_SKYLAKE,
+ .imc_nsockets = 1,
+ .imc_sockets[0] = {
+ .isock_nodeid = 0,
+ .isock_valid = IMC_SOCKET_V_VALID,
+ .isock_sad = {
+ .isad_flags = 0,
+ .isad_valid = IMC_SAD_V_VALID,
+ .isad_tolm = 0x100000000ULL,
+ .isad_tohm = 0,
+ .isad_nrules = 24,
+ .isad_rules[0] = {
+ .isr_enable = B_TRUE,
+ .isr_limit = 0x100000000ULL,
+ .isr_imode = IMC_SAD_IMODE_8t6,
+ .isr_need_mod3 = B_TRUE,
+ .isr_mod_mode = IMC_SAD_MOD_MODE_45t12,
+ .isr_mod_type = IMC_SAD_MOD_TYPE_MOD2_02,
+ .isr_ntargets = IMC_MAX_SAD_INTERLEAVE,
+ .isr_targets = { 8, 9, 0xa, 0xb, 8, 9, 0xa,
+ 0xb }
+ },
+ .isad_mcroute = {
+ .ismc_nroutes = 6,
+ .ismc_mcroutes[0] = { 0, 0 },
+ .ismc_mcroutes[1] = { 0, 1 },
+ .ismc_mcroutes[2] = { 0, 2 },
+ .ismc_mcroutes[3] = { 1, 2 },
+ .ismc_mcroutes[4] = { 1, 1 },
+ .ismc_mcroutes[5] = { 1, 0 }
+ }
+ },
+ .isock_ntad = 2,
+ .isock_tad[0] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_tad[1] = {
+ .itad_flags = 0,
+ .itad_nrules = 8,
+ .itad_rules[0] = {
+ .itr_base = 0x0,
+ .itr_limit = 0x100000000ULL,
+ .itr_sock_way = 1,
+ .itr_chan_way = 4,
+ .itr_sock_gran = IMC_TAD_GRAN_64B,
+ .itr_chan_gran = IMC_TAD_GRAN_64B,
+ .itr_ntargets = 4,
+ .itr_targets = { 0, 0, 0, 0 }
+ }
+ },
+ .isock_nimc = 2,
+ .isock_imcs[0] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ },
+ .isock_imcs[1] = {
+ .icn_nchannels = 3,
+ .icn_dimm_type = IMC_DIMM_DDR4,
+ .icn_ecc = B_TRUE,
+ .icn_lockstep = B_FALSE,
+ .icn_closed = B_FALSE,
+ .icn_channels[0] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[1] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ },
+ .icn_channels[2] = {
+ .ich_ndimms = 1,
+ .ich_dimms[0] = {
+ .idimm_present = B_TRUE,
+ .idimm_nbanks = 3,
+ .idimm_width = 8,
+ .idimm_density = 2,
+ .idimm_nranks = 2,
+ .idimm_nrows = 14,
+ .idimm_ncolumns = 10,
+ .idimm_size = 0x40000000
+ },
+ .ich_ntad_offsets = 12,
+ .ich_tad_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0 },
+ .ich_nrankileaves = 4,
+ .ich_rankileaves[0] = {
+ .irle_enabled = B_TRUE,
+ .irle_nways = 1,
+ .irle_nwaysbits = 1,
+ .irle_limit = 0x40000000,
+ .irle_nentries = 8,
+ .irle_entries[0] = { 0x0, 0x0 },
+ }
+ }
+ }
+ }
+};
+
+const imc_test_case_t imc_test_tad[] = {
+/*
+ * These tests come in pairs. The first two verify that we can get the same
+ * address on the channel and interleave. The second set verifies that we end up
+ * in the same channel when we're within interleaving. The third set shows that
+ * we interleave again and will be used as a point of comparison in the next
+ * group of tests. The fourth set varies this and makes sure that we can end up
+ * on the right channel at different address ranges.
+ */
+{
+ .itc_desc = "1 Socket, 2 Channel way (1)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x33333333,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x199999b3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999b3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (2)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x33333373,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x199999b3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999b3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (3)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x3333331a,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1999999a,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1999999a
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (4)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x33333342,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x19999982,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x19999982
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (5)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x333333b3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x199999f3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999f3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (6)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x333333f3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x199999f3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999f3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (7)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x22222222,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x11111122,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x11111122
+}, {
+ .itc_desc = "1 Socket, 2 Channel way (8)",
+ .itc_imc = &imc_tad_1s_2cw,
+ .itc_pa = 0x77777777,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3bbbbbb7,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3bbbbbb7
+},
+/*
+ * This next set of tests is similar to the previous one, except we have the
+ * a7mode / McChanShiftUp enabled, which means that we use 7-bits to index into
+ * the channel by default rather than 6. We have tests that compare this
+ * behavior that would have varied in the previous case, but does not now. We do
+ * this mostly by using the same initial set of addresses (tests 1-6 of the
+ * previous set).
+ */
+{
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (1)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x33333333,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x199999b3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999b3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (2)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x33333373,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x199999f3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999f3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (3)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x3333331a,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x1999999a,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1999999a
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (4)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x33333342,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x199999c2,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999c2
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (5)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x333333b3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x199999b3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999b3
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Shift Up (6)",
+ .itc_imc = &imc_tad_1s_2cw_shiftup,
+ .itc_pa = 0x333333f3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x199999f3,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x199999f3
+},
+/*
+ * This next set of tests focuses on channel hashing. This is when we take the
+ * upper bits of the system addrses and use that to influence which channel
+ * something should be directed to. To see this, we take addresses that have the
+ * same base address (using bits 0-11) and see that they channels based on the
+ * different upper bits, where as without channel hashing, we shouldn't expect
+ * that.
+ */
+{
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (1)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00000bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x000005ed,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x000005ed
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (2)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00001bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x00000ded,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x00000ded
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (3)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00011bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x00008ded,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x00008ded
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (4)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00111bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x00088ded,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x00088ded
+}, {
+ /* The channel shouldn't change as it's not a bit we index on */
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (5)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00311bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x00188ded,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x00188ded
+}, {
+ /* This one shouldn't change as the 1 is > bit 28 */
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (6)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x20111bad,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x10088ded,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x10088ded
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (7)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00000bed,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x000005ed,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x000005ed
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (8)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00100bed,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x000805ed,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x000805ed
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (9)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00300bed,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x001805ed,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x001805ed
+}, {
+ .itc_desc = "1 Socket, 2 Channel way, Hashing (10)",
+ .itc_imc = &imc_tad_1s_2cw_chanhash,
+ .itc_pa = 0x00500bed,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x002805ed,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x002805ed
+},
+/*
+ * This range of tests basically checks how we interleave in the multi-rule
+ * system that we've put together. We have regions that should be direct mapped
+ * an others that should be interleaved.
+ */
+{
+ .itc_desc = "1s Multi-rule (1)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x07654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03b2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03b2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (2)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x07654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03b2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03b2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (3)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x17654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0bb2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0bb2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (4)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x17654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0bb2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0bb2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (5)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x27654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x17654321,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x17654321
+}, {
+ .itc_desc = "1s Multi-rule (6)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x27654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x17654361,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x17654361
+}, {
+ .itc_desc = "1s Multi-rule (7)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x37654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x27654321,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27654321
+}, {
+ .itc_desc = "1s Multi-rule (8)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x37654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x27654361,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27654361
+}, {
+ .itc_desc = "1s Multi-rule (9)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x47654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x17654321,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x17654321
+}, {
+ .itc_desc = "1s Multi-rule (10)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x47654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x17654361,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x17654361
+}, {
+ .itc_desc = "1s Multi-rule (11)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x57654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x27654321,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27654321
+}, {
+ .itc_desc = "1s Multi-rule (12)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x57654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x27654361,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27654361
+}, {
+ .itc_desc = "1s Multi-rule (13)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x67654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x33b2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x33b2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (14)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x67654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x33b2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x33b2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (15)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x77654321,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3bb2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3bb2a1a1
+}, {
+ .itc_desc = "1s Multi-rule (16)",
+ .itc_imc = &imc_tad_1s_multirule,
+ .itc_pa = 0x77654361,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3bb2a1a1,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3bb2a1a1
+},
+/*
+ * This set of tests looks at using a combination of channel interleaving and
+ * socket interleaving and makes sure that we handle that correctly when across
+ * multiple IMCs and sockets. We have four tests per dimm. Two that show that we
+ * are consistent within the cache line. Two that show that we are consistent
+ * when we go to a different line.
+ */
+{
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (1)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60007,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (2)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (3)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150007ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (4)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150023ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (5)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60047,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (6)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60063,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (7)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150047ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (8)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150063ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (9)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60087,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (10)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff600a3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (11)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150087ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (12)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1500a3ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (13)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff600c7,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (14)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff600f3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec033,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec033
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (15)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1500c7ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (16)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1500f3ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a033,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a033
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (17)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60107,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (18)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (19)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150107ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (20)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150123ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (21)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60147,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (22)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60163,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (23)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150147ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (24)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150163ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (25)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff60187,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (26)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff601a3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fec023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (27)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff150187ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (28)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1501a3ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x3fe2a023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a023
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (29)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff601c7,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (30)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff601f3,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fec033,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fec033
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (31)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1501c7ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a007,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a007
+}, {
+ .itc_desc = "2 socket, 4-sock way, 2-channel way (32)",
+ .itc_imc = &imc_tad_2s_2cw_4sw,
+ .itc_pa = 0x1ff1501f3ULL,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 1,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3fe2a033,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3fe2a033
+},
+/*
+ * This begins a series of tests related to Skylake channel granularities.
+ */
+{
+ .itc_desc = "SKX 2ch 64b chan gran (1)",
+ .itc_imc = &imc_skx_64b_gran,
+ .itc_pa = 0x0c120000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090000
+}, {
+ .itc_desc = "SKX 2ch 64b chan gran (2)",
+ .itc_imc = &imc_skx_64b_gran,
+ .itc_pa = 0x0c120040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090000
+}, {
+ .itc_desc = "SKX 2ch 64b chan gran (3)",
+ .itc_imc = &imc_skx_64b_gran,
+ .itc_pa = 0x0c120023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090023
+}, {
+ .itc_desc = "SKX 2ch 64b chan gran (4)",
+ .itc_imc = &imc_skx_64b_gran,
+ .itc_pa = 0x0c120068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090028,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090028
+},
+/*
+ * Move onto a 256 byte granularity and repeat.
+ */
+{
+ .itc_desc = "SKX 2ch 256b chan gran (1)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090000
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (2)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090040
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (3)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090023
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (4)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090068
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (5)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090100,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090100
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (6)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090040
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (7)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090023
+}, {
+ .itc_desc = "SKX 2ch 256b chan gran (8)",
+ .itc_imc = &imc_skx_256b_gran,
+ .itc_pa = 0x0c120368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090168,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090168
+},
+/*
+ * Now, use 4k granularities.
+ */
+{
+ .itc_desc = "SKX 2ch 4k chan gran (1)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090000
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (2)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090040
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (3)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090023
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (4)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090068
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (5)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090300
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (6)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090140
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (7)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090123
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (8)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c120368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x06090368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090368
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (9)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090000
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (10)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c123040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06091040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06091040
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (11)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090023
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (12)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090068
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (13)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090300
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (14)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090140
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (15)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c123123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06091123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06091123
+}, {
+ .itc_desc = "SKX 2ch 4k chan gran (16)",
+ .itc_imc = &imc_skx_4k_gran,
+ .itc_pa = 0x0c121368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x06090368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x06090368
+},
+/*
+ * Use a 1 GiB Interleaving next.
+ */
+{
+ .itc_desc = "SKX 2ch 1g chan gran (1)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120000
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (2)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120040
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (3)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120023
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (4)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120068
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (5)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120300
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (6)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120140
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (7)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120123
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (8)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c120368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c120368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120368
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (9)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121000
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (10)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c123040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c123040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c123040
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (11)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121023
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (12)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121068
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (13)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121300
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (14)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121140
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (15)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c123123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c123123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c123123
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (16)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x0c121368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0c121368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c121368
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (1)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x4c120000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0c120000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120000
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (2)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x4c120040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0c120040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120040
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (3)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x5c120023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x1c120023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1c120023
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (4)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x6c120068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x2c120068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2c120068
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (5)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x7c120300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3c120300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3c120300
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (6)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x4c120140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0c120140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c120140
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (7)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x5c120123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x1c120123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1c120123
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (8)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x6c120368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x2c120368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2c120368
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (9)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x7c121000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3c121000,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3c121000
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (10)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x4c123040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0c123040,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0c123040
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (11)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x5c121023,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x1c121023,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1c121023
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (12)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x6c121068,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x2c121068,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2c121068
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (13)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x7c121300,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3c121300,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3c121300
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (14)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x7c121140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3c121140,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3c121140
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (15)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x6c123123,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x2c123123,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x2c123123
+}, {
+ .itc_desc = "SKX 2ch 1g chan gran (16)",
+ .itc_imc = &imc_skx_1g_gran,
+ .itc_pa = 0x5c121368,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x1c121368,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x1c121368
+},
+/*
+ * This round of tests puts together a 1 socekt configuration with 4 channel way
+ * interleaving. This means that we're interleaving across two IMCs in the same
+ * socket.
+ */
+{
+ .itc_desc = "1 socket, 4-channel way (1)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13006,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (2)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13046,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (3)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13086,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (4)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff130c6,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (5)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13026,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c26,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c26
+}, {
+ .itc_desc = "1 socket, 4-channel way (6)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13077,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fc4c37,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c37
+}, {
+ .itc_desc = "1 socket, 4-channel way (7)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff13099,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x03fc4c19,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c19
+}, {
+ .itc_desc = "1 socket, 4-channel way (8)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x0ff130ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c3f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c3f
+}, {
+ .itc_desc = "1 socket, 4-channel way (9)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x8ff13006,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x23fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x23fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (10)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x3ff13046,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0ffc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0ffc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (11)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x4ff13086,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x13fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x13fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (12)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x9ff130c6,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x27fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27fc4c06
+}, {
+ .itc_desc = "1 socket, 4-channel way (13)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0xdff13026,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x37fc4c26,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x37fc4c26
+}, {
+ .itc_desc = "1 socket, 4-channel way (14)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0xeff13077,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x3bfc4c37,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3bfc4c37
+}, {
+ .itc_desc = "1 socket, 4-channel way (15)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x4ff13099,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x13fc4c19,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x13fc4c19
+}, {
+ .itc_desc = "1 socket, 4-channel way (16)",
+ .itc_imc = &imc_tad_1s_4cw,
+ .itc_pa = 0x8ff130ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x23fc4c3f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x23fc4c3f
+},
+/*
+ * Test the first variation of mod3 rules. We basically try to find addresses
+ * that map to all 6 channels and then do different variations thereof. We
+ * mostly use the addresses from the previous test run to get a good random
+ * smattering of addresses.
+ */
+{
+ .itc_desc = "1s mod 3 45t6 (1)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13006,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (2)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13046,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (3)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13086,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (4)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff130c6,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x03fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (5)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13026,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x03fc4c26,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c26
+}, {
+ .itc_desc = "1s mod 3 45t6 (6)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13077,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c37,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c37
+}, {
+ .itc_desc = "1s mod 3 45t6 (7)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff13099,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x03fc4c19,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c19
+}, {
+ .itc_desc = "1s mod 3 45t6 (8)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x0ff130ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x03fc4c3f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x03fc4c3f
+}, {
+ .itc_desc = "1s mod 3 45t6 (9)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x8ff13006,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x23fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x23fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (10)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x3ff13046,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0ffc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0ffc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (11)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x4ff13086,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x13fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x13fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (12)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x9ff130c6,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x27fc4c06,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x27fc4c06
+}, {
+ .itc_desc = "1s mod 3 45t6 (13)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0xdff13026,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x37fc4c26,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x37fc4c26
+}, {
+ .itc_desc = "1s mod 3 45t6 (14)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0xeff13077,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x3bfc4c37,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x3bfc4c37
+}, {
+ .itc_desc = "1s mod 3 45t6 (15)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x4ff13099,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x13fc4c19,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x13fc4c19
+}, {
+ .itc_desc = "1s mod 3 45t6 (16)",
+ .itc_imc = &imc_tad_skx_mod3_45t6,
+ .itc_pa = 0x8ff130ff,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x23fc4c3f,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x23fc4c3f
+},
+/*
+ * Now use PA bits 45:8 to determine the basic mod3 rule. We make sure that we
+ * can construct addresses that hit every routing table entry.
+ */
+{
+ .itc_desc = "1s mod 3 45t8 (1)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod 3 45t8 (2)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod 3 45t8 (3)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000100,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x40,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x40
+}, {
+ .itc_desc = "1s mod 3 45t8 (4)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000140,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x40,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x40
+}, {
+ .itc_desc = "1s mod 3 45t8 (5)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000280,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x80,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x80
+}, {
+ .itc_desc = "1s mod 3 45t8 (6)",
+ .itc_imc = &imc_tad_skx_mod3_45t8,
+ .itc_pa = 0x00000240,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x80,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x80
+},
+/*
+ * Hit every valid routing table entry with a 45:12 rule.
+ */
+{
+ .itc_desc = "1s mod 3 45t12 (1)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00000000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod 3 45t12 (2)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00000040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod 3 45t12 (3)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00001000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod 3 45t12 (4)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00001040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod 3 45t12 (5)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00002080,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = "1s mod 3 45t12 (6)",
+ .itc_imc = &imc_tad_skx_mod3_45t12,
+ .itc_pa = 0x00002040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+},
+/*
+ * Test to make sure we can trigger all variants of mod2 favoring 0/1.
+ */
+{
+ .itc_desc = "1s mod2_01 45t12 (1)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00000000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_01 45t12 (2)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00000040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_01 45t12 (3)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00001000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_01 45t12 (4)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00001040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_01 45t12 (5)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00002080,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = "1s mod2_01 45t12 (6)",
+ .itc_imc = &imc_tad_skx_mod2_01_45t12,
+ .itc_pa = 0x00002040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+},
+/*
+ * Test to make sure we can trigger all variants of mod2 favoring 1/2.
+ */
+{
+ .itc_desc = "1s mod2_12 45t12 (1)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00000000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_12 45t12 (2)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00000040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_12 45t12 (3)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00001000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_12 45t12 (4)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00001040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_12 45t12 (5)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00002080,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = "1s mod2_12 45t12 (6)",
+ .itc_imc = &imc_tad_skx_mod2_12_45t12,
+ .itc_pa = 0x00002040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 2,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+},
+/*
+ * Test to make sure we can trigger all variants of mod2 favoring 0/2.
+ */
+{
+ .itc_desc = "1s mod2_02 45t12 (1)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00000000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_02 45t12 (2)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00000040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x0,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x0
+}, {
+ .itc_desc = "1s mod2_02 45t12 (3)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00001000,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_02 45t12 (4)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00001040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 1,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x400,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x400
+}, {
+ .itc_desc = "1s mod2_02 45t12 (5)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00002080,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 0,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = "1s mod2_02 45t12 (6)",
+ .itc_imc = &imc_tad_skx_mod2_02_45t12,
+ .itc_pa = 0x00002040,
+ .itc_pass = B_TRUE,
+ .itc_nodeid = 0,
+ .itc_tadid = 0,
+ .itc_channelid = 1,
+ .itc_chanaddr = 0x800,
+ .itc_dimmid = 0,
+ .itc_rankid = 0,
+ .itc_rankaddr = 0x800
+}, {
+ .itc_desc = NULL
+} };
diff --git a/usr/src/test/os-tests/tests/poll/Makefile b/usr/src/test/os-tests/tests/poll/Makefile
index ae416f9628..feffc744fb 100644
--- a/usr/src/test/os-tests/tests/poll/Makefile
+++ b/usr/src/test/os-tests/tests/poll/Makefile
@@ -11,7 +11,7 @@
#
# Copyright (c) 2012 by Delphix. All rights reserved.
-# Copyright 2016 Joyent, Inc.
+# Copyright 2017 Joyent, Inc.
#
include $(SRC)/cmd/Makefile.cmd
@@ -26,7 +26,7 @@ poll_test.ln := LDLIBS += -lsocket
CSTD = $(CSTD_GNU99)
ROOTOPTPKG = $(ROOT)/opt/os-tests
-TESTDIR = $(ROOTOPTPKG)/tests
+TESTDIR = $(ROOTOPTPKG)/tests/poll
CMDS = $(PROG:%=$(TESTDIR)/%)
$(CMDS) := FILEMODE = 0555
diff --git a/usr/src/test/os-tests/tests/secflags/secflags_dts.sh b/usr/src/test/os-tests/tests/secflags/secflags_dts.sh
index 0086ed065e..160ec0d5a7 100644
--- a/usr/src/test/os-tests/tests/secflags/secflags_dts.sh
+++ b/usr/src/test/os-tests/tests/secflags/secflags_dts.sh
@@ -37,12 +37,12 @@ main(int argc, char **argv)
}
EOF
-gcc -o tester-aslr tester.c -Wl,-z,aslr=enabled
-gcc -o tester-noaslr tester.c -Wl,-z,aslr=disabled
+gcc -m32 -o tester-aslr tester.c -Wl,-z,aslr=enabled
+gcc -m32 -o tester-noaslr tester.c -Wl,-z,aslr=disabled
# This is the easiest way I've found to get many many DTs, but it's gross
-gcc -o many-dts-aslr tester.c -Wl,-z,aslr=enabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
-gcc -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
+gcc -m32 -o many-dts-aslr tester.c -Wl,-z,aslr=enabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
+gcc -m32 -o many-dts-noaslr tester.c -Wl,-z,aslr=disabled $(for elt in /usr/lib/lib*.so; do echo -Wl,-N,$(basename $elt); done)
check() {
bin=$1
diff --git a/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh b/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh
index 3ea807f9ae..699b4fe04a 100644
--- a/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh
+++ b/usr/src/test/os-tests/tests/secflags/secflags_zonecfg.sh
@@ -12,14 +12,20 @@
#
# Copyright 2015, Richard Lowe.
+# Copyright 2019 Joyent, Inc.
# Verify that zones can be configured with security-flags
LC_ALL=C # Collation is important
+IS_SMARTOS=$(uname -v | grep ^joyent_)
+if [[ -z "$IS_SMARTOS" ]]; then
+ create_flag="-b"
+fi
+
expect_success() {
name=$1
- (echo "create -b";
+ (echo "create $create_flag";
echo "set zonepath=/$name.$$";
cat /dev/stdin;
echo "verify";
@@ -46,7 +52,7 @@ expect_fail() {
name=$1
expect=$2
- (echo "create -b";
+ (echo "create $create_flag";
echo "set zonepath=/$name.$$";
cat /dev/stdin;
echo "verify";
diff --git a/usr/src/test/os-tests/tests/timer/Makefile b/usr/src/test/os-tests/tests/timer/Makefile
new file mode 100644
index 0000000000..4c88f2465e
--- /dev/null
+++ b/usr/src/test/os-tests/tests/timer/Makefile
@@ -0,0 +1,50 @@
+#
+# 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 2018 Joyent, Inc.
+#
+
+include $(SRC)/Makefile.master
+
+ROOTOPTPKG = $(ROOT)/opt/os-tests
+TESTDIR = $(ROOTOPTPKG)/tests/timer
+
+PROGS = timer_limit
+
+include $(SRC)/cmd/Makefile.cmd
+include $(SRC)/test/Makefile.com
+
+CSTD= $(CSTD_GNU99)
+
+
+CMDS = $(PROGS:%=$(TESTDIR)/%)
+$(CMDS) := FILEMODE = 0555
+
+all: $(PROGS)
+
+install: all $(CMDS)
+
+lint:
+
+clobber: clean
+ -$(RM) $(PROGS)
+
+clean:
+ -$(RM) *.o
+
+$(CMDS): $(TESTDIR) $(PROGS)
+
+$(TESTDIR):
+ $(INS.dir)
+
+$(TESTDIR)/%: %
+ $(INS.file)
diff --git a/usr/src/test/os-tests/tests/timer/timer_limit.c b/usr/src/test/os-tests/tests/timer/timer_limit.c
new file mode 100644
index 0000000000..77473c806f
--- /dev/null
+++ b/usr/src/test/os-tests/tests/timer/timer_limit.c
@@ -0,0 +1,83 @@
+/*
+ * 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 2016 Joyent, Inc.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <time.h>
+#include <limits.h>
+#include <assert.h>
+#include <sys/sysconfig.h>
+#include <sys/sysmacros.h>
+
+/* Need direct access to _sysconfig to query NCPU */
+extern long _sysconfig(int);
+
+
+static int
+mktimer(timer_t *timer)
+{
+ struct sigevent sev;
+ sev.sigev_notify = SIGEV_SIGNAL;
+ sev.sigev_signo = SIGRTMIN;
+ sev.sigev_value.sival_ptr = timer;
+
+ return (timer_create(CLOCK_MONOTONIC, &sev, timer));
+}
+
+int
+main()
+{
+ long ncpu;
+ size_t limit;
+ timer_t *timers, timer_overage;
+
+ /* Query NCPU with private sysconfig param */
+ ncpu = _sysconfig(_CONFIG_NPROC_NCPU);
+ assert(ncpu > 0 && ncpu < INT32_MAX);
+
+ /* Current specified limit is 4 * NCPU */
+ limit = 4 * ncpu;
+ timers = calloc(limit + 1, sizeof (timer_t));
+ assert(timers != NULL);
+
+ /* Slowly walk up to the limit doing creations/deletions */
+ for (int i = 1; i <= limit; i = MIN(limit, i*2)) {
+ for (int j = 0; j < i; j++) {
+ assert(mktimer(&timers[j]) == 0);
+ }
+
+ /*
+ * Attempt to allocate one additional timer if we've reached
+ * the assumed limit.
+ */
+ if (i == limit) {
+ assert(mktimer(&timer_overage) == -1);
+ }
+
+ for (int j = 0; j < i; j++) {
+ assert(timer_delete(timers[j]) == 0);
+ }
+
+ /* Bail out if we've finished at the limit */
+ if (i == limit)
+ break;
+ }
+
+
+ return (0);
+}
diff --git a/usr/src/test/os-tests/tests/tmpfs/Makefile b/usr/src/test/os-tests/tests/tmpfs/Makefile
new file mode 100644
index 0000000000..d6515b38fa
--- /dev/null
+++ b/usr/src/test/os-tests/tests/tmpfs/Makefile
@@ -0,0 +1,52 @@
+#
+# 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 2016 Joyent, Inc.
+#
+
+include $(SRC)/Makefile.master
+
+ROOTOPTPKG = $(ROOT)/opt/os-tests
+TESTDIR = $(ROOTOPTPKG)/tests/tmpfs
+
+PROGS = tmpfs_full
+SCRIPTS = tmpfs_badmount \
+ tmpfs_enospc
+
+include $(SRC)/cmd/Makefile.cmd
+include $(SRC)/test/Makefile.com
+
+CMDS = $(PROGS:%=$(TESTDIR)/%) $(SCRIPTS:%=$(TESTDIR)/%)
+$(CMDS) := FILEMODE = 0555
+
+all: $(PROGS)
+
+install: all $(CMDS)
+
+lint:
+
+clobber: clean
+ -$(RM) $(PROGS)
+
+clean:
+ -$(RM) *.o
+
+$(CMDS): $(TESTDIR) $(PROGS)
+
+$(TESTDIR):
+ $(INS.dir)
+
+$(TESTDIR)/%: %.ksh
+ $(INS.rename)
+
+$(TESTDIR)/%: %
+ $(INS.file)
diff --git a/usr/src/test/os-tests/tests/tmpfs/tmpfs_badmount.ksh b/usr/src/test/os-tests/tests/tmpfs/tmpfs_badmount.ksh
new file mode 100644
index 0000000000..7e2c4a6095
--- /dev/null
+++ b/usr/src/test/os-tests/tests/tmpfs/tmpfs_badmount.ksh
@@ -0,0 +1,114 @@
+#!/usr/bin/ksh
+#
+# 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 2016 Joyent, Inc.
+#
+
+#
+# Test various options to try and mount a tmpfs. Aside from the first to
+# verify that we can mount tmpfs at all, these should all fail.
+#
+
+tb_arg0=$(basename $0)
+tb_mountpoint="/var/tmp/$0.$$"
+tb_mount=/usr/sbin/mount
+tb_umount=/usr/sbin/umount
+
+function fatal
+{
+ rmdir $tb_mountpoint
+ typeset msg="$*"
+ [[ -z "$msg" ]] && msg="test failed"
+ echo "$tb_arg0: test failed $msg" >&2
+ exit 1
+}
+
+function check_mount
+{
+ mkdir -p $tb_mountpoint || fatal \
+ "failed to make mountpoint $tb_mountpoint"
+ $tb_mount -F tmpfs swap $tb_mountpoint || fatal \
+ "failed to mount tmpfs, check user perms"
+ $tb_umount $tb_mountpoint || fatal \
+ "failed to unmount test point"
+}
+
+function test_one
+{
+ typeset opts=$1
+
+ [[ -z "$opts" ]] && fatal "missing required opts"
+ $tb_mount -F tmpfs -o $opts swap $tb_mountpoint 2>/dev/null
+ if [[ $? -eq 0 ]]; then
+ $tb_umount $tb_mountpoint
+ fatal "successfully mounted with opts $opts, expected failure"
+ fi
+}
+
+check_mount
+
+#
+# Test invalid percentages.
+#
+test_one "size=-5%"
+test_one "size=200%"
+test_one "size=55.55555%"
+test_one "size=100.0%"
+test_one "size=bad%"
+test_one "size=30g%"
+test_one "size=%"
+test_one "size=%wat"
+
+#
+# Test invalid sizes. Only kmg are valid prefixes.
+#
+test_one "size=hello;world"
+test_one "size=0xnope"
+test_one "size=3.14g"
+test_one "size=3;14"
+test_one "size=thisisanormalsize"
+test_one "size="
+test_one "size=100mtry"
+
+#
+# Now, we need to try and trigger a bunch of overflow. We're going to do
+# this assuming we're on a 64-bit kernel (which will always overflow a
+# 32-bit kernel).
+#
+test_one "size=20000000000000000000"
+test_one "size=1ggggggggggggggggggg"
+test_one "size=1mmmmmmmmmmmmmmmmmmm"
+test_one "size=1kkkkkkkkkkkkkkkkkkk"
+test_one "size=1kkkkkkkkkkkkkkkkkkk"
+test_one "size=18014398509481983k"
+test_one "size=17592186044416m"
+test_one "size=17179869185g"
+test_one "size=17179869184g"
+
+#
+# Let's throw a couple bad modes around while we're here.
+#
+test_one "mode=17777"
+test_one "mode=27777"
+test_one "mode=37777"
+test_one "mode=47777"
+test_one "mode=57777"
+test_one "mode=67777"
+test_one "mode=77777"
+test_one "mode=87777"
+test_one "mode=97777"
+test_one "mode=asdf"
+test_one "mode=deadbeef"
+test_one "mode=kefka"
+
+rmdir $tb_mountpoint
diff --git a/usr/src/test/os-tests/tests/tmpfs/tmpfs_enospc.ksh b/usr/src/test/os-tests/tests/tmpfs/tmpfs_enospc.ksh
new file mode 100644
index 0000000000..a285f306e2
--- /dev/null
+++ b/usr/src/test/os-tests/tests/tmpfs/tmpfs_enospc.ksh
@@ -0,0 +1,74 @@
+#!/usr/bin/ksh
+#
+# 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 2016 Joyent, Inc.
+#
+
+#
+# Verify that if we fill up a tmpfs that we can't then perform
+# additional things to it that would result in the creation or use of
+# kernel memory.
+#
+
+te_arg0=$(basename $0)
+te_root=$(dirname $0)
+te_bin=$te_root/tmpfs_full
+te_mountpoint="/var/tmp/$0.$$"
+te_mount=/usr/sbin/mount
+te_umount=/usr/sbin/umount
+te_testfile=1m
+te_mounted=
+te_exit=1
+
+function fatal
+{
+ [[ -n "$te_mounted" ]] && $te_umount $te_mountpoint
+ rmdir $te_mountpoint
+ typeset msg="$*"
+ [[ -z "$msg" ]] && msg="test failed"
+ echo "$te_arg0: test failed $msg" >&2
+ exit 1
+}
+
+function setup
+{
+ typeset ofile=$te_mountpoint/$te_testfile
+
+ mkdir -p $te_mountpoint || fatal \
+ "failed to make mountpoint $te_mountpoint"
+ $te_mount -F tmpfs swap $te_mountpoint || fatal \
+ "failed to mount tmpfs, check user perms"
+ te_mounted=1
+ dd if=/dev/zero of=$ofile bs=1M count=1 2>/dev/null || fatal \
+ "failed to create a 1 MB file"
+ $te_mount -F tmpfs -o remount,size=512k swap $te_mountpoint ||
+ fatal "failed to remount tmpfs"
+}
+
+function run_test
+{
+ $te_bin $te_mountpoint $te_testfile || fatal "$te_bin failed"
+}
+
+function cleanup
+{
+ te_mounted=
+ $te_umount $te_mountpoint || fatal "failed to unmount $te_mountpoint"
+ rmdir $te_mountpoint || fatal "failed to remove $te_mountpoint"
+}
+
+setup
+run_test
+cleanup
+
+exit 0
diff --git a/usr/src/test/os-tests/tests/tmpfs/tmpfs_full.c b/usr/src/test/os-tests/tests/tmpfs/tmpfs_full.c
new file mode 100644
index 0000000000..6c6037710b
--- /dev/null
+++ b/usr/src/test/os-tests/tests/tmpfs/tmpfs_full.c
@@ -0,0 +1,94 @@
+/*
+ * 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 2016 Joyent, Inc.
+ */
+
+/*
+ * Given a path to a tmpfs that has already been marked as full, attempt to
+ * perform certain activities on it, all of which should fail with ENOSPC.
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <strings.h>
+#include <sys/debug.h>
+#include <unistd.h>
+
+int
+main(int argc, const char *argv[])
+{
+ int fd, ret;
+ struct statvfs vfs;
+
+ if (argc != 3) {
+ fprintf(stderr, "test failed: missing path or file\n");
+ return (1);
+ }
+
+ if ((fd = open(argv[1], O_RDONLY)) < 0) {
+ fprintf(stderr, "test failed: failed to open root %s: %s\n",
+ argv[1], strerror(errno));
+ return (1);
+ }
+
+ if (fstatvfs(fd, &vfs) != 0) {
+ fprintf(stderr, "test failed: failed to stat vfs for %s: %s\n",
+ argv[1], strerror(errno));
+ return (1);
+ }
+
+ if (strncmp("tmpfs", vfs.f_basetype, FSTYPSZ) != 0) {
+ fprintf(stderr, "test failed: asked to run on non-tmpfs\n");
+ return (1);
+ }
+
+ /*
+ * Once a few additional bugs in tmpfs are fixed, we should double check
+ * and make sure that the free space here is actually zero before
+ * continuing.
+ */
+
+ /*
+ * Go through operations that would create nodes and make sure that they
+ * all fail.
+ */
+
+ ret = openat(fd, "Mnemosyne", O_RDWR | O_CREAT, 0755);
+ VERIFY3S(ret, ==, -1);
+ VERIFY3S(errno, ==, ENOSPC);
+
+ ret = mkdirat(fd, "Euterpe", 0775);
+ VERIFY3S(ret, ==, -1);
+ VERIFY3S(errno, ==, ENOSPC);
+
+ ret = symlinkat("/dev/null", fd, "Melpomene");
+ VERIFY3S(ret, ==, -1);
+ VERIFY3S(errno, ==, ENOSPC);
+
+ ret = linkat(fd, argv[2], fd, "Urania", 0);
+ VERIFY3S(ret, ==, -1);
+ VERIFY3S(errno, ==, ENOSPC);
+
+ /*
+ * Make sure we can't create open extended attributes.
+ */
+ ret = openat(fd, "Lethe", O_RDWR | O_CREAT | O_XATTR);
+ VERIFY3S(ret, ==, -1);
+ VERIFY3S(errno, ==, ENOSPC);
+
+ return (0);
+}
diff --git a/usr/src/test/smartos-test/Makefile b/usr/src/test/smartos-test/Makefile
new file mode 100644
index 0000000000..1277987fac
--- /dev/null
+++ b/usr/src/test/smartos-test/Makefile
@@ -0,0 +1,49 @@
+#
+# 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 2019 Joyent, Inc.
+#
+
+include $(SRC)/Makefile.master
+include ../Makefile.com
+
+PROGS= smartos-test
+FILES= README
+
+ROOTOPTPKG = $(ROOT)/opt/smartos-test
+ROOTBIN = $(ROOTOPTPKG)/bin
+
+ROOTPROGS= $(PROGS:%=$(ROOTBIN)/%)
+$(ROOTPROGS) := FILEMODE = 0555
+
+ROOTFILES= $(FILES:%=$(ROOTOPTPKG)/%)
+$(ROOTFILES) := FILEMODE = 0444
+
+all clean clobber:
+
+install: $(ROOTPROGS) $(ROOTFILES)
+
+$(ROOTPROGS): $(ROOTBIN)
+
+$(ROOTFILES): $(ROOTOPTPKG)
+
+$(ROOTBIN):
+ $(INS.dir)
+
+$(ROOTOPTPKG):
+ $(INS.dir)
+
+$(ROOTOPTPKG)/%: %
+ $(INS.file)
+
+$(ROOTBIN)/%: %.sh
+ $(INS.rename)
diff --git a/usr/src/test/smartos-test/README b/usr/src/test/smartos-test/README
new file mode 100644
index 0000000000..7e38905729
--- /dev/null
+++ b/usr/src/test/smartos-test/README
@@ -0,0 +1,103 @@
+#
+# 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 2019 Joyent. Inc.
+#
+
+Strictly speaking, this is not a set of tests. Rather, it is a wrapper that
+automates the configuration of a SmartOS system to prepare it for test
+execution, optionally running those tests.
+
+The smartos-test script should be extracted from the test archive to ensure
+the correct version is being executed.
+
+For example:
+
+[root@kura /var/tmp]# tar zvxf tests-test_archive-master-20191001T134222Z.tgz ./opt/smartos-test
+Decompressing 'tests-test_archive-master-20191001T134222Z.tgz' with '/usr/bin/gzcat'...
+x ./opt/smartos-test, 0 bytes, 0 tape blocks
+x ./opt/smartos-test/README, 958 bytes, 2 tape blocks
+x ./opt/smartos-test/bin, 0 bytes, 0 tape blocks
+x ./opt/smartos-test/bin/smartos-test, 10062 bytes, 20 tape blocks
+[root@kura /var/tmp]# ./opt/smartos-test/bin/smartos-test -h
+Usage: smartos-test [-h] [-c] [-e] [-r] [-w] <path to tests.tgz>
+
+At least one of -c, -e, -r is required.
+
+ -h print usage
+ -c configure the system for testing
+ -e execute known tests
+ -f skip the check to ensure platform version == test version
+ -r snapshot or rollback to zones/opt@system-test-smartos-test
+ before doing any system configuration or test execution
+ -w when mounting the lofs /usr, make it writable
+
+
+Specifically, the script will:
+
+* verify that the user has declared that no production data exists on the
+ test system
+* verify we're running in the global zone
+* verify the test archive version matches the version of the platform we're
+ running
+* optionally snapshot or rollback /opt to "zones/opt@system-test-smartos-test"
+* setup loopback mounts for any files from the smartos "tests-[stamp].tgz"
+ file that need to be installed to a normally read-only location, and
+ extract the portions of test archive that must appear in /usr
+* extract the remaining test archive contents to /opt and /kernel
+* configure pkgsrc
+* install required test packages
+* execute tests that should all pass
+
+Over time, we hope to add to the set of tests that are executed.
+
+After configuring the system for testing, you may choose to run individual
+test suites, for example:
+
+ # /opt/util-tests/bin/utiltest
+or
+ # /opt/os-tests/bin/ostest
+
+
+A note on ZFS testing:
+
+At present, this wrapper does *not* execute the ZFS tests, since they're
+more invasive than the other packaged tests. To run those, after configuring
+the system for testing, change to the 'ztest' user and set environment
+variables.
+
+In this example, DISKS is the list of three unused disks that will be used
+to run the tests. KEEP is a list of zpools that the tests should *not*
+destroy:
+
+ # su ztest
+ $ export DISKS='c2t1d0 c2t2d0 c2t3d0'
+ $ export KEEP='zones'
+ $ /opt/zfs-tests/bin/zfstest
+
+Beware that data loss will occur for any data residing on DISKS and failure to
+specify a KEEP pool may also lead to data loss.
+
+
+A note for SmartOS developers:
+
+The test archive .tgz file is built by the 'tests-tar' Makefile target in
+smartos-live.git.
+
+The manifest of files included in the archive is generated at build-time by
+parsing the IPS package manifests from $SRC/pkg/manifests that are listed in
+$SRC/Makefile.testarchive in this repository.
+
+It is important when adding or removing tests that the IPS manifests are
+updated. If new test packages are created, they should be added to
+$SRC/Makefile.testarchive.
+
diff --git a/usr/src/test/smartos-test/smartos-test.sh b/usr/src/test/smartos-test/smartos-test.sh
new file mode 100755
index 0000000000..d3bc4d1840
--- /dev/null
+++ b/usr/src/test/smartos-test/smartos-test.sh
@@ -0,0 +1,389 @@
+#! /usr/bin/bash
+#
+#
+# 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 2019 Joyent, Inc.
+#
+
+#
+# This script is designed to run on an (effectively) disposable SmartOS
+# install to configure the system, install a series of tests from the
+# smartos-gate, and execute them.
+# It exits 1 if any configuration, setup or test fails.
+#
+
+export PATH=/usr/bin:/usr/sbin:/opt/tools/sbin:/opt/tools/bin:$PATH
+
+# The pkgsrc packages we will install.
+export SMARTOS_TEST_PKGS="
+ python27
+ sudo
+ coreutils
+ gcc7
+ gmake
+"
+
+#
+# Set $KEEP as a precaution in case we ever end up running the zfs-test suite
+# by accident or design. This ensures it never attempts to destroy the 'zones'
+# zpool. Note that the ZFS test suite also wants DISKS set to the disks which
+# it can create/destroy pools on, but we're not computing that here.
+#
+if [[ -z "$KEEP" ]]; then
+ export KEEP="zones"
+fi
+
+#
+# Accumulate test suite exit codes and a list of failed tests
+#
+RESULT=0
+FAILED_TESTS=""
+
+function fatal {
+ echo "ERROR: $@"
+ exit 1
+}
+
+function warn {
+ echo "WARNING: $@"
+}
+
+function log {
+ echo "$@"
+}
+
+function log_must {
+ echo "Running $@"
+ $@ || fatal "Error running command."
+}
+
+function log_test {
+ echo ""
+ TEST_NAME=$1
+ shift
+ echo "Starting test for $TEST_NAME with $@"
+ $@
+ TEST_RESULT=$?
+ if [[ $TEST_RESULT -ne 0 ]]; then
+ FAILED_TESTS="$FAILED_TESTS $TEST_NAME"
+ fi
+ RESULT=$(( $RESULT + $TEST_RESULT ))
+}
+
+function log_testrunner {
+ echo ""
+ TEST_NAME=$1
+ shift
+ echo "Starting test-runner for $TEST_NAME with $@"
+ /opt/test-runner/bin/run -c $@
+ TEST_RESULT=$?
+ if [[ $TEST_RESULT -ne 0 ]]; then
+ FAILED_TESTS="$FAILED_TESTS $TEST_NAME"
+ fi
+ RESULT=$(( $RESULT + $TEST_RESULT ))
+ # test-runner's default log dirs use a timestamp at per-second granularity.
+ # Sleep here to ensure a unique timestamp per run if consecutive tests
+ # bail out early.
+ sleep 1
+}
+
+function guard_production_data {
+
+ if [[ ! -f "/lib/sdc/.sdc-test-no-production-data" ]]; then
+ cat <<EOF
+To setup and run these tests you must create the file:
+ /lib/sdc/.sdc-test-no-production-data
+after ensuring you have no production data on this system.
+EOF
+ exit 1
+ fi
+}
+
+function zone_check {
+ if [[ $(zonename) != "global" ]]; then
+ fatal "these tests must be run from the global zone."
+ fi
+}
+
+#
+# Check that the tests.buildstamp file in the test archive matches
+# the current platform stamp. Running tests designed for a platform
+# that we're not running is a bad idea.
+#
+function version_check {
+ PLATFORM_VERSION=$(uname -v | sed -e 's/^joyent_//g')
+ mkdir -p /tmp/version_check.$$
+ tar xzf $1 -C /tmp/version_check.$$ ./tests.buildstamp
+ TESTS_VERSION=$(cat /tmp/version_check.$$/tests.buildstamp)
+ rm -rf /tmp/version_check.$$
+ log "Platform version: $PLATFORM_VERSION"
+ log " Tests version: $TESTS_VERSION"
+ if [[ "$PLATFORM_VERSION" != "$TESTS_VERSION" ]]; then
+ fatal "mismatched platform version and tests version!"
+ fi
+}
+
+function snapshot_rollback_opt {
+ snapshot="system-test-smartos-test"
+ has_snapshot=$(zfs list zones/opt@$snapshot 2> /dev/null)
+ if [[ -n "$has_snapshot" ]]; then
+ log_must zfs rollback zones/opt@$snapshot
+ else
+ log_must zfs snapshot zones/opt@$snapshot
+ fi
+}
+
+#
+# Since some tests want to deliver to /usr which is read-only on SmartOS,
+# we make a temporary directory, dump the current /usr there, extract our
+# content to it, then lofs-mount it over the real thing.
+#
+function add_loopback_mounts {
+ test_archive=$1
+ lofs_home=/var/tmp/smartos-test-loopback
+
+ # If /usr is already lofs mounted, and pointing at $lofs_home, just
+ # extract our new test bits on top. Ideally we'd just unmount it,
+ # but while running this script, there's a good chance that the dataset
+ # will be busy and the umount would fail.
+ FS=$(/bin/df -n /usr | awk '{print $NF'})
+ if [[ "$FS" == "lofs" ]]; then
+ is_test_lofs=$(mount | grep ^/usr | grep "$lofs_home/usr ")
+ if [[ -z "$is_test_lofs" ]]; then
+ fatal "unsupported: existing lofs mount for /usr is not $lofs_home"
+ else
+ log "Extracting new test archive to lofs-mounted /usr"
+ # extract the current test archive to it
+ log_must tar -xzf $test_archive -C $lofs_home ./usr
+ fi
+ # Otherwise, setup a lofs mount for it.
+ else
+ log "Creating new lofs mount for /usr on $lofs_home"
+ rm -rf $lofs_home
+ mkdir -p $lofs_home
+ find /usr | cpio -pdum $lofs_home
+ log_must tar -xzf $test_archive -C $lofs_home ./usr
+ # keep /usr read-only in an attempt to preserve smartos behaviour
+ # unless specifically asked to
+ if [[ "$mount_usr_rw" = "true" ]]; then
+ mount_opts="-o rw"
+ else
+ mount_opts="-o ro"
+ fi
+ log_must mount -O -F lofs $mount_opts $lofs_home/usr /usr
+ fi
+}
+
+#
+# Extract the non-/usr parts of the test archive
+#
+function extract_remaining_test_bits {
+ log_must tar -xzf $1 -C / \
+ ./opt ./kernel ./tests.manifest.gen ./tests.buildstamp
+}
+
+function setup_pkgsrc {
+
+ if [[ -f /opt/tools/etc/pkgin/repositories.conf ]]; then
+ log "Pkgsrc bootstrap already setup, continuing"
+ return
+ fi
+
+ # We should always use the same pkgsrc version as we have installed
+ # on the build machine in case any of our tests link against libraries
+ # in /opt/local
+ PKGSRC_STEM="https://pkgsrc.joyent.com/packages/SmartOS/bootstrap"
+ BOOTSTRAP_TAR="bootstrap-2018Q4-tools.tar.gz"
+ BOOTSTRAP_SHA="b599667c80e4a42157763ed25d868ec7dc34962d"
+
+ # Ensure we are in a directory with enough space for the bootstrap
+ # download, by default the SmartOS /root directory is limited to the size
+ # of the ramdisk.
+ cd /var/tmp
+
+ # Download the bootstrap kit to the current directory. Note that we
+ # currently pass "-k" to skip SSL certificate checks as the GZ doesn't
+ # install them.
+ log_must curl -kO ${PKGSRC_STEM}/${BOOTSTRAP_TAR}
+
+ # Verify the SHA1 checksum.
+ [[ "${BOOTSTRAP_SHA}" = "$(/bin/digest -a sha1 ${BOOTSTRAP_TAR})" ]] || \
+ fatal "checksum failure for ${BOOTSTRAP_TAR}, expected ${BOOTSTRAP_SHA}"
+
+ # Install bootstrap kit to /opt/tools
+ log_must tar -zxpf ${BOOTSTRAP_TAR} -C /
+
+ # add a symlink from /opt/local, needed by many test suites
+ if [[ ! -d /opt/local && ! -L /opt/local ]]; then
+ log_must ln -s /opt/tools /opt/local
+ else
+ log "Not forging /opt/local link"
+ fi
+}
+
+function install_required_pkgs {
+
+ log_must pkgin -y in ${SMARTOS_TEST_PKGS}
+}
+
+function add_test_accounts {
+
+ grep -q cyrus: /etc/passwd
+ if [[ $? -ne 0 ]]; then
+ log "Adding cyrus user"
+ echo "cyrus:x:977:1::/zones/global/cyrus:/bin/sh" >> /etc/passwd
+ echo "cyrus:*LK*:::::::" >> /etc/shadow
+ mkdir -p /zones/global/cyrus
+ chown cyrus /zones/global/cyrus
+ fi
+ grep -q ztest: /etc/passwd
+ if [[ $? -ne 0 ]]; then
+ log "Adding ztest user"
+ echo "ztest:x:978:1::/zones/global/ztest:/bin/sh" >> /etc/passwd
+ echo "ztest:*LK*:::::::" >> /etc/shadow
+ mkdir -p /zones/global/ztest
+ chown ztest /zones/global/ztest
+ fi
+ if [[ ! -f /opt/tools/etc/sudoers.d/ztest ]]; then
+ mkdir -p /opt/tools/etc/sudoers.d
+ echo "ztest ALL=(ALL) NOPASSWD: ALL" >> /opt/tools/etc/sudoers.d/ztest
+ fi
+}
+
+#
+# By using log_test or log_testrunner, we accumulate the exit codes from each
+# test run to $RESULT.
+#
+# We don't - yet - run net-tests, smbclient-tests, zfs-tests, or the dtrace
+# suite.
+#
+function execute_tests {
+
+ log "Starting test runs"
+ log_test bhyvetest /opt/bhyvetest/bin/bhyvetest -ak
+ log_testrunner crypto-tests /opt/crypto-tests/runfiles/default.run
+ log_testrunner elf-tests /opt/elf-tests/runfiles/default.run
+ log_testrunner libc-tests /opt/libc-tests/runfiles/default.run
+ log_test vndtest /opt/vndtest/bin/vndtest -a
+ log_testrunner util-tests /opt/util-tests/runfiles/default.run
+ log_testrunner os-tests /opt/os-tests/runfiles/default.run
+
+ if [[ -n "$FAILED_TESTS" ]]; then
+ echo ""
+ log "Failures were seen in the following test suites: $FAILED_TESTS"
+ fi
+
+}
+
+function usage {
+ echo "Usage: smartos-test [-h] [-c] [-e] [-r] [-w] <path to tests.tgz>"
+ echo ""
+ echo "At least one of -c, -e, -r is required."
+ echo ""
+ echo " -h print usage"
+ echo " -c configure the system for testing"
+ echo " -e execute known tests"
+ echo " -f skip the check to ensure platform version == test version"
+ echo " -r snapshot or rollback to zones/opt@system-test-smartos-test"
+ echo " before doing any system configuration or test execution"
+ echo " -w when mounting the lofs /usr, make it writable"
+}
+
+mount_usr_rw=false
+skip_version_check=false
+do_configure=false
+do_execute=false
+do_rollback=false
+
+#
+# Main
+#
+while getopts "cefrwh" opt; do
+ case "${opt}" in
+ c)
+ do_configure=true
+ ;;
+ e)
+ do_execute=true
+ ;;
+ f)
+ skip_version_check=true
+ ;;
+ r)
+ do_rollback=true
+ ;;
+ h)
+ usage
+ exit 2
+ ;;
+ w)
+ mount_usr_rw=true
+ ;;
+ *)
+ log "unknown argument ${opt}"
+ usage
+ exit 2
+ esac
+done
+shift $((OPTIND - 1))
+
+test_archive=$1
+
+if [[ -z "$test_archive" ]]; then
+ log "missing test archive argument."
+ usage
+ exit 1
+fi
+
+if [[ ! -f "$test_archive" ]]; then
+ usage
+ fatal "unable to access test archive at $test_archive"
+fi
+
+if [[ "$do_rollback" = false && \
+ "$do_configure" = false && \
+ "$do_execute" = false ]]; then
+ log "nothing to do: use at least one of -r -e -c"
+ usage
+ exit 2
+fi
+
+if [[ "$skip_version_check" = false ]]; then
+ version_check $1
+fi
+
+guard_production_data
+zone_check
+
+if [[ $do_rollback = true ]]; then
+ snapshot_rollback_opt
+fi
+
+if [[ $do_configure = true ]]; then
+ add_loopback_mounts $test_archive
+ extract_remaining_test_bits $test_archive
+ add_test_accounts
+ setup_pkgsrc
+ install_required_pkgs
+ log "This system is now configured to run the SmartOS tests."
+fi
+
+if [[ "$do_execute" = true ]]; then
+ execute_tests
+fi
+
+if [[ $RESULT -gt 0 ]]; then
+ exit 1
+else
+ exit 0
+fi
diff --git a/usr/src/test/test-runner/cmd/run b/usr/src/test/test-runner/cmd/run
index cf41dac479..1d6b4f2969 100644
--- a/usr/src/test/test-runner/cmd/run
+++ b/usr/src/test/test-runner/cmd/run
@@ -38,6 +38,14 @@ BASEDIR = '/var/tmp/test_results'
KILL = '/usr/bin/kill'
TRUE = '/usr/bin/true'
SUDO = '/usr/bin/sudo'
+SU = '/usr/bin/su'
+
+# The location of sudo(1) varies by illumos distribution.
+if os.path.isfile('/usr/bin/sudo'):
+ SUDO = '/usr/bin/sudo'
+else:
+ SUDO = '/opt/local/bin/sudo'
+
retcode = 0
@@ -176,7 +184,21 @@ class Cmd(object):
sudo is required, this user was verified previously.
"""
self.killed = True
- do_sudo = len(self.user) != 0
+ cur_user = getpwuid(os.getuid()).pw_name
+
+ #
+ # The test runs in a child process of the process performing
+ # the kill and this child process may be owned by a different
+ # user (specified by self.user). If this is the case, and the
+ # parent process is not running as root, then sudo must be
+ # used. The verify_user function should prevent us from ever
+ # getting here on a system which doesn't have sudo.
+ #
+ if len(self.user) != 0 and self.user != cur_user and cur_user != 'root':
+ do_sudo = True
+ else:
+ do_sudo = False
+
signal = '-TERM'
cmd = [SUDO, KILL, signal, str(proc.pid)]
@@ -192,15 +214,23 @@ class Cmd(object):
def update_cmd_privs(self, cmd, user):
"""
If a user has been specified to run this Cmd and we're not already
- running as that user, prepend the appropriate sudo command to run
- as that user.
+ running as that user, prepend the appropriate sudo command to
+ run as that user. If running as root use su instead. The
+ verify_user function should prevent us from ever getting here
+ on a system which doesn't have sudo.
+
"""
- me = getpwuid(os.getuid())
- if not user or user is me:
+ cur_user = getpwuid(os.getuid()).pw_name
+
+ if not user or user == cur_user:
return cmd
- ret = '%s -E -u %s %s' % (SUDO, user, cmd)
+ if cur_user == 'root':
+ ret = '%s %s -c %s' % (SU, user, cmd)
+ else:
+ ret = '%s -E -u %s %s' % (SUDO, user, cmd)
+
return ret.split(' ')
def collect_output(self, proc):
@@ -761,14 +791,28 @@ def verify_file(pathname):
def verify_user(user, logger):
"""
- Verify that the specified user exists on this system, and can execute
- sudo without being prompted for a password.
+ Verify that the specified user exists on this system, and can
+ execute sudo without being prompted for a password. If the user
+ executing the test is the same as the requested user then this
+ check is skipped. If the user executing the test is root this
+ check is skipped as su can be used instead.
"""
+
testcmd = [SUDO, '-n', '-u', user, TRUE]
if user in Cmd.verified_users:
return True
+ cur_user = getpwuid(os.getuid()).pw_name
+
+ if user == cur_user or cur_user == 'root':
+ Cmd.verified_users.append(user)
+ return True
+
+ if not os.path.isfile(SUDO):
+ logger.info("Warning: this test requires sudo but it doesn't exist.")
+ return False
+
try:
_ = getpwnam(user)
except KeyError:
diff --git a/usr/src/test/util-tests/runfiles/default.run b/usr/src/test/util-tests/runfiles/default.run
index 2297ba8bc7..3170859794 100644
--- a/usr/src/test/util-tests/runfiles/default.run
+++ b/usr/src/test/util-tests/runfiles/default.run
@@ -28,6 +28,9 @@ outputdir = /var/tmp/test_results
[/opt/util-tests/tests/printf_test]
[/opt/util-tests/tests/allowed-ips]
[/opt/util-tests/tests/set-linkprop]
+[/opt/util-tests/tests/show-overlay-exit]
+[/opt/util-tests/tests/vnic-mtu]
+[/opt/util-tests/tests/bunyan/bunyan]
[/opt/util-tests/tests/libsff/libsff]
[/opt/util-tests/tests/libjedec_test]
[/opt/util-tests/tests/smbios]
@@ -37,6 +40,8 @@ outputdir = /var/tmp/test_results
[/opt/util-tests/tests/mergeq/mqt]
[/opt/util-tests/tests/mergeq/wqt]
+[/opt/util-tests/tests/dis/distest]
+
[/opt/util-tests/tests/libnvpair_json]
tests = ['json_00_blank', 'json_01_boolean', 'json_02_numbers',
'json_03_empty_arrays', 'json_04_number_arrays', 'json_05_strings',
diff --git a/usr/src/test/util-tests/tests/Makefile b/usr/src/test/util-tests/tests/Makefile
index 34634ee0cf..6fab960d55 100644
--- a/usr/src/test/util-tests/tests/Makefile
+++ b/usr/src/test/util-tests/tests/Makefile
@@ -20,5 +20,6 @@
SUBDIRS = date dis dladm iconv libnvpair_json libsff printf xargs grep_xpg4
SUBDIRS += demangle mergeq workq chown ctf smbios libjedec awk make
+SUBDIRS += bunyan
include $(SRC)/test/Makefile.com
diff --git a/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.awk b/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.awk
index 25b92c0492..8c84ff6cfe 100644
--- a/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.awk
+++ b/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.awk
@@ -9,7 +9,7 @@ BEGIN {
status = system("exit 42")
print "normal status", status
- status = system("kill -HUP $$")
+ status = system("kill -KILL $$")
print "death by signal status", status
status = system("cd $WORKDIR && kill -ABRT $$")
diff --git a/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.ok b/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.ok
index 737828f5ed..afc0788ce8 100644
--- a/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.ok
+++ b/usr/src/test/util-tests/tests/awk/bugs-fixed/system-status.ok
@@ -1,3 +1,3 @@
normal status 42
-death by signal status 257
+death by signal status 265
death by signal with core dump status 518
diff --git a/usr/src/test/util-tests/tests/awk/tests/T.misc b/usr/src/test/util-tests/tests/awk/tests/T.misc
index 50978e0048..ee603014e2 100755
--- a/usr/src/test/util-tests/tests/awk/tests/T.misc
+++ b/usr/src/test/util-tests/tests/awk/tests/T.misc
@@ -1,5 +1,7 @@
#!/bin/bash
+# Copyright 2019 Joyent, Inc.
+
if [[ -z "$AWK" || -z "$WORKDIR" ]]; then
printf '$AWK and $WORKDIR must be set\n' >&2
exit 1
@@ -483,7 +485,7 @@ awk '{ print NF, $0 }' $TEMP0| tail -1 > $TEMP2
cmp -s $TEMP1 $TEMP2 || fail 'BAD: T.misc END must preserve $0'
-LC_NUMERIC=ru_RU.ISO8859-5 $AWK 'BEGIN {
+LC_ALL= LC_NUMERIC=ru_RU.ISO8859-5 $AWK 'BEGIN {
"echo 1,200" | getline;
if ($1 == 1.2) {
printf "good ";
diff --git a/usr/src/test/util-tests/tests/bunyan/Makefile b/usr/src/test/util-tests/tests/bunyan/Makefile
new file mode 100644
index 0000000000..5f58bf1614
--- /dev/null
+++ b/usr/src/test/util-tests/tests/bunyan/Makefile
@@ -0,0 +1,68 @@
+#
+# 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 2015 Joyent, Inc.
+#
+
+include $(SRC)/Makefile.master
+
+ROOTOPTPKG = $(ROOT)/opt/util-tests
+TESTDIR = $(ROOTOPTPKG)/tests/bunyan
+TESTBIN = $(ROOTOPTPKG)/bin
+
+PROG = btest
+
+SCRIPTS = \
+ bunyan
+
+include $(SRC)/cmd/Makefile.cmd
+include $(SRC)/test/Makefile.com
+
+OBJS = $(PROG:%=%.o)
+SRCS = $(OBJS:%.o=%.c)
+
+CMDS = $(PROG:%=$(TESTBIN)/%) $(SCRIPTS:%=$(TESTDIR)/%)
+$(CMDS) := FILEMODE = 0555
+
+DIRS = $(TESTDIR) $(TESTBIN)
+
+LDLIBS += -lbunyan
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+ $(POST_PROCESS)
+
+install: all $(CMDS)
+
+lint:
+
+clobber: clean
+ -$(RM) $(PROG)
+
+clean:
+ -$(RM) $(OBJS)
+
+$(CMDS): $(DIRS)
+
+$(DIRS):
+ $(INS.dir)
+
+$(TESTDIR)/%: %.ksh
+ $(INS.rename)
+
+$(TESTDIR)/%: %
+ $(INS.file)
+
+$(TESTBIN)/%: %
+ $(INS.file)
diff --git a/usr/src/test/util-tests/tests/bunyan/btest.c b/usr/src/test/util-tests/tests/bunyan/btest.c
new file mode 100644
index 0000000000..f6be13afa2
--- /dev/null
+++ b/usr/src/test/util-tests/tests/bunyan/btest.c
@@ -0,0 +1,316 @@
+/*
+ * 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 (c) 2014, Joyent, Inc.
+ */
+
+#include <stdio.h>
+#include <assert.h>
+#include <bunyan.h>
+#include <netinet/in.h>
+#include <strings.h>
+
+static void
+create_handles(void)
+{
+ bunyan_logger_t *a, *b, *c;
+
+ assert(bunyan_init("foo", &a) == 0);
+ assert(bunyan_init("foo", &b) == 0);
+ assert(bunyan_init("foo", &c) == 0);
+ bunyan_fini(a);
+ bunyan_fini(b);
+ bunyan_fini(c);
+}
+
+static void
+create_stream(void)
+{
+ bunyan_logger_t *a;
+
+ assert(bunyan_init("foo", &a) == 0);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "baz", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == EEXIST);
+ assert(bunyan_stream_add(a, "baz", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == EEXIST);
+ assert(bunyan_stream_remove(a, "baz") == 0);
+ assert(bunyan_stream_remove(a, "baz") == ENOENT);
+ assert(bunyan_stream_remove(a, "foobaz") == ENOENT);
+ assert(bunyan_stream_remove(a, "blah") == ENOENT);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == EEXIST);
+ assert(bunyan_stream_add(a, "baz", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "debug", BUNYAN_L_DEBUG,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "info", BUNYAN_L_INFO,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "warn", BUNYAN_L_WARN,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "error", BUNYAN_L_ERROR,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_stream_add(a, "fatal", BUNYAN_L_FATAL,
+ bunyan_stream_fd, (void *)1) == 0);
+
+ bunyan_fini(a);
+}
+
+static void
+create_key(void)
+{
+ bunyan_logger_t *a;
+ struct in_addr v4;
+ struct in6_addr v6;
+
+ assert(bunyan_init("foo", &a) == 0);
+ assert(bunyan_key_remove(a, "blah") == ENOENT);
+ assert(bunyan_key_add(a, BUNYAN_T_END) == 0);
+
+ assert(bunyan_key_add(a, BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+
+ assert(bunyan_key_remove(a, "s") == 0);
+ assert(bunyan_key_remove(a, "s") == ENOENT);
+ assert(bunyan_key_remove(a, "p") == 0);
+ assert(bunyan_key_remove(a, "p") == ENOENT);
+ assert(bunyan_key_remove(a, "v4") == 0);
+ assert(bunyan_key_remove(a, "v4") == ENOENT);
+ assert(bunyan_key_remove(a, "v6") == 0);
+ assert(bunyan_key_remove(a, "v6") == ENOENT);
+ assert(bunyan_key_remove(a, "b") == 0);
+ assert(bunyan_key_remove(a, "b") == ENOENT);
+ assert(bunyan_key_remove(a, "i32") == 0);
+ assert(bunyan_key_remove(a, "i32") == ENOENT);
+ assert(bunyan_key_remove(a, "i64") == 0);
+ assert(bunyan_key_remove(a, "i64") == ENOENT);
+ assert(bunyan_key_remove(a, "u32") == 0);
+ assert(bunyan_key_remove(a, "u32") == ENOENT);
+ assert(bunyan_key_remove(a, "u64") == 0);
+ assert(bunyan_key_remove(a, "u64") == ENOENT);
+ assert(bunyan_key_remove(a, "d") == 0);
+ assert(bunyan_key_remove(a, "d") == ENOENT);
+ assert(bunyan_key_remove(a, "i64s") == 0);
+ assert(bunyan_key_remove(a, "i64s") == ENOENT);
+ assert(bunyan_key_remove(a, "u64s") == 0);
+ assert(bunyan_key_remove(a, "u64s") == ENOENT);
+
+ bunyan_fini(a);
+}
+
+static void
+bad_level(void)
+{
+ bunyan_logger_t *a;
+
+ assert(bunyan_init("bad level", &a) == 0);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_TRACE - 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_TRACE + 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_DEBUG - 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_INFO + 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_WARN - 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_ERROR + 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", BUNYAN_L_FATAL - 1,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+ assert(bunyan_stream_add(a, "bar", -5,
+ bunyan_stream_fd, (void *)1) == EINVAL);
+
+ bunyan_fini(a);
+}
+
+static void
+basic_log(void)
+{
+ bunyan_logger_t *a;
+
+ assert(bunyan_init("basic", &a) == 0);
+ assert(bunyan_stream_add(a, "foo", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_trace(a, "trace", BUNYAN_T_END) == 0);
+ assert(bunyan_debug(a, "debug", BUNYAN_T_END) == 0);
+ assert(bunyan_info(a, "info", BUNYAN_T_END) == 0);
+ assert(bunyan_warn(a, "warn", BUNYAN_T_END) == 0);
+ assert(bunyan_error(a, "error", BUNYAN_T_END) == 0);
+ assert(bunyan_fatal(a, "fatal", BUNYAN_T_END) == 0);
+
+ bunyan_fini(a);
+}
+
+static void
+crazy_log(void)
+{
+ bunyan_logger_t *a;
+ struct in_addr v4;
+ struct in6_addr v6;
+
+ bzero(&v4, sizeof (struct in_addr));
+ bzero(&v6, sizeof (struct in6_addr));
+
+ assert(bunyan_init("basic", &a) == 0);
+ assert(bunyan_stream_add(a, "foo", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_trace(a, "trace", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_debug(a, "debug", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_info(a, "info", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_warn(a, "warn", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_error(a, "error", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_fatal(a, "fatal", BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+
+ bunyan_fini(a);
+}
+
+static void
+child_log(void)
+{
+ bunyan_logger_t *a, *child;
+ struct in_addr v4;
+ struct in6_addr v6;
+
+ bzero(&v4, sizeof (struct in_addr));
+ bzero(&v6, sizeof (struct in6_addr));
+
+ assert(bunyan_init("child", &a) == 0);
+ assert(bunyan_stream_add(a, "foo", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_child(a, &child, BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+
+ assert(bunyan_key_remove(a, "p") == ENOENT);
+
+ bunyan_fini(a);
+ assert(bunyan_trace(child, "trace", BUNYAN_T_END) == 0);
+ assert(bunyan_debug(child, "debug", BUNYAN_T_END) == 0);
+ assert(bunyan_info(child, "info", BUNYAN_T_END) == 0);
+ assert(bunyan_warn(child, "warn", BUNYAN_T_END) == 0);
+ assert(bunyan_error(child, "error", BUNYAN_T_END) == 0);
+ assert(bunyan_fatal(child, "fatal", BUNYAN_T_END) == 0);
+
+ assert(bunyan_key_remove(child, "p") == 0);
+
+ bunyan_fini(child);
+}
+
+static void
+crazy_child(void)
+{
+ bunyan_logger_t *a, *child;
+ struct in_addr v4;
+ struct in6_addr v6;
+
+ bzero(&v4, sizeof (struct in_addr));
+ bzero(&v6, sizeof (struct in6_addr));
+
+ assert(bunyan_init("crazy child", &a) == 0);
+ assert(bunyan_stream_add(a, "foo", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_key_add(a, BUNYAN_T_STRING, "s", "foo",
+ BUNYAN_T_POINTER, "p", (void *)a, BUNYAN_T_IP, "v4", &v4,
+ BUNYAN_T_IP6, "v6", &v6, BUNYAN_T_BOOLEAN, "b", B_TRUE,
+ BUNYAN_T_INT32, "i32", 69, BUNYAN_T_INT64, "i64", (uint64_t)6969,
+ BUNYAN_T_UINT32, "u32", 23, BUNYAN_T_UINT64, "u64", (uint64_t)2323,
+ BUNYAN_T_DOUBLE, "d", 3.14,
+ BUNYAN_T_INT64STR, "i64s", (uint64_t)12345,
+ BUNYAN_T_UINT64STR, "u64s", (uint64_t)54321, BUNYAN_T_END) == 0);
+ assert(bunyan_child(a, &child, BUNYAN_T_END) == 0);
+ bunyan_fini(a);
+
+ assert(bunyan_stream_remove(child, "foo") == 0);
+ assert(bunyan_stream_add(child, "bar", BUNYAN_L_TRACE,
+ bunyan_stream_fd, (void *)1) == 0);
+ assert(bunyan_key_remove(child, "u64s") == 0);
+ assert(bunyan_trace(child, "trace", BUNYAN_T_END) == 0);
+ assert(bunyan_debug(child, "debug", BUNYAN_T_END) == 0);
+ assert(bunyan_info(child, "info", BUNYAN_T_END) == 0);
+ assert(bunyan_warn(child, "warn", BUNYAN_T_END) == 0);
+ assert(bunyan_error(child, "error", BUNYAN_T_END) == 0);
+ assert(bunyan_fatal(child, "fatal", BUNYAN_T_END) == 0);
+
+ bunyan_fini(child);
+}
+
+int
+main(void)
+{
+ create_handles();
+ create_stream();
+ create_key();
+ bad_level();
+ basic_log();
+ crazy_log();
+ child_log();
+ crazy_child();
+
+ return (0);
+}
diff --git a/usr/src/test/util-tests/tests/bunyan/bunyan.ksh b/usr/src/test/util-tests/tests/bunyan/bunyan.ksh
new file mode 100644
index 0000000000..4ec0f4bd62
--- /dev/null
+++ b/usr/src/test/util-tests/tests/bunyan/bunyan.ksh
@@ -0,0 +1,26 @@
+#! /usr/bin/ksh
+#
+# 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 (c) 2014, Joyent, Inc.
+#
+
+#
+# Simple wrapper for the classic test.out
+#
+
+set -o errexit
+
+btest_root=$(dirname $0)/../..
+btest_bin=$btest_root/bin/btest
+
+LD_PRELOAD=libumem.so UMEM_DEBUG=default $btest_bin >/dev/null
diff --git a/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.out b/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.out
new file mode 100644
index 0000000000..91beecb0b7
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.out
@@ -0,0 +1,3 @@
+ libdis_test: f3 0f 09 wbnoinvd
+ libdis_test+0x3: 0f 09 wbinvd
+ libdis_test+0x5: 0f 08 invd
diff --git a/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s b/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s
new file mode 100644
index 0000000000..052e7ccd56
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s
@@ -0,0 +1,31 @@
+/*
+ * 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 2019 Joyent, Inc.
+ */
+
+/*
+ * Test cache invalidation related instructions.
+ */
+
+.text
+.align 16
+.globl libdis_test
+.type libdis_test, @function
+libdis_test:
+ /*
+ * wbnoinvd instruction
+ */
+ .byte 0xf3, 0x0f, 0x09
+ wbinvd
+ invd
+.size libdis_test, [.-libdis_test]
diff --git a/usr/src/test/util-tests/tests/dladm/Makefile b/usr/src/test/util-tests/tests/dladm/Makefile
index e37ae56072..2ce969fcc4 100644
--- a/usr/src/test/util-tests/tests/dladm/Makefile
+++ b/usr/src/test/util-tests/tests/dladm/Makefile
@@ -17,7 +17,7 @@ include $(SRC)/cmd/Makefile.cmd
include $(SRC)/test/Makefile.com
ROOTOPTPKG = $(ROOT)/opt/util-tests/tests
-PROG = allowed-ips set-linkprop
+PROG = allowed-ips set-linkprop show-overlay-exit vnic-mtu
ROOTPROG = $(PROG:%=$(ROOTOPTPKG)/%)
diff --git a/usr/src/test/util-tests/tests/dladm/allowed-cids.ksh b/usr/src/test/util-tests/tests/dladm/allowed-cids.ksh
new file mode 100644
index 0000000000..9b62962baf
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dladm/allowed-cids.ksh
@@ -0,0 +1,95 @@
+#!/bin/ksh
+#
+# 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 2017 Joyent, Inc.
+#
+
+source ./common.ksh
+
+property="allowed-dhcp-cids"
+
+setup
+
+# Valid hexadecimal strings
+epass 0x1234
+epass 0x123456789abcdef0
+epass 0x123456789abcdef0
+
+# Hex strings w/ an odd number of characters are not allowed
+efail 0x0
+efail 0x1
+efail 0x1fa
+efail 0xfba39e2
+
+# Invalid hexadecimal strings
+efail 0xz
+efail 0x01234567q12
+efail 0x=+
+efail 0x-1
+efail 0x1,2,3
+
+# Valid RFC 3315 DUID strings
+
+## DUID-LLT
+epass 1.1.1234.90:b8:d0:81:91:30
+epass 1.1.1512434853.90:b8:d0:81:91:30
+epass 1.1.28530123.90:b8:d0:81:91:30
+epass 1.6.1512434853.14:10:9f:d0:5b:d3
+
+## DUID-EN
+epass 2.9.0CC084D303000912
+epass 2.9.0cc084d303000912
+epass 2.32473.45ab
+epass 2.38678.0123abcd
+
+## DUID-LL
+epass 3.1.90:b8:d0:81:91:30
+epass 3.1.90:b8:d0:4b:c7:3b
+epass 3.1.2:8:20:a4:4d:ee
+epass 3.6.14:10:9f:d0:5b:d3
+
+# Invalid RFC 3315 DUID strings
+
+## DUID-LLT
+efail 1.1.12a34.90:b8:d0:81:91:30
+efail 1.1.15-33.90:b8:d0:81:91:30
+efail 1.1.98+123.90:b8:d0:81:91:30
+efail 3.z.1512434853.14:10:9f:d0:5b:d3
+efail 3.6.1512434853.q4:10:9f:d0:5b:d3
+
+## DUID-EN
+efail 2.32473.45a
+efail 2.9.Z
+efail 2.9.-12
+efail 2.QZ4.45a
+efail 2.38d78.0123abcd
+
+## DUID-LL
+efail 3.wy.90:b8:d0:81:91:30
+efail 3.1.90:z8:di:ob:c7:3b
+efail 3.1.5.2:8:20:a4:4d:ee
+
+## Uknown DUID forms
+efail 4.1.45a
+efail 9.1.45a
+efail 23.1.45a
+
+# Random strings of bytes are also accepted,
+# if they don't have the above prefixes.
+epass 1234
+epass abcdef
+epass qsxasdasdfgfdgkj123455
+epass 0x
+
+cleanup
+printf "TEST PASS: $ai_arg0\n"
diff --git a/usr/src/test/util-tests/tests/dladm/allowed-ips.ksh b/usr/src/test/util-tests/tests/dladm/allowed-ips.ksh
index 866b8c7966..4802f86286 100644
--- a/usr/src/test/util-tests/tests/dladm/allowed-ips.ksh
+++ b/usr/src/test/util-tests/tests/dladm/allowed-ips.ksh
@@ -11,47 +11,12 @@
#
#
-# Copyright (c) 2014, Joyent, Inc.
+# Copyright 2016 Joyent, Inc.
#
-ai_arg0="$(basename $0)"
-ai_stub="teststub$$"
-ai_vnic="testvnic$$"
+source ./common.ksh
-function fatal
-{
- typeset msg="$*"
- [[ -z "$msg" ]] && msg="failed"
- echo "TEST_FAIL: $vt_arg0: $msg" >&2
- exit 1
-}
-
-function setup
-{
- dladm create-etherstub $ai_stub || fatal "failed to create etherstub"
- dladm create-vnic -l $ai_stub $ai_vnic || fatal "failed to create vnic"
-}
-
-function cleanup
-{
- dladm delete-vnic $ai_vnic || fatal "failed to remove vnic"
- dladm delete-etherstub $ai_stub || fatal "failed to remove etherstub"
-}
-
-function runtest
-{
- dladm set-linkprop -p allowed-ips="$@" $ai_vnic 2>/dev/null
-}
-
-function epass
-{
- runtest $* || fatal "allowed-ips=$* failed, expected success\n"
-}
-
-function efail
-{
- runtest $* && fatal "allowed-ips=$* succeeded, expected failure\n"
-}
+property="allowed-ips"
#
# Run through all IPv6 prefixes for validity with a token prefix
@@ -204,4 +169,4 @@ epass fe80::/15
epass fe82::/15
cleanup
-printf "TEST PASS: $ai_arg0"
+printf "TEST PASS: $ai_arg0\n"
diff --git a/usr/src/test/util-tests/tests/dladm/common.ksh b/usr/src/test/util-tests/tests/dladm/common.ksh
new file mode 100644
index 0000000000..e5301d0a52
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dladm/common.ksh
@@ -0,0 +1,57 @@
+#!/bin/ksh
+#
+# 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 2017 Joyent, Inc.
+#
+
+ai_arg0="$(basename $0)"
+ai_stub="teststub$$"
+ai_vnic="testvnic$$"
+
+typeset property
+
+function fatal
+{
+ typeset msg="$*"
+ [[ -z "$msg" ]] && msg="failed"
+ echo "TEST_FAIL: $ai_arg0: $msg" >&2
+ exit 1
+}
+
+function setup
+{
+ dladm create-etherstub $ai_stub || fatal "failed to create etherstub"
+ dladm create-vnic -l $ai_stub $ai_vnic || fatal "failed to create vnic"
+}
+
+function cleanup
+{
+ dladm delete-vnic $ai_vnic || fatal "failed to remove vnic"
+ dladm delete-etherstub $ai_stub || fatal "failed to remove etherstub"
+}
+
+function runtest
+{
+ [[ -z "$property" ]] && fatal "missing property to set"
+ dladm set-linkprop -p $property="$@" $ai_vnic 2>/dev/null
+}
+
+function epass
+{
+ runtest $* || fatal "$property=$* failed, expected success\n"
+}
+
+function efail
+{
+ runtest $* && fatal "$property=$* succeeded, expected failure\n"
+}
diff --git a/usr/src/test/util-tests/tests/dladm/dynamic-methods.ksh b/usr/src/test/util-tests/tests/dladm/dynamic-methods.ksh
new file mode 100644
index 0000000000..4ed64a92b4
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dladm/dynamic-methods.ksh
@@ -0,0 +1,45 @@
+#!/bin/ksh
+#
+# 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 2017 Joyent, Inc.
+#
+
+source ./common.ksh
+
+property="dynamic-methods"
+
+setup
+
+# All valid values on their own
+epass slaac
+epass dhcpv4
+epass dhcpv6
+epass addrconf
+
+# Combinations of values
+epass slaac,dhcpv4
+epass slaac,dhcpv6
+epass dhcpv4,dhcpv6
+epass dhcpv4,addrconf
+epass dhcpv4,dhcpv6,slaac
+
+# Illegal values
+efail dhcpv8
+efail slaac,dhcpv8
+efail slack
+efail ipv6
+efail dhcp
+efail dhcpv
+
+cleanup
+printf "TEST PASS: $ai_arg0\n"
diff --git a/usr/src/test/util-tests/tests/dladm/show-overlay-exit.ksh b/usr/src/test/util-tests/tests/dladm/show-overlay-exit.ksh
new file mode 100644
index 0000000000..8a551a8182
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dladm/show-overlay-exit.ksh
@@ -0,0 +1,82 @@
+#!/bin/ksh
+#
+# 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 (c) 2017, Joyent, Inc.
+#
+
+soe_arg0="$(basename $0)"
+
+soe_overlay="soe_overlay$$"
+soe_dummy_ip="169.254.0.0"
+
+soe_port="2000"
+soe_vnetid=20
+soe_encap="vxlan"
+soe_search="direct"
+
+soe_etherstub="soe_teststub$$"
+
+function fatal
+{
+ typeset msg="$*"
+ [[ -z "$msg" ]] && msg="failed"
+ echo "TEST_FAIL: $vt_arg0: $msg" >&2
+ dladm delete-overlay $soe_overlay
+ dladm delete-etherstub $soe_etherstub
+ exit 1
+}
+
+function setup
+{
+ dladm create-overlay -v $soe_vnetid -e $soe_encap -s $soe_search \
+ -p vxlan/listen_ip=$soe_dummy_ip -p direct/dest_ip=$soe_dummy_ip \
+ -p direct/dest_port=$soe_port $soe_overlay || \
+ fatal "failed to create overlay"
+
+ dladm create-etherstub $soe_etherstub || \
+ fatal "failed to create etherstub"
+}
+
+function cleanup
+{
+ dladm delete-overlay $soe_overlay || \
+ fatal "failed to remove overlay"
+ dladm delete-etherstub $soe_etherstub || \
+ fatal "failed to remove etherstub"
+}
+
+function runtest
+{
+ dladm show-overlay $* > /dev/null 2>&1
+}
+
+function epass
+{
+ runtest $* || fatal "show-overlay=$* failed, expected success\n"
+}
+
+function efail
+{
+ runtest $* && fatal "show-overlay=$* succeeded, expected failure\n"
+}
+
+setup
+
+epass $soe_overlay
+efail $soe_etherstub
+efail $soe_etherstub $soe_overlay
+efail $soe_overlay $soe_etherstub
+
+cleanup
+
+printf "TEST PASS: $soe_arg0"
diff --git a/usr/src/test/util-tests/tests/dladm/vnic-mtu.ksh b/usr/src/test/util-tests/tests/dladm/vnic-mtu.ksh
new file mode 100644
index 0000000000..cfb48e2e65
--- /dev/null
+++ b/usr/src/test/util-tests/tests/dladm/vnic-mtu.ksh
@@ -0,0 +1,116 @@
+#!/bin/ksh
+#
+# 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 2015 Joyent, Inc.
+#
+
+#
+# The purpose of this is to test the MTU property on VNICs, using both
+# temporary and persistent properties. To do this, we create an
+# Etherstub and then create various VNICs on top of it.
+#
+
+vm_arg0="$(basename $0)"
+vm_stub="teststub$$"
+vm_vnic="testvnic$$"
+
+VM_MTU_MIN=576
+VM_MTU_MAX=9000
+
+fatal()
+{
+ typeset msg="$*"
+ [[ -z "$msg" ]] && msg="failed"
+ echo "TEST_FAIL: $vm_arg0: $msg" >&2
+
+ # Try to clean up just in case
+ dladm delete-vnic $vm_vnic 2>/dev/null
+ dladm delete-etherstub $vm_stub 2>/dev/null
+ exit 1
+}
+
+#
+# Validate that the MTU of the datalink dev has the MTU that we expect
+#
+validate_mtu()
+{
+ typeset dev=$1
+ typeset mtu=$2
+ typeset val
+
+ [[ -z "$dev" ]] && fatal "missing required device"
+ [[ -z "$mtu" ]] && fatal "missing required mtu"
+ val=$(dladm show-linkprop -c -p mtu -o value $dev)
+ [[ $? -eq 0 ]] || fatal "failed to get MTU for $dev"
+ (( $val == $mtu )) || fatal \
+ "mtu mismatch on $dev: expected $mtu, got $val"
+}
+
+delete_stub()
+{
+ dladm delete-etherstub $vm_stub || fatal \
+ "failed to delete stub $vm_stub"
+}
+
+create_stub()
+{
+ dladm create-etherstub $vm_stub || fatal \
+ "failed to create stub"
+ validate_mtu $vm_stub $VM_MTU_MAX
+}
+
+delete_vnic()
+{
+ dladm delete-vnic $vm_vnic || fatal "failed to delete vnic $vm_vnic"
+}
+
+test_vnic_pass()
+{
+ typeset mtu=$1
+ typeset flags=$2
+
+ [[ -z "$mtu" ]] && fatal "missing required mtu"
+ dladm create-vnic $flags -l $vm_stub -p mtu=$mtu $vm_vnic || fatal \
+ "failed to create vnic: $vm_vnic"
+ validate_mtu "$vm_vnic" "$mtu"
+ delete_vnic
+}
+
+test_vnic_fail()
+{
+ typeset mtu=$1
+ typeset flags=$2
+
+ [[ -z "$mtu" ]] && fatal "missing required mtu"
+ dladm create-vnic $flags -l $vm_stub -p mtu=$mtu \
+ $vm_vnic 2>/dev/null && fatal \
+ "created vnic with mtu $mtu, but failure expected"
+}
+
+test_pass()
+{
+ typeset flags=$1
+
+ create_stub
+ test_vnic_pass 1500 $flags
+ test_vnic_pass 1400 $flags
+ test_vnic_pass $VM_MTU_MIN $flags
+ test_vnic_pass $VM_MTU_MAX $flags
+ test_vnic_fail $((($VM_MTU_MIN - 1))) $flags
+ test_vnic_fail $((($VM_MTU_MAX + 1))) $flags
+ delete_stub
+}
+
+test_pass "-t"
+test_pass
+echo "TEST PASS: $vm_arg0"
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
index 0df113d490..0f4b77f9c9 100644
--- a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
+++ b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
@@ -16,6 +16,8 @@
#
XGREP=${XGREP:=/usr/bin/grep}
+
+MY_TESTS=${MY_TESTS:=/opt/util-tests}
FILEDIR=$MY_TESTS/tests/files
fail() {
diff --git a/usr/src/test/util-tests/tests/libnvpair_json/Makefile b/usr/src/test/util-tests/tests/libnvpair_json/Makefile
index faa76094fe..633b515f19 100644
--- a/usr/src/test/util-tests/tests/libnvpair_json/Makefile
+++ b/usr/src/test/util-tests/tests/libnvpair_json/Makefile
@@ -17,7 +17,7 @@ include $(SRC)/Makefile.master
ROOTOPTPKG = $(ROOT)/opt/util-tests
TESTDIR = $(ROOTOPTPKG)/tests/libnvpair_json
-ROOTBINDIR = $(ROOTOPTPKG)/bin
+TESTBIN = $(ROOTOPTPKG)/bin
PROG = print_json
@@ -38,9 +38,11 @@ include $(SRC)/test/Makefile.com
OBJS = $(PROG:%=%.o)
SRCS = $(OBJS:%.o=%.c)
-CMDS = $(PROG:%=$(ROOTBINDIR)/%) $(SCRIPTS:%=$(TESTDIR)/%)
+CMDS = $(PROG:%=$(TESTBIN)/%) $(SCRIPTS:%=$(TESTDIR)/%)
$(CMDS) := FILEMODE = 0555
+DIRS = $(TESTDIR) $(TESTBIN)
+
LDLIBS += -lnvpair
# intentional abort()
@@ -62,16 +64,13 @@ clobber: clean
clean:
-$(RM) $(OBJS)
-$(CMDS): $(TESTDIR) $(PROG)
+$(CMDS): $(DIRS)
-$(ROOTBINDIR):
- $(INS.dir)
-
-$(ROOTBINDIR)/%: %
- $(INS.file)
-
-$(TESTDIR):
+$(DIRS):
$(INS.dir)
$(TESTDIR)/%: %.ksh
$(INS.rename)
+
+$(TESTBIN)/%: %
+ $(INS.file)
diff --git a/usr/src/test/util-tests/tests/libnvpair_json/json_08_large_data.ksh b/usr/src/test/util-tests/tests/libnvpair_json/json_08_large_data.ksh
new file mode 100644
index 0000000000..ca19e10d06
--- /dev/null
+++ b/usr/src/test/util-tests/tests/libnvpair_json/json_08_large_data.ksh
@@ -0,0 +1,37 @@
+#!/bin/ksh
+#
+# 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 2015, Joyent, Inc.
+#
+
+DIR=$(dirname $(whence $0))
+. ${DIR}/json_common
+
+BASELINE="$(cat <<EOF
+{\
+"o":[\
+$(for i in {1..50}; do
+ printf '"%s",' 'some_very_big_string_that_takes_up_space'
+done)\
+"end"\
+]\
+}
+EOF)"
+
+OUTPUT="$(${DIR}/../../bin/print_json <<-EOF
+add_string_array "o" $(for i in {1..50}; do
+ printf '"%s" ' 'some_very_big_string_that_takes_up_space'
+done)"end";
+EOF)"
+
+complete
diff --git a/usr/src/test/util-tests/tests/libnvpair_json/print_json.c b/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
index e34ae8f7b1..9ac19b1bd1 100644
--- a/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
+++ b/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
@@ -814,7 +814,7 @@ main(int argc, char **argv)
/*
* Print the resultant list, and a terminating newline:
*/
- if (nvlist_print_json(stdout, lw->lw_nvl[0]) != 0 ||
+ if (nvlist_print_json(stdout, lw->lw_nvl[0]) < 0 ||
fprintf(stdout, "\n") < 0)
goto out;
diff --git a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
index 52a0becedd..e38b5a34a1 100644
--- a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
+++ b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
@@ -15,6 +15,7 @@
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2019 Joyent, Inc.
#
export PATH="/usr/bin"
@@ -70,6 +71,8 @@ function find_runfile
distro=openindiana
elif [[ 0 -ne $(grep -c OmniOS /etc/release 2>/dev/null) ]]; then
distro=omnios
+ elif [[ 0 -ne $(grep -c SmartOS /etc/release 2>/dev/null) ]]; then
+ distro=smartos
fi
[[ -n $distro ]] && echo $STF_SUITE/runfiles/$distro.run
@@ -126,6 +129,18 @@ function constrain_path
# Special case links
ln -s /usr/gnu/bin/dd $PATHDIR/gnu_dd
+
+ # SmartOS does not ship some required commands by default.
+ # Link to them in the package manager's namespace.
+ pkgsrc_bin=/opt/local/bin
+ pkgsrc_packages="sudo truncate python base64 shuf sha256sum"
+ for pkg in $pkgsrc_packages; do
+ if [[ ! -x $PATHDIR/$pkg ]]; then
+ rm $PATHDIR/$pkg &&
+ ln -s $pkgsrc_bin/$pkg $PATHDIR/$pkg ||
+ fail "Couldn't link $pkg"
+ fi
+ done
}
constrain_path
diff --git a/usr/src/test/zfs-tests/include/libtest.shlib b/usr/src/test/zfs-tests/include/libtest.shlib
index 363f674f03..725c971a4c 100644
--- a/usr/src/test/zfs-tests/include/libtest.shlib
+++ b/usr/src/test/zfs-tests/include/libtest.shlib
@@ -323,6 +323,13 @@ function default_mirror_setup
log_pass
}
+function default_mirror_2way_setup
+{
+ default_mirror_setup_noexit $1 $2
+
+ log_pass
+}
+
#
# Given a pair of disks, set up a storage pool and dataset for the mirror
# @parameters: $1 the primary side of the mirror
diff --git a/usr/src/test/zfs-tests/runfiles/delphix.run b/usr/src/test/zfs-tests/runfiles/delphix.run
index e97d0e6e0b..a4b392cb9a 100644
--- a/usr/src/test/zfs-tests/runfiles/delphix.run
+++ b/usr/src/test/zfs-tests/runfiles/delphix.run
@@ -133,8 +133,8 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos',
'zfs_create_004_pos', 'zfs_create_005_pos', 'zfs_create_006_pos',
'zfs_create_007_pos', 'zfs_create_008_neg', 'zfs_create_009_neg',
'zfs_create_010_neg', 'zfs_create_011_pos', 'zfs_create_012_pos',
- 'zfs_create_013_pos', 'zfs_create_encrypted',
- 'zfs_create_crypt_combos']
+ 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos',
+ 'zfs_create_dryrun', 'zfs_create_verbose']
[/opt/zfs-tests/tests/functional/cli_root/zfs_destroy]
tests = ['zfs_destroy_001_pos', 'zfs_destroy_002_pos', 'zfs_destroy_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run
index ff7a697d5f..bc5698c864 100644
--- a/usr/src/test/zfs-tests/runfiles/omnios.run
+++ b/usr/src/test/zfs-tests/runfiles/omnios.run
@@ -134,7 +134,8 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos',
'zfs_create_004_pos', 'zfs_create_005_pos', 'zfs_create_006_pos',
'zfs_create_007_pos', 'zfs_create_008_neg', 'zfs_create_009_neg',
'zfs_create_010_neg', 'zfs_create_011_pos', 'zfs_create_012_pos',
- 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos']
+ 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos',
+ 'zfs_create_dryrun', 'zfs_create_verbose']
[/opt/zfs-tests/tests/functional/cli_root/zfs_destroy]
tests = ['zfs_destroy_001_pos', 'zfs_destroy_002_pos', 'zfs_destroy_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run
index 9ab1d42293..6fcb6f724a 100644
--- a/usr/src/test/zfs-tests/runfiles/openindiana.run
+++ b/usr/src/test/zfs-tests/runfiles/openindiana.run
@@ -134,7 +134,8 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos',
'zfs_create_004_pos', 'zfs_create_005_pos', 'zfs_create_006_pos',
'zfs_create_007_pos', 'zfs_create_008_neg', 'zfs_create_009_neg',
'zfs_create_010_neg', 'zfs_create_011_pos', 'zfs_create_012_pos',
- 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos']
+ 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos',
+ 'zfs_create_dryrun', 'zfs_create_verbose']
[/opt/zfs-tests/tests/functional/cli_root/zfs_destroy]
tests = ['zfs_destroy_001_pos', 'zfs_destroy_002_pos', 'zfs_destroy_003_pos',
diff --git a/usr/src/test/zfs-tests/runfiles/smartos.run b/usr/src/test/zfs-tests/runfiles/smartos.run
index 52fbf045dc..a9ce4c13d1 100644
--- a/usr/src/test/zfs-tests/runfiles/smartos.run
+++ b/usr/src/test/zfs-tests/runfiles/smartos.run
@@ -96,7 +96,8 @@ tests = ['zfs_create_001_pos', 'zfs_create_002_pos', 'zfs_create_003_pos',
'zfs_create_004_pos', 'zfs_create_005_pos', 'zfs_create_006_pos',
'zfs_create_007_pos', 'zfs_create_008_neg', 'zfs_create_009_neg',
'zfs_create_010_neg', 'zfs_create_011_pos', 'zfs_create_012_pos',
- 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos']
+ 'zfs_create_013_pos', 'zfs_create_encrypted', 'zfs_create_crypt_combos',
+ 'zfs_create_dryrun', 'zfs_create_verbose']
[/opt/zfs-tests/tests/functional/cli_root/zfs_destroy]
tests = ['zfs_destroy_001_pos', 'zfs_destroy_002_pos', 'zfs_destroy_003_pos',
diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_dryrun.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_dryrun.ksh
new file mode 100644
index 0000000000..64b8296f46
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_dryrun.ksh
@@ -0,0 +1,169 @@
+#!/bin/ksh -p
+#
+# 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 2019 Joyent, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
+
+#
+# DESCRIPTION:
+# zfs create -n should perform basic sanity checking but should never create a
+# dataset. If -v and/or -P are used, it should verbose about what would be
+# created if sanity checks pass.
+#
+# STRATEGY:
+# 1. Attempt to create a file system and a volume using various combinations of
+# -n with -v and -P.
+#
+
+verify_runnable "both"
+
+#
+# Verifies that valid commands with -n and without -[vP]:
+# - succeed
+# - do not create a dataset
+# - do not generate output
+#
+function dry_create_no_output
+{
+ typeset -a cmd=(zfs create -n "$@")
+
+ log_note "$0: ${cmd[@]}"
+ log_must "${cmd[@]}"
+ datasetexists "$TESTPOOL/$TESTFS1" &&
+ log_fail "$TESTPOOL/$TESTFS1 unexpectedly created by '${cmd[@]}'"
+ typeset out=$("${cmd[@]}" 2>&1)
+ [[ -z "$out" ]] ||
+ log_fail "unexpected output '$out' from '${cmd[@]}'"
+}
+
+#
+# Verifies that commands with invalid properties or invalid property values
+# - fail
+# - do not create a dataset
+# - generate a message on stderr
+#
+function dry_create_error
+{
+ typeset -a cmd=(zfs create -n "$@")
+
+ log_note "$0: ${cmd[@]}"
+ log_mustnot "${cmd[@]}"
+ datasetexists "$TESTPOOL/$TESTFS1" &&
+ log_fail "$TESTPOOL/$TESTFS1 unexpectedly created by '${cmd[@]}'"
+ typeset out=$("${cmd[@]}" 2>&1 >/dev/null)
+ [[ -z "$out" ]] &&
+ log_fail "expected an error message but got none from '${cmd[@]}'"
+}
+
+#
+# Verifies that dry-run commands with parseable output
+# - succeed
+# - do not create datasets
+# - generate parseable output on stdout
+# - output matches expectations
+#
+function dry_create_parseable
+{
+ typeset -n exp=$1
+ shift
+ typeset -a cmd=(zfs create -Pn "$@")
+ typeset ds=${cmd[${#cmd[@]} - 1]}
+ typeset out
+ typeset -a toks
+ typeset -a props
+ typeset found_create=false
+
+ log_note "$0: ${cmd[@]}"
+ out=$("${cmd[@]}")
+ (( $? == 0 )) ||
+ log_fail "unexpected failure getting stdout from '${cmd[@]}'"
+ datasetexists "$TESTPOOL/$TESTFS1" &&
+ log_fail "$TESTPOOL/$TESTFS1 unexpectedly created by '${cmd[@]}'"
+ echo "$out" | while IFS=$'\t' read -A toks; do
+ log_note "verifying ${toks[@]}"
+ case ${toks[0]} in
+ create)
+ log_must test "${#toks[@]}" -eq 2
+ log_must test "${toks[1]}" == "$ds"
+ found_create="yes, I found create"
+ ;;
+ property)
+ log_must test "${#toks[@]}" -eq 3
+ typeset prop=${toks[1]}
+ typeset val=${toks[2]}
+ if [[ -z "${exp[$prop]}" ]]; then
+ log_fail "unexpectedly got property '$prop'"
+ fi
+ # We may not know the exact value a property will take
+ # on. This is the case for at least refreservation.
+ if [[ ${exp[$prop]} != "*" ]]; then
+ log_must test "${exp[$prop]}" == "$val"
+ fi
+ unset exp[$prop]
+ ;;
+ *)
+ log_fail "Unexpected line ${toks[@]}"
+ ;;
+ esac
+ done
+
+ log_must test "$found_create" == "yes, I found create"
+ log_must test "extra props: ${!exp[@]}" == "extra props: "
+}
+
+function cleanup
+{
+ if datasetexists "$TESTPOOL/$TESTFS1"; then
+ log_must zfs destroy -r "$TESTPOOL/$TESTFS1"
+ fi
+}
+log_onexit cleanup
+
+log_assert "zfs create -n creates nothing but can describe what would be" \
+ "created"
+
+# Typical creations should succeed
+dry_create_no_output "$TESTPOOL/$TESTFS1"
+dry_create_no_output -V 10m "$TESTPOOL/$TESTFS1"
+# It shouldn't do a space check right now
+dry_create_no_output -V 100t "$TESTPOOL/$TESTFS1"
+# It shouldn't create parent datasets either
+dry_create_no_output -p "$TESTPOOL/$TESTFS1/$TESTFS2"
+dry_create_no_output -pV 10m "$TESTPOOL/$TESTFS1/$TESTFS2"
+
+# Various invalid properties should be recognized and result in an error
+dry_create_error -o nosuchprop=42 "$TESTPOOL/$TESTFS1"
+dry_create_error -b 1234 -V 10m "$TESTPOOL/$TESTFS1"
+
+# Parseable output should be parseable.
+typeset -A expect
+expect=([compression]=on)
+dry_create_parseable expect -o compression=on "$TESTPOOL/$TESTFS1"
+
+# Sparse volumes should not get a gratuitous refreservation
+expect=([volblocksize]=4096 [volsize]=$((1024 * 1024 * 10)))
+dry_create_parseable expect -b 4k -V 10m -s "$TESTPOOL/$TESTFS1"
+
+# Non-sparse volumes should have refreservation
+expect=(
+ [volblocksize]=4096
+ [volsize]=$((1024 * 1024 * 10))
+ [refreservation]="*"
+)
+dry_create_parseable expect -b 4k -V 10m "$TESTPOOL/$TESTFS1"
+
+log_pass "zfs create -n creates nothing but can describe what would be" \
+ "created"
diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
index 51dfd8107b..9a45a363bf 100644
--- a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/setup.ksh
@@ -25,11 +25,15 @@
# Use is subject to license terms.
#
+#
+# Copyright 2019 Joyent, Inc.
+#
+
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
-verify_disk_count "$DISKS" 2
+verify_disk_count "$DISKS" 3
DISK=${DISKS%% *}
-default_mirror_setup $DISKS
+default_mirror_2way_setup $DISKS
diff --git a/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_002_neg.ksh b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_002_neg.ksh
new file mode 100644
index 0000000000..fde508254c
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/cli_root/zpool_replace/zpool_replace_002_neg.ksh
@@ -0,0 +1,51 @@
+#!/usr/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2019 Joyent, Inc.
+#
+
+. $STF_SUITE/include/libtest.shlib
+
+#
+# DESCRIPTION:
+#
+# zpool replace returns an error when spare device is faulted.
+#
+# STRATEGY:
+# 1. Add hot spare to pool
+# 2. Fault the hot spare device
+# 3. Attempt to replace a device in a pool with the faulted spare
+# 4. Verify the 'zpool replace' command fails
+#
+
+SPARE=${DISKS##* }
+DISK=${DISKS%% *}
+
+verify_runnable "global"
+log_must zpool add $TESTPOOL spare $SPARE
+log_assert "zpool replace returns an error when the hot spare is faulted"
+
+log_must zinject -d $SPARE -A fault $TESTPOOL
+log_mustnot zpool replace $TESTPOOL $DISK $SPARE
+
+log_pass "zpool replace returns an error when the hot spare is faulted"
diff --git a/usr/src/test/zfs-tests/tests/functional/mmp/mmp.cfg b/usr/src/test/zfs-tests/tests/functional/mmp/mmp.cfg
index 9f7e76e270..a58346dcae 100644
--- a/usr/src/test/zfs-tests/tests/functional/mmp/mmp.cfg
+++ b/usr/src/test/zfs-tests/tests/functional/mmp/mmp.cfg
@@ -15,6 +15,7 @@
#
# Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
+# Copyright 2019 Joyent, Inc.
#
export PREV_UBER="$TEST_BASE_DIR/mmp-uber-prev.txt"
diff --git a/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh b/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh
index 415c8bdc5e..0ff8fcf97b 100644
--- a/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/nopwrite/nopwrite_sync.ksh
@@ -13,6 +13,7 @@
#
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+# Copyright 2019 Joyent, Inc.
#
. $STF_SUITE/include/libtest.shlib
@@ -42,12 +43,12 @@ log_assert "nopwrite works for sync writes"
log_must zfs set compress=on $origin
log_must zfs set checksum=sha256 $origin
-gnu_dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS oflag=sync \
+dd if=/dev/urandom of=$TESTDIR/file bs=1024k count=$MEGS oflag=sync \
conv=notrunc >/dev/null 2>&1 || log_fail "dd into $TESTDIR/file failed."
zfs snapshot $origin@a || log_fail "zfs snap failed"
log_must zfs clone $origin@a $origin/clone
-gnu_dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
+dd if=/$TESTDIR/file of=/$TESTDIR/clone/file bs=1024k count=$MEGS \
oflag=sync conv=notrunc >/dev/null 2>&1 || log_fail "dd failed."
log_must verify_nopwrite $origin $origin@a $origin/clone
diff --git a/usr/src/test/zfs-tests/tests/functional/slog/slog.cfg b/usr/src/test/zfs-tests/tests/functional/slog/slog.cfg
index 6a28880ade..17f28abaac 100644
--- a/usr/src/test/zfs-tests/tests/functional/slog/slog.cfg
+++ b/usr/src/test/zfs-tests/tests/functional/slog/slog.cfg
@@ -26,10 +26,11 @@
#
# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+# Copyright 2019 Joyent, Inc.
#
-export VDIR=/disk-slog
-export VDIR2=/disk2-slog
+export VDIR=/var/tmp/disk-slog
+export VDIR2=/var/tmp/disk2-slog
export VDEV="$VDIR/a $VDIR/b $VDIR/c"
export SDEV="$VDIR/d"
diff --git a/usr/src/test/zfs-tests/tests/functional/slog/slog_014_pos.ksh b/usr/src/test/zfs-tests/tests/functional/slog/slog_014_pos.ksh
index efd876d554..63bd52288a 100644
--- a/usr/src/test/zfs-tests/tests/functional/slog/slog_014_pos.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/slog/slog_014_pos.ksh
@@ -27,6 +27,7 @@
#
# Copyright (c) 2013, 2018 by Delphix. All rights reserved.
+# Copyright 2019 Joyent, Inc.
# Copyright 2019 RackTop Systems.
#