x86/insn: perf tools: Add new ptwrite instruction
Subsystems (3)
Adrian Hunter
reviewerPATCH 1/1 x86/insn: perf tools: Add new ptwrite instruction
Add ptwrite to the op code map and the perf tools new instructions test. 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 ptwrite
For information about ptwrite, refer the Intel SDM.
--- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/objtool/arch/x86/insn/x86-opcode-map.txt | 2 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 12 +++++++++ tools/perf/arch/x86/tests/insn-x86-dat-64.c | 30 ++++++++++++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 30 ++++++++++++++++++++++ .../perf/util/intel-pt-decoder/x86-opcode-map.txt | 2 +- 6 files changed, 75 insertions(+), 3 deletions(-)
arch/x86/lib/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)
tools/objtool/arch/x86/insn/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)
tools/perf/arch/x86/tests/insn-x86-dat-32.c +12 -0
@@ -1664,3 +1664,15 @@ "0f c7 1d 78 56 34 12 \txrstors 0x12345678",}, {{0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",},
tools/perf/arch/x86/tests/insn-x86-dat-64.c +30 -0
@@ -1696,3 +1696,33 @@ "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%rax,%rcx,8)",}, {{0x41, 0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", "41 0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 48 0f ae 20 \tptwriteq (%rax)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 49 0f ae 20 \tptwriteq (%r8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae 24 25 78 56 34 12 \tptwriteq 0x12345678",}, +{{0xf3, 0x48, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 49 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%r8,%rcx,8)",},
tools/perf/arch/x86/tests/insn-x86-dat-src.c +30 -0
@@ -1343,6 +1343,26 @@ int main(void) asmvolatile ("xrstors 0x12345678(%rax,%rcx,8)" ); asmvolatile ("xrstors 0x12345678(%r8,%rcx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%rax)" ); + asmvolatile ("ptwrite (%r8)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwrite 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwritel (%rax)" ); + asmvolatile ("ptwritel (%r8)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwritel 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwriteq (%rax)" ); + asmvolatile ("ptwriteq (%r8)" ); + asmvolatile ("ptwriteq (0x12345678)" ); + asmvolatile ("ptwriteq 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwriteq 0x12345678(%r8,%rcx,8)" ); +#else /* #ifdef __x86_64__ */ /* bound r32, mem (same op code as EVEX prefix) */
@@ -2653,6 +2673,16 @@ int main(void) asmvolatile ("xrstors (0x12345678)" ); asmvolatile ("xrstors 0x12345678(%eax,%ecx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%eax)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%eax,%ecx,8)" ); + + asmvolatile ("ptwritel (%eax)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%eax,%ecx,8)" ); +#endif /* #ifndef __x86_64__ */ /* Following line is a marker for the awk script - do not change */
tools/perf/util/intel-pt-decoder/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)
Signature · 1 line
1.9.1
Quoted 12 lines · On Fri, 19 May 2017 10:50:30 +0300 Adrian Hunter <[email protected]>…
Add ptwrite to the op code map and the perf tools new instructions test. To run the test:
$ tools/perf/perf test "x86 ins" 39: Test x86 instruction decoder - new instructions : OkOr to see the details:
$ tools/perf/perf test -v "x86 ins" 2>&1 | grep ptwriteFor information about ptwrite, refer the Intel SDM.
OK, I've checked that this exists at least "March 2017" revision. (But Table A-6 is not updated... sigh)
Looks good to me.
Thank you,
Quoted 158 lines
Signed-off-by Adrian Hunter <[email protected]>--- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/objtool/arch/x86/insn/x86-opcode-map.txt | 2 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 12 +++++++++ tools/perf/arch/x86/tests/insn-x86-dat-64.c | 30 ++++++++++++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 30 ++++++++++++++++++++++ .../perf/util/intel-pt-decoder/x86-opcode-map.txt | 2 +- 6 files changed, 75 insertions(+), 3 deletions(-)arch/x86/lib/x86-opcode-map.txt +1
-1@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)tools/objtool/arch/x86/insn/x86-opcode-map.txt +1
-1@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)tools/perf/arch/x86/tests/insn-x86-dat-32.c +12
-0@@ -1664,3 +1664,15 @@ "0f c7 1d 78 56 34 12 \txrstors 0x12345678",}, {{0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",},tools/perf/arch/x86/tests/insn-x86-dat-64.c +30
-0@@ -1696,3 +1696,33 @@ "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%rax,%rcx,8)",}, {{0x41, 0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", "41 0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 48 0f ae 20 \tptwriteq (%rax)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 49 0f ae 20 \tptwriteq (%r8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae 24 25 78 56 34 12 \tptwriteq 0x12345678",}, +{{0xf3, 0x48, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 49 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%r8,%rcx,8)",},tools/perf/arch/x86/tests/insn-x86-dat-src.c +30
-0@@ -1343,6 +1343,26 @@ int main(void) asmvolatile ("xrstors 0x12345678(%rax,%rcx,8)" ); asmvolatile ("xrstors 0x12345678(%r8,%rcx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%rax)" ); + asmvolatile ("ptwrite (%r8)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwrite 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwritel (%rax)" ); + asmvolatile ("ptwritel (%r8)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwritel 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwriteq (%rax)" ); + asmvolatile ("ptwriteq (%r8)" ); + asmvolatile ("ptwriteq (0x12345678)" ); + asmvolatile ("ptwriteq 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwriteq 0x12345678(%r8,%rcx,8)" ); +#else /* #ifdef __x86_64__ */ /* bound r32, mem (same op code as EVEX prefix) */ @@ -2653,6 +2673,16 @@ int main(void) asmvolatile ("xrstors (0x12345678)" ); asmvolatile ("xrstors 0x12345678(%eax,%ecx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%eax)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%eax,%ecx,8)" ); + + asmvolatile ("ptwritel (%eax)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%eax,%ecx,8)" ); +#endif /* #ifndef __x86_64__ */ /* Following line is a marker for the awk script - do not change */ tools/perf/util/intel-pt-decoder/x86-opcode-map.txt +1
-1@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)Signature · 1 line
1.9.1
Signature · 1 line
Masami Hiramatsu <[email protected]>
Adrian Hunter
reviewerQuoted 16 lines · Masami Hiramatsu
Quoted 12 lines · On Fri, 19 May 2017 10:50:30 +0300 Adrian Hunter <[email protected]>…
Add ptwrite to the op code map and the perf tools new instructions test. To run the test:
$ tools/perf/perf test "x86 ins" 39: Test x86 instruction decoder - new instructions : OkOr to see the details:
$ tools/perf/perf test -v "x86 ins" 2>&1 | grep ptwriteFor information about ptwrite, refer the Intel SDM.
Quoted 8 lines
OK, I've checked that this exists at least "March 2017" revision. (But Table A-6 is not updated... sigh)
Looks good to me.
Acked-by Masami Hiramatsu <[email protected]>Thank you,
Arnaldo, can you take this?
Arnaldo Carvalho de Melo
maintainerEm Thu, Jun 22, 2017 at 09:37:37AM +0300, Adrian Hunter escreveu:
Quoted 20 lines · Masami Hiramatsu
Quoted 19 lines
Quoted 12 lines · On Fri, 19 May 2017 10:50:30 +0300 Adrian Hunter <[email protected]>…
Add ptwrite to the op code map and the perf tools new instructions test. To run the test:
$ tools/perf/perf test "x86 ins" 39: Test x86 instruction decoder - new instructions : OkOr to see the details:
$ tools/perf/perf test -v "x86 ins" 2>&1 | grep ptwriteFor information about ptwrite, refer the Intel SDM.
OK, I've checked that this exists at least "March 2017" revision. (But Table A-6 is not updated... sigh)
Quoted 7 lines
Quoted 5 lines
Looks good to me.
Acked-by Masami Hiramatsu <[email protected]>Thank you,
Arnaldo, can you take this?
Sure, applying to perf/core.
- Arnaldo
tip-bot for Adrian Hunter
merge botx86/insn: perf tools: Add new ptwrite instruction
Commit-ID: d5b1a5f660b8594125ea2a372286d767e756102f Gitweb: http://git.kernel.org/tip/d5b1a5f660b8594125ea2a372286d767e756102f Author: Adrian Hunter <[email protected]> AuthorDate: Fri, 19 May 2017 10:50:30 +0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 27 Jun 2017 11:58:04 -0300
x86/insn: perf tools: Add new ptwrite instruction
Add ptwrite to the op code map and the perf tools new instructions test. 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 ptwrite
For information about ptwrite, refer the Intel SDM.
--- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/objtool/arch/x86/insn/x86-opcode-map.txt | 2 +- tools/perf/arch/x86/tests/insn-x86-dat-32.c | 12 +++++++++ tools/perf/arch/x86/tests/insn-x86-dat-64.c | 30 ++++++++++++++++++++++ tools/perf/arch/x86/tests/insn-x86-dat-src.c | 30 ++++++++++++++++++++++ .../perf/util/intel-pt-decoder/x86-opcode-map.txt | 2 +- 6 files changed, 75 insertions(+), 3 deletions(-)
arch/x86/lib/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)
tools/objtool/arch/x86/insn/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)
tools/perf/arch/x86/tests/insn-x86-dat-32.c +12 -0
@@ -1664,3 +1664,15 @@ "0f c7 1d 78 56 34 12 \txrstors 0x12345678",}, {{0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%eax)",}, +{{0xf3, 0x0f, 0xae, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "", +"f3 0f ae 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%eax,%ecx,8)",},
tools/perf/arch/x86/tests/insn-x86-dat-64.c +30 -0
@@ -1696,3 +1696,33 @@ "0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%rax,%rcx,8)",}, {{0x41, 0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", "41 0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x0f, 0xae, 0x20, }, 4, 0, "", "", +"f3 0f ae 20 \tptwritel (%rax)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 41 0f ae 20 \tptwritel (%r8)",}, +{{0xf3, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae 24 25 78 56 34 12 \tptwritel 0x12345678",}, +{{0xf3, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "", +"f3 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x41, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 41 0f ae a4 c8 78 56 34 12 \tptwritel 0x12345678(%r8,%rcx,8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 48 0f ae 20 \tptwriteq (%rax)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0x20, }, 5, 0, "", "", +"f3 49 0f ae 20 \tptwriteq (%r8)",}, +{{0xf3, 0x48, 0x0f, 0xae, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae 24 25 78 56 34 12 \tptwriteq 0x12345678",}, +{{0xf3, 0x48, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 48 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%rax,%rcx,8)",}, +{{0xf3, 0x49, 0x0f, 0xae, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "", +"f3 49 0f ae a4 c8 78 56 34 12 \tptwriteq 0x12345678(%r8,%rcx,8)",},
tools/perf/arch/x86/tests/insn-x86-dat-src.c +30 -0
@@ -1343,6 +1343,26 @@ int main(void) asmvolatile ("xrstors 0x12345678(%rax,%rcx,8)" ); asmvolatile ("xrstors 0x12345678(%r8,%rcx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%rax)" ); + asmvolatile ("ptwrite (%r8)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwrite 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwritel (%rax)" ); + asmvolatile ("ptwritel (%r8)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwritel 0x12345678(%r8,%rcx,8)" ); + + asmvolatile ("ptwriteq (%rax)" ); + asmvolatile ("ptwriteq (%r8)" ); + asmvolatile ("ptwriteq (0x12345678)" ); + asmvolatile ("ptwriteq 0x12345678(%rax,%rcx,8)" ); + asmvolatile ("ptwriteq 0x12345678(%r8,%rcx,8)" ); +#else /* #ifdef __x86_64__ */ /* bound r32, mem (same op code as EVEX prefix) */
@@ -2653,6 +2673,16 @@ int main(void) asmvolatile ("xrstors (0x12345678)" ); asmvolatile ("xrstors 0x12345678(%eax,%ecx,8)" ); +/* ptwrite */ + + asmvolatile ("ptwrite (%eax)" ); + asmvolatile ("ptwrite (0x12345678)" ); + asmvolatile ("ptwrite 0x12345678(%eax,%ecx,8)" ); + + asmvolatile ("ptwritel (%eax)" ); + asmvolatile ("ptwritel (0x12345678)" ); + asmvolatile ("ptwritel 0x12345678(%eax,%ecx,8)" ); +#endif /* #ifndef __x86_64__ */ /* Following line is a marker for the awk script - do not change */
tools/perf/util/intel-pt-decoder/x86-opcode-map.txt +1 -1
@@ -1009,7 +1009,7 @@ GrpTable: Grp15 1: fxstor | RDGSBASE Ry (F3),(11B) 2: vldmxcsr Md (v1) | WRFSBASE Ry (F3),(11B) 3: vstmxcsr Md (v1) | WRGSBASE Ry (F3),(11B) -4: XSAVE +4: XSAVE | ptwrite Ey (F3),(11B) 5: XRSTOR | lfence (11B) 6: XSAVEOPT | clwb (66) | mfence (11B) 7: clflush | clflushopt (66) | sfence (11B)