From owner-p4-projects@FreeBSD.ORG Sat May 17 21:06:49 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DCA9ED00; Sat, 17 May 2014 21:06:48 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E585CFE for ; Sat, 17 May 2014 21:06:48 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 8A9DE2715 for ; Sat, 17 May 2014 21:06:48 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HL6mol000989 for ; Sat, 17 May 2014 21:06:48 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.8/8.14.8/Submit) id s4HL6mMw000986 for perforce@freebsd.org; Sat, 17 May 2014 21:06:48 GMT (envelope-from jhb@freebsd.org) Date: Sat, 17 May 2014 21:06:48 GMT Message-Id: <201405172106.s4HL6mMw000986@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1193935 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:06:49 -0000 http://p4web.freebsd.org/@@1193935?ac=10 Change 1193935 by jhb@jhb_pippin on 2014/05/17 21:06:27 Finish rdseed/rdrand. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/db_disasm.c#15 edit .. //depot/projects/smpng/sys/modules/x86dis/x86dis.c#10 edit Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/db_disasm.c#15 (text+ko) ==== @@ -71,6 +71,7 @@ #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 */ @@ -635,8 +636,8 @@ { "", TRUE, NONE, 0, 0 }, { "", TRUE, NONE, 0, 0 }, { "", TRUE, NONE, 0, 0 }, - { "rdrand",TRUE, LONG, op1(Ril), 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] = { @@ -1528,6 +1529,10 @@ 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; ==== //depot/projects/smpng/sys/modules/x86dis/x86dis.c#10 (text+ko) ==== @@ -120,4 +120,8 @@ __asm __volatile("vmwrite %0,%1" :: "m" (*addr), "r" ((uint64_t)reg)); __asm __volatile("vmxoff"); __asm __volatile("vmxon %0" :: "m" (*addr)); + (void)rdrand(); + (void)rdrand64(); + __asm __volatile("rdseed %0" : "=r" (val)); + __asm __volatile("rdseed %edi"); }