summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2019-06-28 22:00:36 +0000
committerRobert Mustacchi <rm@fingolfin.org>2020-03-13 07:57:47 +0000
commitc1e9bf00765d7ac9cf1986575e4489dd8710d9b1 (patch)
treedd43bcd9622efa7b79b1c0f2c84f2b5c5adea055
parent95bb2cef100e6d3ce201012b6e4b677106e44751 (diff)
downloadillumos-joyent-c1e9bf00765d7ac9cf1986575e4489dd8710d9b1.tar.gz
12369 dis WBNOINVD support
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--exception_lists/wscheck1
-rw-r--r--usr/src/common/dis/i386/dis_tables.c26
-rw-r--r--usr/src/pkg/manifests/system-test-utiltest.mf2
-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
5 files changed, 54 insertions, 9 deletions
diff --git a/exception_lists/wscheck b/exception_lists/wscheck
index a76b838ef4..c7a1ee77e8 100644
--- a/exception_lists/wscheck
+++ b/exception_lists/wscheck
@@ -17,6 +17,7 @@ usr/src/cmd/smbsrv/testoplock/case*.ref
usr/src/data/hwdata/pci.ids
usr/src/data/hwdata/usb.ids
usr/src/data/perfmon/readme.txt
+usr/src/test/util-tests/tests/dis/i386/*.out
usr/src/tools/smatch/src/*
usr/src/uts/common/io/cxgbe/*
usr/src/uts/common/io/qede/*
diff --git a/usr/src/common/dis/i386/dis_tables.c b/usr/src/common/dis/i386/dis_tables.c
index 12a1112d8a..ddca678f1c 100644
--- a/usr/src/common/dis/i386/dis_tables.c
+++ b/usr/src/common/dis/i386/dis_tables.c
@@ -21,7 +21,7 @@
*/
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2019, Joyent, Inc.
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -562,6 +562,11 @@ const instable_t dis_opMOVSLD = TNS("movslq",MOVSXZ);
const instable_t dis_opPause = TNS("pause", NORM);
/*
+ * "decode table" for wbnoinvd instruction
+ */
+const instable_t dis_opWbnoinvd = TNS("wbnoinvd", NORM);
+
+/*
* Decode table for 0x0F00 opcodes
*/
const instable_t dis_op0F00[8] = {
@@ -2660,7 +2665,7 @@ dtrace_vex_adjust(uint_t vex_byte1, uint_t mode, uint_t *reg, uint_t *r_m)
*/
/* ARGSUSED */
static void
-dtrace_evex_mnem_adjust(dis86_t *x, instable_t *dp, uint_t vex_W,
+dtrace_evex_mnem_adjust(dis86_t *x, const instable_t *dp, uint_t vex_W,
uint_t evex_byte2)
{
#ifdef DIS_TEXT
@@ -3215,7 +3220,7 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex)
int
dtrace_disx86(dis86_t *x, uint_t cpu_mode)
{
- instable_t *dp; /* decode table being used */
+ const instable_t *dp; /* decode table being used */
#ifdef DIS_TEXT
uint_t i;
#endif
@@ -3712,11 +3717,11 @@ not_avx512:
if (opnd_size_prefix == 0) {
/* SSSE3 MMX instructions */
dp_mmx = *dp;
- dp = &dp_mmx;
- dp->it_adrmode = MMOPM_66o;
+ dp_mmx.it_adrmode = MMOPM_66o;
#ifdef DIS_MEM
- dp->it_size = 8;
+ dp_mmx.it_size = 8;
#endif
+ dp = &dp_mmx;
}
break;
default:
@@ -3797,11 +3802,11 @@ not_avx512:
if (opnd_size_prefix == 0) {
/* SSSE3 MMX instructions */
dp_mmx = *dp;
- dp = &dp_mmx;
- dp->it_adrmode = MM;
+ dp_mmx.it_adrmode = MM;
#ifdef DIS_MEM
- dp->it_size = 8;
+ dp_mmx.it_size = 8;
#endif
+ dp = &dp_mmx;
}
break;
case CRC32:
@@ -3818,6 +3823,9 @@ not_avx512:
default:
goto error;
}
+ } else if (rep_prefix == 0xf3 && opcode4 == 0 && opcode5 == 9) {
+ rep_prefix = 0;
+ dp = (instable_t *)&dis_opWbnoinvd;
} else {
dp = (instable_t *)&dis_op0F[opcode4][opcode5];
}
diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf
index 53c57375ef..58174802a5 100644
--- a/usr/src/pkg/manifests/system-test-utiltest.mf
+++ b/usr/src/pkg/manifests/system-test-utiltest.mf
@@ -1289,6 +1289,8 @@ file path=opt/util-tests/tests/dis/i386/tst.tsc.out mode=0444
file path=opt/util-tests/tests/dis/i386/tst.tsc.s mode=0444
file path=opt/util-tests/tests/dis/i386/tst.vmx.out mode=0444
file path=opt/util-tests/tests/dis/i386/tst.vmx.s mode=0444
+file path=opt/util-tests/tests/dis/i386/tst.wbnovind.out mode=0444
+file path=opt/util-tests/tests/dis/i386/tst.wbnovind.s mode=0444
file path=opt/util-tests/tests/dis/risc-v-c/32.ldsr.out mode=0444
file path=opt/util-tests/tests/dis/risc-v-c/32.ldsr.s mode=0444
file path=opt/util-tests/tests/dis/risc-v-c/64.int.out mode=0444
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]