changeset 13460:5c0e6f4dc413

1518 dis should support AMD SVM/AMD-V/Pacifica instructions Reviewed by: Garrett D'Amore <garrett@nexenta.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Garrett D'Amore <garrett@nexenta.com>
author Richard Lowe <richlowe@richlowe.net>
date Thu, 15 Sep 2011 08:58:43 +0100
parents c3454574dd1a
children 8a356f48c838
files usr/src/common/dis/i386/dis_tables.c
diffstat 1 files changed, 41 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/common/dis/i386/dis_tables.c	Thu Aug 04 23:34:40 2011 -0700
+++ b/usr/src/common/dis/i386/dis_tables.c	Thu Sep 15 08:58:43 2011 +0100
@@ -230,7 +230,8 @@
 	VEX_RRM,        /* VEX  VEX.vvvv, mod_reg              -> mod_rm */
 	VEX_RMX,        /* VEX  VEX.vvvv, mod_rm               -> mod_reg */
 	VMx,		/* vmcall/vmlaunch/vmresume/vmxoff */
-	VMxo		/* VMx instruction with optional prefix */
+	VMxo,		/* VMx instruction with optional prefix */
+	SVM		/* AMD SVM instructions */
 };
 
 /*
@@ -498,7 +499,7 @@
  */
 const instable_t dis_op0F01[8] = {
 
-/*  [0]  */	TNSZ("sgdt",VMx,6),	TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6),	TNSZ("lidt",MO,6),
+/*  [0]  */	TNSZ("sgdt",VMx,6),	TNSZ("sidt",MONITOR_MWAIT,6),	TNSZ("lgdt",XGETBV_XSETBV,6),	TNSZ("lidt",SVM,6),
 /*  [4]  */	TNSZ("smsw",M,2),	INVALID, 		TNSZ("lmsw",M,2),	TNS("invlpg",SWAPGS),
 };
 
@@ -3550,6 +3551,44 @@
 			break;
 		}
 		/*FALLTHROUGH*/
+	case SVM:
+		if (mode == 3) {
+#if DIS_TEXT
+			char *vinstr;
+
+			switch (r_m) {
+			case 0:
+				vinstr = "vmrun";
+				break;
+			case 1:
+				vinstr = "vmmcall";
+				break;
+			case 2:
+				vinstr = "vmload";
+				break;
+			case 3:
+				vinstr = "vmsave";
+				break;
+			case 4:
+				vinstr = "stgi";
+				break;
+			case 5:
+				vinstr = "clgi";
+				break;
+			case 6:
+				vinstr = "skinit";
+				break;
+			case 7:
+				vinstr = "invlpga";
+				break;
+			}
+
+			(void) strncpy(x->d86_mnem, vinstr, OPLEN);
+#endif
+			NOMEM;
+			break;
+		}
+		/*FALLTHROUGH*/
 	case MONITOR_MWAIT:
 		if (mode == 3) {
 			if (r_m == 0) {