From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755448AbbIHOif (ORCPT ); Tue, 8 Sep 2015 10:38:35 -0400 Received: from terminus.zytor.com ([198.137.202.10]:52445 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755075AbbIHOib (ORCPT ); Tue, 8 Sep 2015 10:38:31 -0400 Date: Tue, 8 Sep 2015 07:37:47 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: adrian.hunter@intel.com, masami.hiramatsu.pt@hitachi.com, acme@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@redhat.com, tglx@linutronix.de, hpa@zytor.com, dvlasenk@redhat.com, dave.hansen@linux.intel.com, qiaowei.ren@intel.com, luto@amacapital.net Reply-To: dvlasenk@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, luto@amacapital.net, qiaowei.ren@intel.com, linux-kernel@vger.kernel.org, peterz@infradead.org, masami.hiramatsu.pt@hitachi.com, acme@redhat.com, adrian.hunter@intel.com, tglx@linutronix.de, jolsa@redhat.com, mingo@kernel.org In-Reply-To: <1441196131-20632-7-git-send-email-adrian.hunter@intel.com> References: <1441196131-20632-7-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] x86/insn: perf tools: Add new memory protection keys instructions Git-Commit-ID: 978260cdbec3e34a3dfb2277ffc0aa1809457362 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 978260cdbec3e34a3dfb2277ffc0aa1809457362 Gitweb: http://git.kernel.org/tip/978260cdbec3e34a3dfb2277ffc0aa1809457362 Author: Adrian Hunter AuthorDate: Wed, 2 Sep 2015 15:15:30 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 4 Sep 2015 12:01:03 -0300 x86/insn: perf tools: Add new memory protection keys instructions Add rdpkru and wrpkru to the op code map and the perf tools new instructions test. In the case of the test, only the bytes can be tested at the moment since binutils doesn't support the instructions yet. To run the test: $ tools/perf/perf test "x86 ins" 39: Test x86 instruction decoder - new instructions : Ok Or to see the details: $ tools/perf/perf test -v "x86 ins" 2>&1 | grep pkru For information about rdpkru and wrpkru, refer the Intel SDM. Signed-off-by: Adrian Hunter Acked-by: Masami Hiramatsu Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Dave Hansen Cc: Denys Vlasenko Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Qiaowei Ren Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1441196131-20632-7-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/perf/tests/insn-x86.c | 4 ++++ tools/perf/util/intel-pt-decoder/x86-opcode-map.txt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt index f4f0451..5a9705e 100644 --- a/arch/x86/lib/x86-opcode-map.txt +++ b/arch/x86/lib/x86-opcode-map.txt @@ -885,7 +885,7 @@ GrpTable: Grp7 2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) 3: LIDT Ms 4: SMSW Mw/Rv -5: +5: rdpkru (110),(11B) | wrpkru (111),(11B) 6: LMSW Ew 7: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B) EndTable diff --git a/tools/perf/tests/insn-x86.c b/tools/perf/tests/insn-x86.c index 0e126a0..5c49eec 100644 --- a/tools/perf/tests/insn-x86.c +++ b/tools/perf/tests/insn-x86.c @@ -17,11 +17,15 @@ struct test_data { struct test_data test_data_32[] = { #include "insn-x86-dat-32.c" + {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, + {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, {{0}, 0, 0, NULL, NULL, NULL}, }; struct test_data test_data_64[] = { #include "insn-x86-dat-64.c" + {{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"}, + {{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"}, {{0}, 0, 0, NULL, NULL, NULL}, }; diff --git a/tools/perf/util/intel-pt-decoder/x86-opcode-map.txt b/tools/perf/util/intel-pt-decoder/x86-opcode-map.txt index f4f0451..5a9705e 100644 --- a/tools/perf/util/intel-pt-decoder/x86-opcode-map.txt +++ b/tools/perf/util/intel-pt-decoder/x86-opcode-map.txt @@ -885,7 +885,7 @@ GrpTable: Grp7 2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B) 3: LIDT Ms 4: SMSW Mw/Rv -5: +5: rdpkru (110),(11B) | wrpkru (111),(11B) 6: LMSW Ew 7: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B) EndTable