Skip to content

Commit 978260c

Browse files
ahunter6acmel
authored andcommitted
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 <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Qiaowei Ren <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ac1c885 commit 978260c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

arch/x86/lib/x86-opcode-map.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ GrpTable: Grp7
885885
2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B)
886886
3: LIDT Ms
887887
4: SMSW Mw/Rv
888-
5:
888+
5: rdpkru (110),(11B) | wrpkru (111),(11B)
889889
6: LMSW Ew
890890
7: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B)
891891
EndTable

tools/perf/tests/insn-x86.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ struct test_data {
1717

1818
struct test_data test_data_32[] = {
1919
#include "insn-x86-dat-32.c"
20+
{{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"},
21+
{{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"},
2022
{{0}, 0, 0, NULL, NULL, NULL},
2123
};
2224

2325
struct test_data test_data_64[] = {
2426
#include "insn-x86-dat-64.c"
27+
{{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"},
28+
{{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"},
2529
{{0}, 0, 0, NULL, NULL, NULL},
2630
};
2731

tools/perf/util/intel-pt-decoder/x86-opcode-map.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ GrpTable: Grp7
885885
2: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B) | VMFUNC (100),(11B) | XEND (101)(11B) | XTEST (110)(11B)
886886
3: LIDT Ms
887887
4: SMSW Mw/Rv
888-
5:
888+
5: rdpkru (110),(11B) | wrpkru (111),(11B)
889889
6: LMSW Ew
890890
7: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B)
891891
EndTable

0 commit comments

Comments
 (0)