From owner-svn-src-head@FreeBSD.ORG Sat May 17 21:10:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7A9C2; Sat, 17 May 2014 21:10:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0233A2743; Sat, 17 May 2014 21:10:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HLA3Zl097293; Sat, 17 May 2014 21:10:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLA3Xg097292; Sat, 17 May 2014 21:10:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405172110.s4HLA3Xg097292@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 21:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266354 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:10:04 -0000 Author: jhb Date: Sat May 17 21:10:03 2014 New Revision: 266354 URL: http://svnweb.freebsd.org/changeset/base/266354 Log: Add support for decoding rdrand and rdseed. Modified: head/sys/amd64/amd64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Sat May 17 21:07:54 2014 (r266353) +++ head/sys/amd64/amd64/db_disasm.c Sat May 17 21:10:03 2014 (r266354) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define R 5 /* register, in 'reg' field */ #define Rw 6 /* word register, in 'reg' field */ #define Rq 39 /* quad register, in 'reg' field */ +#define Rv 40 /* register in 'r/m' field */ #define Ri 7 /* register in instruction */ #define S 8 /* segment reg, in 'reg' field */ #define Si 9 /* segment reg, in instruction */ @@ -628,6 +629,17 @@ static const struct inst db_Grp5[] = { { "", TRUE, NONE, 0, 0 } }; +static const struct inst db_Grp9b[] = { + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "rdrand",TRUE, LONG, op1(Rv), 0 }, + { "rdseed",TRUE, LONG, op1(Rv), 0 } +}; + static const struct inst db_inst_table[256] = { /*00*/ { "add", TRUE, BYTE, op2(R, E), 0 }, /*01*/ { "add", TRUE, LONG, op2(R, E), 0 }, @@ -1300,7 +1312,13 @@ db_disasm(loc, altfmt) i_size = ip->i_size; i_mode = ip->i_mode; - if (ip->i_extra == db_Grp1 || ip->i_extra == db_Grp2 || + if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) == 3) { + ip = &db_Grp9b[f_reg(rex, regmodrm)]; + i_name = ip->i_name; + i_size = ip->i_size; + i_mode = ip->i_mode; + } + else if (ip->i_extra == db_Grp1 || ip->i_extra == db_Grp2 || ip->i_extra == db_Grp6 || ip->i_extra == db_Grp7 || ip->i_extra == db_Grp8 || ip->i_extra == db_Grp9 || ip->i_extra == db_Grp15) { @@ -1511,6 +1529,10 @@ db_disasm(loc, altfmt) db_printf("%s", db_reg[rex != 0 ? 1 : 0][(rex & REX_R) ? QUAD : LONG][f_rm(rex, inst)]); break; + case Rv: + db_printf("%s", db_reg[rex != 0 ? 1 : 0][(size == LONG && (rex & REX_W)) ? QUAD : size][f_rm(rex, regmodrm)]); + break; + case S: db_printf("%s", db_seg_reg[f_reg(rex, regmodrm)]); break;