├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README ├── doc ├── getting_started.md ├── howto_build.md ├── howto_capture.md ├── howto_libipt.md ├── howto_pttc.md └── man │ ├── CMakeLists.txt │ ├── pt_alloc_encoder.3.md │ ├── pt_blk_alloc_decoder.3.md │ ├── pt_blk_get_offset.3.md │ ├── pt_blk_next.3.md │ ├── pt_blk_sync_forward.3.md │ ├── pt_config.3.md │ ├── pt_enc_get_config.3.md │ ├── pt_enc_get_offset.3.md │ ├── pt_image_add_file.3.md │ ├── pt_image_alloc.3.md │ ├── pt_image_remove_by_filename.3.md │ ├── pt_image_set_callback.3.md │ ├── pt_insn_alloc_decoder.3.md │ ├── pt_insn_get_image.3.md │ ├── pt_insn_get_offset.3.md │ ├── pt_insn_next.3.md │ ├── pt_insn_sync_forward.3.md │ ├── pt_iscache_add_file.3.md │ ├── pt_iscache_alloc.3.md │ ├── pt_iscache_read.3.md │ ├── pt_library_version.3.md │ ├── pt_packet.3.md │ ├── pt_pkt_alloc_decoder.3.md │ ├── pt_pkt_get_offset.3.md │ ├── pt_pkt_sync_forward.3.md │ ├── pt_qry_alloc_decoder.3.md │ ├── pt_qry_cond_branch.3.md │ ├── pt_qry_event.3.md │ ├── pt_qry_get_offset.3.md │ ├── pt_qry_sync_forward.3.md │ └── pt_qry_time.3.md ├── include ├── posix │ └── threads.h └── windows │ ├── inttypes.h │ └── threads.h ├── libipt ├── CMakeLists.txt ├── include │ └── intel-pt.h.in ├── internal │ └── include │ │ ├── posix │ │ └── pt_section_posix.h │ │ ├── pt_asid.h │ │ ├── pt_block_cache.h │ │ ├── pt_block_decoder.h │ │ ├── pt_config.h │ │ ├── pt_cpu.h │ │ ├── pt_cpuid.h │ │ ├── pt_decoder_function.h │ │ ├── pt_encoder.h │ │ ├── pt_event_queue.h │ │ ├── pt_ild.h │ │ ├── pt_image.h │ │ ├── pt_image_section_cache.h │ │ ├── pt_insn.h │ │ ├── pt_insn_decoder.h │ │ ├── pt_last_ip.h │ │ ├── pt_mapped_section.h │ │ ├── pt_packet.h │ │ ├── pt_packet_decoder.h │ │ ├── pt_query_decoder.h │ │ ├── pt_retstack.h │ │ ├── pt_section.h │ │ ├── pt_section_file.h │ │ ├── pt_sync.h │ │ ├── pt_time.h │ │ ├── pt_tnt_cache.h │ │ ├── pti-disp-defs.h │ │ ├── pti-disp.h │ │ ├── pti-imm-defs.h │ │ ├── pti-imm.h │ │ ├── pti-modrm-defs.h │ │ ├── pti-modrm.h │ │ └── windows │ │ └── pt_section_windows.h ├── src │ ├── posix │ │ ├── init.c │ │ ├── pt_cpuid.c │ │ └── pt_section_posix.c │ ├── pt_asid.c │ ├── pt_block_cache.c │ ├── pt_block_decoder.c │ ├── pt_config.c │ ├── pt_cpu.c │ ├── pt_decoder_function.c │ ├── pt_encoder.c │ ├── pt_error.c │ ├── pt_event_queue.c │ ├── pt_ild.c │ ├── pt_image.c │ ├── pt_image_section_cache.c │ ├── pt_insn.c │ ├── pt_insn_decoder.c │ ├── pt_last_ip.c │ ├── pt_packet.c │ ├── pt_packet_decoder.c │ ├── pt_query_decoder.c │ ├── pt_retstack.c │ ├── pt_section.c │ ├── pt_section_file.c │ ├── pt_sync.c │ ├── pt_time.c │ ├── pt_tnt_cache.c │ ├── pt_version.c │ └── windows │ │ ├── init.c │ │ ├── pt_cpuid.c │ │ └── pt_section_windows.c └── test │ └── src │ ├── ptunit-asid.c │ ├── ptunit-block_cache.c │ ├── ptunit-config.c │ ├── ptunit-cpp.cpp │ ├── ptunit-cpu.c │ ├── ptunit-event_queue.c │ ├── ptunit-fetch.c │ ├── ptunit-ild.c │ ├── ptunit-image.c │ ├── ptunit-image_section_cache.c │ ├── ptunit-last_ip.c │ ├── ptunit-mapped_section.c │ ├── ptunit-packet.c │ ├── ptunit-query.c │ ├── ptunit-retstack.c │ ├── ptunit-section-file.c │ ├── ptunit-section.c │ ├── ptunit-sync.c │ ├── ptunit-time.c │ └── ptunit-tnt_cache.c ├── ptdump ├── CMakeLists.txt └── src │ └── ptdump.c ├── pttc ├── CMakeLists.txt ├── include │ ├── errcode.h │ ├── file.h │ ├── parse.h │ ├── pttc.h │ ├── util.h │ └── yasm.h ├── src │ ├── errcode.c │ ├── file.c │ ├── main.c │ ├── parse.c │ ├── posix │ │ └── util.c │ ├── pttc.c │ ├── util.c │ ├── windows │ │ └── util.c │ └── yasm.c └── test │ └── src │ ├── test_all_directives.ptt │ ├── test_exp_labels.ptt │ └── test_label_addr.ptt ├── ptunit ├── CMakeLists.txt ├── include │ ├── ptunit.h │ ├── ptunit_mkfile.h │ └── ptunit_threads.h ├── src │ ├── posix │ │ └── ptunit_mkfile.c │ ├── ptunit.c │ └── windows │ │ └── ptunit_mkfile.c └── test │ └── src │ └── ptunit-selftest.c ├── ptxed ├── CMakeLists.txt ├── include │ └── load_elf.h └── src │ ├── load_elf.c │ └── ptxed.c ├── script ├── perf-read-aux.bash ├── perf-read-image.bash └── test.bash └── test ├── CMakeLists.txt └── src ├── bdm64-tip-xabort.ptt ├── bdm64-tnt-cond-xabort.ptt ├── bdm64-tnt-ind_call-xabort.ptt ├── bdm70-psb_fup-tip_pge.ptt ├── bdm70-tip_pgd-psb_fup-tip_pge.ptt ├── call_direct-ret_compressed-pic.ptt ├── call_direct-ret_compressed.ptt ├── call_direct-ret_uncompressed.ptt ├── call_indirect-ret_compressed.ptt ├── call_indirect-ret_uncompressed.ptt ├── call_indirect_deferred-ret_compressed.ptt ├── cbr-cyc.ptt ├── cbr-mtc-cyc-mtc.ptt ├── cbr-tsc-cyc-tma.ptt ├── cbr-tsc-tma-mtc-cyc.ptt ├── direct_call-tip_pgd_noip-syscall.ptt ├── direct_jump-tip_pgd_noip-far_call.ptt ├── dump-all-packets.ptt ├── fup-pip-vmcs-tip.ptt ├── fup-tip-eos.ptt ├── fup-tip-fup-tip_pgd.ptt ├── fup-tip.ptt ├── fup-tip_pgd-tip_pge.ptt ├── fup-tip_pgd-tip_pge_other_ip.ptt ├── fup-tip_pgd.ptt ├── fup-tip_pgd_noip.ptt ├── int-iret-cpl_0.ptt ├── int-iret-cpl_3.ptt ├── int-iret.ptt ├── linear-fup-tip_pgd.ptt ├── linear-tip.ptt ├── loop-tnt-64.ptt ├── loop-tnt-tnt.ptt ├── loop-tnt.ptt ├── mode_exec-tip.ptt ├── mtc-cyc_calibrate.ptt ├── mtc.ptt ├── ovf-fup.ptt ├── ovf-timing-fup.ptt ├── ovf-timing-tip_pge.ptt ├── ovf-tip_pge.ptt ├── pip-far_call.ptt ├── pip-pip_mov_cr3-fail.ptt ├── pip_mov_cr3-pip_mov_cr3.ptt ├── psb-empty.ptt ├── psb-fup-tip_pgd.ptt ├── psb-ovf-fup.ptt ├── psb-ovf-tip_pge.ptt ├── psb-pip-psb.ptt ├── psb-pip-tip_pge.ptt ├── psb-psb.ptt ├── psb-stop.ptt ├── psb-tip_pgd-stop.ptt ├── psb-tnt-psb.ptt ├── psb-tsx.ptt ├── psb-vmcs.ptt ├── psb_nofup-psb.ptt ├── ptdump-exec-mode.ptt ├── ptdump-last-ip.ptt ├── ptdump-no-offset-raw.ptt ├── ptdump-no-offset.ptt ├── ptxed-block-stat.ptt ├── ptxed-block-stat_blocks.ptt ├── ptxed-end_on_call-fup-tip_pgd.ptt ├── ptxed-end_on_call-ret_tip.ptt ├── ptxed-end_on_call-ret_tnt.ptt ├── ptxed-end_on_call-tip_pgd.ptt ├── ptxed-insn-stat.ptt ├── ptxed-stat_insn.ptt ├── ret_near_far.ptt ├── skd007.ptt ├── skd010-mode_tsx-fup.ptt ├── skd010-psb.ptt ├── skd010-tip.ptt ├── skd010-tip_pgd.ptt ├── skd022.ptt ├── syscall-sysret-cpl_0.ptt ├── syscall-sysret-cpl_3.ptt ├── syscall-sysret.ptt ├── sysenter-sysexit-cpl_0.ptt ├── sysenter-sysexit-cpl_3.ptt ├── sysenter-sysexit.ptt ├── tip-eos.ptt ├── tip_pgd-direct_call.ptt ├── tip_pgd-direct_jump.ptt ├── tip_pgd-indirect_call.ptt ├── tip_pgd-indirect_jump.ptt ├── tip_pgd-pip-tip_pge.ptt ├── tip_pgd-psb-stop.ptt ├── tip_pgd-stop.ptt ├── tip_pgd-tnt_not_taken.ptt ├── tip_pgd-tnt_taken.ptt ├── tip_pgd-tsx.ptt ├── tip_pgd_noip-far_jump.ptt ├── tip_pgd_noip-mov_cr3.ptt ├── tip_pge-fup-tip_pgd-tip_pge.ptt ├── tip_pge-fup-tip_pgd.ptt ├── tnt-tip_pgd_noip-sysret.ptt ├── tnt_n-eos.ptt ├── tnt_t-eos.ptt ├── truncated.ptt ├── tsc-cbr-cyc-tsc.ptt ├── tsc-cyc_calibrate.ptt ├── tsc-mtc-tma-mtc.ptt ├── tsc-tma-cbr-cyc-mtc.ptt ├── tsc-tma-cbr-cyc.ptt ├── tsc-tma-cbr-mtc-cyc-mtc.ptt ├── tsc-tma-cbr-mtc-cyc-no_cyc.ptt ├── tsc-tma-cbr-mtc-cyc-tsc.ptt ├── tsc-tma-cbr-mtc-cyc.ptt ├── tsc-tma-cbr-mtc-cyc_calibrate.ptt ├── tsc-tma-cbr-mtc-mtc-cyc.ptt ├── tsc-tma-cyc.ptt ├── tsc-tma-mtc-cyc_calibrate.ptt ├── tsc-tma-mtc-mtc-cyc_calibrate.ptt ├── tsc-tma-mtc-tsc.ptt ├── tsc-tma-mtc_absolute.ptt ├── tsc-tma-mtc_infreq.ptt ├── tsc-tma-mtc_infreq_wrap.ptt ├── tsc-tma-mtc_relative.ptt ├── tsc-tma-mtc_wrap.ptt ├── tsc-tma_zero_fc-cbr-cyc.ptt ├── tsc_tma_mtc_gap.ptt ├── tsx-abort.ptt ├── tsx-commit.ptt ├── tsx-no_spurious_commit.ptt └── vmcs-far_call.ptt /.gitignore: -------------------------------------------------------------------------------- 1 | *.lst 2 | *.bin 3 | *.pt 4 | *.exp 5 | *.out 6 | *.diff 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2017, Intel Corporation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | * Redistributions of source code must retain the above copyright notice, 6 | this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, 8 | this list of conditions and the following disclaimer in the documentation 9 | and/or other materials provided with the distribution. 10 | * Neither the name of Intel Corporation nor the names of its contributors 11 | may be used to endorse or promote products derived from this software 12 | without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /include/windows/inttypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | #ifndef PRId64 33 | # define PRId64 "lld" 34 | #endif 35 | #ifndef PRIu64 36 | # define PRIu64 "llu" 37 | #endif 38 | #ifndef PRIx64 39 | # define PRIx64 "llx" 40 | #endif 41 | 42 | #ifndef PRId32 43 | # define PRId32 "d" 44 | #endif 45 | #ifndef PRIu32 46 | # define PRIu32 "u" 47 | #endif 48 | #ifndef PRIx32 49 | # define PRIx32 "x" 50 | #endif 51 | 52 | #ifndef PRIu16 53 | # define PRIu16 "u" 54 | #endif 55 | 56 | #ifndef PRIu8 57 | # define PRIu8 "u" 58 | #endif 59 | #ifndef PRIx8 60 | # define PRIx8 "x" 61 | #endif 62 | 63 | #ifndef SCNx64 64 | # define SCNx64 "llx" 65 | #endif 66 | -------------------------------------------------------------------------------- /libipt/internal/include/pt_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "intel-pt.h" 30 | 31 | 32 | /* Read the configuration provided by a library user and zero-initialize 33 | * missing fields. 34 | * 35 | * We keep the user's size value if it is smaller than sizeof(*@config) to 36 | * allow decoders to detect missing configuration bits. 37 | * 38 | * Returns zero on success, a negative error code otherwise. 39 | * Returns -pte_internal if @config is NULL. 40 | * Returns -pte_invalid if @uconfig is NULL. 41 | * Returns -pte_bad_config if @config is too small to be useful. 42 | */ 43 | extern int pt_config_from_user(struct pt_config *config, 44 | const struct pt_config *uconfig); 45 | -------------------------------------------------------------------------------- /libipt/internal/include/pt_cpuid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef PT_CPUID_H 30 | #define PT_CPUID_H 31 | 32 | #include 33 | 34 | /* Execute cpuid with @leaf set in the eax register. 35 | * The result is stored in @eax, @ebx, @ecx and @edx. 36 | */ 37 | extern void pt_cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx, 38 | uint32_t *ecx, uint32_t *edx); 39 | 40 | #endif /* PT_CPUID_H */ 41 | -------------------------------------------------------------------------------- /libipt/internal/include/pti-disp-defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #if !defined(PTI_DISP_DEFS_H) 30 | #define PTI_DISP_DEFS_H 31 | 32 | #define PTI_DISP_NONE 0 33 | #define PTI_PRESERVE_DEFAULT 1 34 | #define PTI_BRDISP8 2 35 | #define PTI_DISP_BUCKET_0_l1 3 36 | #define PTI_MEMDISPv_DISP_WIDTH_ASZ_NONTERM_EASZ_l2 4 37 | #define PTI_BRDISPz_BRDISP_WIDTH_OSZ_NONTERM_EOSZ_l2 5 38 | #define PTI_RESOLVE_BYREG_DISP_map0x0_op0xc7_l1 6 39 | #endif 40 | -------------------------------------------------------------------------------- /libipt/internal/include/pti-modrm-defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #if !defined(PTI_MODRM_DEFS_H) 30 | #define PTI_MODRM_DEFS_H 31 | 32 | 33 | #define PTI_MODRM_FALSE 0 34 | #define PTI_MODRM_TRUE 1 35 | #define PTI_MODRM_IGNORE_MOD 2 36 | #define PTI_MODRM_UNDEF 3 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libipt/src/posix/init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "pt_ild.h" 30 | 31 | 32 | static void __attribute__((constructor)) init(void) 33 | { 34 | /* Initialize the Intel(R) Processor Trace instruction decoder. */ 35 | pt_ild_init(); 36 | } 37 | -------------------------------------------------------------------------------- /libipt/src/posix/pt_cpuid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "pt_cpuid.h" 30 | 31 | #include 32 | 33 | extern void pt_cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx, 34 | uint32_t *ecx, uint32_t *edx) 35 | { 36 | __get_cpuid(leaf, eax, ebx, ecx, edx); 37 | } 38 | -------------------------------------------------------------------------------- /libipt/src/pt_version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "intel-pt.h" 30 | 31 | 32 | struct pt_version pt_library_version() 33 | { 34 | struct pt_version v = { 35 | /* .major = */ PT_VERSION_MAJOR, 36 | /* .minor = */ PT_VERSION_MINOR, 37 | /* .reserved = */ 0, 38 | /* .build = */ PT_VERSION_BUILD, 39 | /* .ext = */ PT_VERSION_EXT 40 | }; 41 | 42 | return v; 43 | } 44 | -------------------------------------------------------------------------------- /libipt/src/windows/init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "pt_ild.h" 30 | 31 | #include 32 | 33 | 34 | BOOLEAN WINAPI DllMain(HINSTANCE handle, DWORD reason, LPVOID reserved) 35 | { 36 | (void) handle; 37 | (void) reserved; 38 | 39 | switch (reason) { 40 | case DLL_PROCESS_ATTACH: 41 | /* Initialize the Intel(R) Processor Trace instruction 42 | decoder. */ 43 | pt_ild_init(); 44 | break; 45 | 46 | default: 47 | break; 48 | } 49 | 50 | return TRUE; 51 | } 52 | -------------------------------------------------------------------------------- /libipt/src/windows/pt_cpuid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "pt_cpuid.h" 30 | 31 | #include 32 | 33 | extern void pt_cpuid(uint32_t leaf, uint32_t *eax, uint32_t *ebx, 34 | uint32_t *ecx, uint32_t *edx) 35 | { 36 | int cpu_info[4]; 37 | 38 | __cpuid(cpu_info, leaf); 39 | *eax = cpu_info[0]; 40 | *ebx = cpu_info[1]; 41 | *ecx = cpu_info[2]; 42 | *edx = cpu_info[3]; 43 | } 44 | -------------------------------------------------------------------------------- /ptdump/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013-2017, Intel Corporation 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # * Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # * Neither the name of Intel Corporation nor the names of its contributors 12 | # may be used to endorse or promote products derived from this software 13 | # without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | # POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include_directories( 28 | include 29 | ../libipt/internal/include 30 | ) 31 | 32 | set(PTDUMP_FILES 33 | src/ptdump.c 34 | ../libipt/src/pt_last_ip.c 35 | ../libipt/src/pt_cpu.c 36 | ../libipt/src/pt_time.c 37 | ) 38 | 39 | if (CMAKE_HOST_UNIX) 40 | set(PTDUMP_FILES ${PTDUMP_FILES} ../libipt/src/posix/pt_cpuid.c) 41 | endif (CMAKE_HOST_UNIX) 42 | 43 | if (CMAKE_HOST_WIN32) 44 | set(PTDUMP_FILES ${PTDUMP_FILES} ../libipt/src/windows/pt_cpuid.c) 45 | endif (CMAKE_HOST_WIN32) 46 | 47 | add_executable(ptdump 48 | ${PTDUMP_FILES} 49 | ) 50 | 51 | target_link_libraries(ptdump libipt) 52 | -------------------------------------------------------------------------------- /pttc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013-2017, Intel Corporation 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # * Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # * Neither the name of Intel Corporation nor the names of its contributors 12 | # may be used to endorse or promote products derived from this software 13 | # without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | # POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include_directories( 28 | include 29 | ../libipt/internal/include 30 | ) 31 | 32 | set(PTTC_FILES 33 | src/errcode.c 34 | src/file.c 35 | src/parse.c 36 | src/pttc.c 37 | src/util.c 38 | src/yasm.c 39 | ../libipt/src/pt_cpu.c 40 | ) 41 | 42 | if (CMAKE_HOST_UNIX) 43 | set(PTTC_FILES 44 | ${PTTC_FILES} 45 | src/posix/util.c 46 | ../libipt/src/posix/pt_cpuid.c 47 | ) 48 | endif (CMAKE_HOST_UNIX) 49 | 50 | if (CMAKE_HOST_WIN32) 51 | set(PTTC_FILES 52 | ${PTTC_FILES} 53 | src/windows/util.c 54 | ../libipt/src/windows/pt_cpuid.c 55 | ) 56 | endif (CMAKE_HOST_WIN32) 57 | 58 | add_executable(pttc 59 | ${PTTC_FILES} 60 | 61 | src/main.c 62 | ) 63 | 64 | target_link_libraries(pttc libipt) 65 | -------------------------------------------------------------------------------- /pttc/include/pttc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef PTTC_H 30 | #define PTTC_H 31 | 32 | #include "intel-pt.h" 33 | 34 | /* Options that are passed to pttc main. */ 35 | struct pttc_options { 36 | /* The cpu that should be used for encoding. */ 37 | struct pt_cpu cpu; 38 | 39 | /* The input .ptt file. */ 40 | const char *pttfile; 41 | }; 42 | 43 | /* Starts the parsing process with @asmfile. 44 | * 45 | * Returns 0 on success; a negative enum errcode otherwise. 46 | */ 47 | extern int pttc_main(const struct pttc_options *options); 48 | 49 | #endif /* PTTC_H */ 50 | -------------------------------------------------------------------------------- /pttc/src/posix/util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "errcode.h" 30 | #include "util.h" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | int run(const char *file, char *const argv[]) 40 | { 41 | pid_t pid; 42 | int status; 43 | 44 | if (bug_on(!file)) 45 | return -err_internal; 46 | 47 | if (bug_on(!argv)) 48 | return -err_internal; 49 | 50 | pid = fork(); 51 | 52 | if (!pid) { 53 | execvp(file, argv); 54 | perror(argv[0]); 55 | exit(1); 56 | } 57 | if (waitpid(pid, &status, 0) < 0) 58 | return -err_other; 59 | 60 | if (!WIFEXITED(status)) 61 | return -err_other; 62 | 63 | if (WEXITSTATUS(status)) 64 | return -err_run; 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /pttc/test/src/test_all_directives.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | org 0x42 28 | ; @pt psb() 29 | ; @pt psbend() 30 | ; @pt pad() 31 | ; @pt ovf() 32 | ; @pt stop() 33 | ; @pt tnt(tnnnt) 34 | ; @pt tnt64(tnntnntnntt) 35 | ; @pt tip(3: 0x1000) 36 | ; @pt tip.pge(2: 0x2000) 37 | ; @pt tip.pgd(1: 0x3000) 38 | ; @pt fup(3: 0x4000) 39 | ; @pt mode.exec(16bit) 40 | ; @pt mode.tsx(begin) 41 | ; @pt pip(0xafafaf) 42 | ; @pt pip(0xafafaf, nr) 43 | ; @pt tsc(12345) 44 | ; @pt cbr(244) 45 | ; @pt tma(0x257, 0x1cd) 46 | ; @pt mtc(0xf0) 47 | ; @pt cyc(0x3) 48 | ; @pt cyc(0xfa3) 49 | ; @pt .exp() 50 | ;line1 51 | 52 | ;line3 53 | 54 | ; line5 trailing space 55 | ; @pt .exp(extra) 56 | ;a #comment 57 | ;b 58 | ;c 59 | -------------------------------------------------------------------------------- /pttc/test/src/test_exp_labels.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | org 0x4242 28 | 29 | ; @pt p1:psb() 30 | ; @pt p2:psbend() 31 | l1: 32 | nop 33 | 34 | l2: 35 | nop 36 | 37 | l_3: nop 38 | 39 | ; @pt .exp() 40 | ;%l1 # print address of l1 41 | ;(%l1) # print address of l1 42 | ;%l1 %l2 # print address of l1 and l2 43 | ;l1 %l2 # print address of l2 44 | ;%l1 l2 # print address of l1 45 | ;%0l1 # print address of l1 zero padded 46 | ;%l2.0 # print zero 47 | ;(%l2.0) # print zero 48 | ;%l2.1 # print address of l2, only last byte. 49 | ;%l2.2 # print address of l2, only last 2 bytes. 50 | ;%0l2.2 # print address of l2, only last 2 bytes, zero padded. 51 | ;%0l2.3 # print address of l2, last 3 bytes, zero padded. 52 | 53 | ;%l_3 # print l_3 54 | 55 | ;%p1 # print packet 1 56 | ;%p2 # print packet 2 57 | 58 | ;%eos # print eos byte offset 59 | -------------------------------------------------------------------------------- /pttc/test/src/test_label_addr.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | bits 64 28 | org 0x1000 29 | l1: 30 | nop 31 | l2: 32 | -------------------------------------------------------------------------------- /ptunit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013-2017, Intel Corporation 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # * Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # * Neither the name of Intel Corporation nor the names of its contributors 12 | # may be used to endorse or promote products derived from this software 13 | # without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | # POSSIBILITY OF SUCH DAMAGE. 26 | 27 | set(PTUNIT_FILES 28 | src/ptunit.c 29 | ) 30 | 31 | if (CMAKE_HOST_UNIX) 32 | set(PTUNIT_FILES ${PTUNIT_FILES} src/posix/ptunit_mkfile.c) 33 | endif (CMAKE_HOST_UNIX) 34 | 35 | if (CMAKE_HOST_WIN32) 36 | set(PTUNIT_FILES ${PTUNIT_FILES} src/windows/ptunit_mkfile.c) 37 | endif (CMAKE_HOST_WIN32) 38 | 39 | add_library(ptunit STATIC 40 | ${PTUNIT_FILES} 41 | ) 42 | 43 | add_ptunit_c_test(selftest) 44 | -------------------------------------------------------------------------------- /ptunit/include/ptunit_mkfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef PTUNIT_MKFILE_H 30 | #define PTUNIT_MKFILE_H 31 | 32 | #include 33 | 34 | 35 | /* Create a temporary file for unit testing. 36 | * 37 | * Creates a new file and opens it with @mode. On success, provides the file 38 | * struct and file name in @file and @filename respectively. 39 | * 40 | * The @file needs to be closed and the @filename needs to be freed after use. 41 | * 42 | * Returns zero on success, a negative error code otherwise. 43 | * Returns -pte_internal if @file or @filename is NULL. 44 | * Returns -pte_nomem if @filename can't be allocated. 45 | */ 46 | int ptunit_mkfile(FILE **file, char **filename, const char *mode); 47 | 48 | #endif /* PTUNIT_MKFILE_H */ 49 | -------------------------------------------------------------------------------- /test/src/call_direct-ret_compressed.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a compressed return for a direct call 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | l1: call l4 39 | l2: jz l5 40 | l3: hlt 41 | l4: ret 42 | ; @pt p5: tnt(t.t) 43 | l5: nop 44 | ; @pt p6: fup(1: %l5) 45 | ; @pt p7: tip.pgd(0: 0) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 fup 3: %0l1 51 | ;%0p3 mode.exec cs.l 52 | ;%0p4 psbend 53 | ;%0p5 tnt.8 !! 54 | ;%0p6 fup 1: %?l5.2 55 | ;%0p7 tip.pgd 0: ???????????????? 56 | 57 | 58 | ; @pt .exp(ptxed) 59 | ;%0l1 # call l4 60 | ;%0l4 # ret 61 | ;%0l2 # jz l5 62 | ;[disabled] 63 | -------------------------------------------------------------------------------- /test/src/call_direct-ret_uncompressed.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a non-compressed return for a direct call 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | l1: call l4 39 | l2: nop 40 | l3: nop 41 | l4: ret 42 | ; @pt p5: tip(1: %l2) 43 | ; @pt p6: fup(1: %l3) 44 | ; @pt p7: tip.pgd(0: 0) 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 fup 3: %0l1 50 | ;%0p3 mode.exec cs.l 51 | ;%0p4 psbend 52 | ;%0p5 tip 1: %?l2.2 53 | ;%0p6 fup 1: %?l3.2 54 | ;%0p7 tip.pgd 0: ???????????????? 55 | 56 | 57 | ; @pt .exp(ptxed) 58 | ;%0l1 # call l4 59 | ;%0l4 # ret 60 | ;%0l2 # nop 61 | ;[disabled] 62 | -------------------------------------------------------------------------------- /test/src/call_indirect-ret_compressed.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a compressed return for an indirect call 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | l1: call rbx 39 | ; @pt p5: tip(1: %l4) 40 | l2: nop 41 | l3: hlt 42 | l4: ret 43 | ; @pt p6: tnt(t) 44 | ; @pt p7: fup(1: %l3) 45 | ; @pt p8: tip.pgd(0: 0) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 fup 3: %0l1 51 | ;%0p3 mode.exec cs.l 52 | ;%0p4 psbend 53 | ;%0p5 tip 1: %?l4.2 54 | ;%0p6 tnt.8 ! 55 | ;%0p7 fup 1: %?l3.2 56 | ;%0p8 tip.pgd 0: ???????????????? 57 | 58 | 59 | ; @pt .exp(ptxed) 60 | ;%0l1 # call rbx 61 | ;%0l4 # ret 62 | ;%0l2 # nop 63 | ;[disabled] 64 | -------------------------------------------------------------------------------- /test/src/call_indirect-ret_uncompressed.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a non-compressed return for an indirect call 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | l1: call rbx 39 | ; @pt p5: tip(1: %l4) 40 | l2: nop 41 | l3: nop 42 | l4: ret 43 | ; @pt p6: tip(1: %l2) 44 | ; @pt p7: fup(1: %l3) 45 | ; @pt p8: tip.pgd(0: 0) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 fup 3: %0l1 51 | ;%0p3 mode.exec cs.l 52 | ;%0p4 psbend 53 | ;%0p5 tip 1: %?l4.2 54 | ;%0p6 tip 1: %?l2.2 55 | ;%0p7 fup 1: %?l3.2 56 | ;%0p8 tip.pgd 0: ???????????????? 57 | 58 | 59 | ; @pt .exp(ptxed) 60 | ;%0l1 # call rbx 61 | ;%0l4 # ret 62 | ;%0l2 # nop 63 | ;[disabled] 64 | -------------------------------------------------------------------------------- /test/src/call_indirect_deferred-ret_compressed.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a compressed return for an indirect call with deferred tip 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | l1: call rbx 39 | ; tip deferred 40 | l2: jz l5 41 | l3: hlt 42 | l4: ret 43 | ; @pt p5: tnt(t.t) 44 | ; @pt p6: tip(1: %l4) 45 | l5: nop 46 | ; @pt p7: fup(1: %l5) 47 | ; @pt p8: tip.pgd(0: 0) 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 fup 3: %0l1 53 | ;%0p3 mode.exec cs.l 54 | ;%0p4 psbend 55 | ;%0p5 tnt.8 !! 56 | ;%0p6 tip 1: %?l4.2 57 | ;%0p7 fup 1: %?l5.2 58 | ;%0p8 tip.pgd 0: ???????????????? 59 | 60 | 61 | ; @pt .exp(ptxed) 62 | ;%0l1 # call rbx 63 | ;%0l4 # ret 64 | ;%0l2 # jz l5 65 | ;[disabled] 66 | -------------------------------------------------------------------------------- /test/src/cbr-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test CYC-based timing. 28 | ; 29 | ; Variant: CBR-based calibration 30 | ; 31 | ; opt:ptdump --time --time-delta --no-wall-clock 32 | ; opt:ptdump --nom-freq 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: cbr(0x2) 39 | ; @pt p3: psbend() 40 | 41 | ; @pt p4: cyc(0x3) 42 | ; @pt p5: cyc(0x1) 43 | 44 | ; @pt p6: cbr(0x1) 45 | ; @pt p7: cyc(0x2) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 cbr 2 51 | ;%0p3 psbend 52 | ;%0p4 cyc 3 tsc +6 53 | ;%0p5 cyc 1 tsc +2 54 | ;%0p6 cbr 1 55 | ;%0p7 cyc 2 tsc +8 56 | -------------------------------------------------------------------------------- /test/src/cbr-mtc-cyc-mtc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based timing. 28 | ; 29 | ; Variant: CBR-based calibration, time correction on MTC 30 | ; 31 | ; opt:ptdump --time --time-delta --no-wall-clock 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 0 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: cbr(0x2) 39 | ; @pt p3: psbend() 40 | 41 | ; @pt p4: mtc(0x2) 42 | ; @pt p5: cyc(0x3) 43 | ; @pt p6: cyc(0x1) 44 | ; @pt p7: mtc(0x3) 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 cbr 2 50 | ;%0p3 psbend 51 | ;%0p4 mtc 2 tsc +0 52 | ;%0p5 cyc 3 tsc +6 53 | ;%0p6 cyc 1 tsc +2 54 | ;%0p7 mtc 3 tsc -4 55 | -------------------------------------------------------------------------------- /test/src/cbr-tsc-cyc-tma.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, 30 | ; CYC between TSC and TMA 31 | ; 32 | ; opt:ptdump --time --time-delta 33 | ; opt:ptdump --nom-freq 1 --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 34 | 35 | org 0x100000 36 | bits 64 37 | 38 | ; @pt p1: psb() 39 | ; @pt p2: cbr(0x2) 40 | ; @pt p3: psbend() 41 | 42 | ; @pt p4: tsc(0xa0000) 43 | ; @pt p5: cyc(0x6) 44 | ; @pt p6: tma(0x102, 0x8) 45 | ; @pt p7: cyc(0x8) 46 | ; @pt p8: cyc(0x4) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 cbr 2 52 | ;%0p3 psbend 53 | ;%0p4 tsc a0000 tsc +a0000 54 | ;%0p5 cyc 6 tsc +3 55 | ;%0p6 tma 102, 8 tsc +0 56 | ;%0p7 cyc 8 tsc +4 57 | ;%0p8 cyc 4 tsc +2 58 | -------------------------------------------------------------------------------- /test/src/cbr-tsc-tma-mtc-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, CBR before TSC 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: cbr(0x2) 41 | ; @pt p4: tsc(0xa0000) 42 | ; @pt p5: tma(0x102, 0x8) 43 | ; @pt p6: mtc(0x2) 44 | ; @pt p7: cyc(0x3) 45 | ; @pt p8: cyc(0x1) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 psbend 51 | ;%0p3 cbr 2 52 | ;%0p4 tsc a0000 tsc +a0000 53 | ;%0p5 tma 102, 8 tsc +0 54 | ;%0p6 mtc 2 tsc +3f0 55 | ;%0p7 cyc 3 tsc +6 56 | ;%0p8 cyc 1 tsc +2 57 | -------------------------------------------------------------------------------- /test/src/direct_call-tip_pgd_noip-syscall.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD with suppressed IP payload is applied to the next far branch 28 | ; (syscall in this case). 29 | ; 30 | ; Variant: there's a direct call on our way to the syscall. 31 | ; test that the disable event is not applied too early. 32 | ; 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: fup(3: %l1) 39 | ; @pt p3: mode.exec(64bit) 40 | ; @pt p4: psbend() 41 | l1: call l3 42 | l2: hlt 43 | 44 | l3: syscall 45 | l4: ret 46 | ; @pt p5: tip.pgd(0: %l4) 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l1 # call l3 51 | ;%0l3 # syscall 52 | ;[disabled] 53 | 54 | 55 | ; @pt .exp(ptdump) 56 | ;%0p1 psb 57 | ;%0p2 fup 3: %0l1 58 | ;%0p3 mode.exec cs.l 59 | ;%0p4 psbend 60 | ;%0p5 tip.pgd 0: %?l4.0 61 | -------------------------------------------------------------------------------- /test/src/direct_jump-tip_pgd_noip-far_call.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD with suppressed IP payload is applied to the next far branch 28 | ; (far call in this case). 29 | ; 30 | ; Variant: there's a direct jump on our way to the far call. 31 | ; test that the disable event is not applied too early. 32 | ; 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: fup(3: %l1) 39 | ; @pt p3: mode.exec(64bit) 40 | ; @pt p4: psbend() 41 | l1: jmp l3 42 | l2: hlt 43 | 44 | l3: call far [rax] ; l5 45 | l4: hlt 46 | ; @pt p5: tip.pgd(0: %l5) 47 | 48 | l5: hlt 49 | 50 | ; @pt .exp(ptxed) 51 | ;%0l1 # jmp l3 52 | ;%0l3 # call far [rax] ; l5 53 | ;[disabled] 54 | 55 | 56 | ; @pt .exp(ptdump) 57 | ;%0p1 psb 58 | ;%0p2 fup 3: %0l1 59 | ;%0p3 mode.exec cs.l 60 | ;%0p4 psbend 61 | ;%0p5 tip.pgd 0: %?l5.0 62 | -------------------------------------------------------------------------------- /test/src/fup-tip-eos.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we indicate the end of the trace without a TIP.PGD. 28 | ; 29 | ; Variant: the trace ends after an asynchronous branch 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: nop 40 | l1: hlt 41 | 42 | ; @pt p4:fup(1: %l1) 43 | ; @pt p5:tip(1: %l2) 44 | l2: hlt 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l0 49 | ;[interrupt] 50 | ;[end of trace] 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p0 psb 54 | ;%0p1 mode.exec cs.l 55 | ;%0p2 fup 3: %0l0 56 | ;%0p3 psbend 57 | ;%0p4 fup 1: %?l1.2 58 | ;%0p5 tip 1: %?l2.2 59 | -------------------------------------------------------------------------------- /test/src/fup-tip_pgd-tip_pge.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a combination of enable and async disable on the same IP. 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: mode.exec(64bit) 35 | ; @pt p3: fup(3: %l1) 36 | ; @pt p4: psbend() 37 | l1: nop 38 | ; @pt p5: fup(1: %l1) 39 | ; @pt p6: tip.pgd(0: %l1) 40 | ; @pt p7: tip.pge(3: %l1) 41 | l2: nop 42 | ; @pt p8: fup(1: %l2) 43 | ; @pt p9: tip.pgd(0: %l3) 44 | l3: hlt 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 mode.exec cs.l 50 | ;%0p3 fup 3: %0l1 51 | ;%0p4 psbend 52 | ;%0p5 fup 1: %?l1.2 53 | ;%0p6 tip.pgd 0: %?l1.0 54 | ;%0p7 tip.pge 3: %0l1 55 | ;%0p8 fup 1: %?l2.2 56 | ;%0p9 tip.pgd 0: %?l3.0 57 | 58 | 59 | ; @pt .exp(ptxed) 60 | ;[resumed] 61 | ;%0l1 # nop 62 | ;[disabled] 63 | -------------------------------------------------------------------------------- /test/src/fup-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that FUP + TIP.PGD disables tracing as part of the asynchronous 28 | ; branch. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: nop 39 | l2: nop 40 | l3: nop 41 | ; @pt p5: fup(1: %l2) 42 | ; @pt p6: tip.pgd(3: %l3) 43 | 44 | 45 | ; @pt .exp(ptxed) 46 | ;%0l1 # nop 47 | ;[disabled] 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 fup 3: %0l1 53 | ;%0p3 mode.exec cs.l 54 | ;%0p4 psbend 55 | ;%0p5 fup 1: %?l2.2 56 | ;%0p6 tip.pgd 3: %?l3 57 | -------------------------------------------------------------------------------- /test/src/fup-tip_pgd_noip.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that FUP + TIP.PGD disables tracing as part of the asynchronous 28 | ; branch (with suppressed TIP.PGD payload in this case). 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: nop 39 | l2: nop 40 | l3: nop 41 | ; @pt p5: fup(1: %l2) 42 | ; @pt p6: tip.pgd(0: %l3) 43 | 44 | 45 | ; @pt .exp(ptxed) 46 | ;%0l1 # nop 47 | ;[disabled] 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 fup 3: %0l1 53 | ;%0p3 mode.exec cs.l 54 | ;%0p4 psbend 55 | ;%0p5 fup 1: %?l2.2 56 | ;%0p6 tip.pgd 0: %?l3.0 57 | -------------------------------------------------------------------------------- /test/src/int-iret-cpl_0.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that an INT followed by an IRET are decoded correctly. 28 | ; 29 | ; Variant: cpl 3 filtered out 30 | ; 31 | 32 | org 0x100000 33 | bits 64 34 | ; @pt p1: psb() 35 | ; @pt p2: mode.exec(64bit) 36 | ; @pt p3: psbend() 37 | 38 | ; @pt p4: tip.pge(3: %l5) 39 | 40 | l1: int 42 41 | l2: nop 42 | l3: nop 43 | l4: hlt 44 | 45 | l5: nop 46 | l6: iret 47 | l7: hlt 48 | 49 | ; @pt p5: tip.pgd(0: %l2) 50 | 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p1 psb 54 | ;%0p2 mode.exec cs.l 55 | ;%0p3 psbend 56 | ;%0p4 tip.pge 3: %0l5 57 | ;%0p5 tip.pgd 0: %?l2.0 58 | 59 | ; @pt .exp(ptxed) 60 | ;[enabled] 61 | ;%0l5 # nop 62 | ;%0l6 # iret 63 | ;[disabled] 64 | -------------------------------------------------------------------------------- /test/src/linear-fup-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test a rather long linear trace. To keep the test file small, we only check 28 | ; the number of instructions. 29 | ; 30 | ; opt:ptxed --quiet --stat --stat:insn 31 | ; 32 | ; Variant: linear trace ends with disabled event. 33 | ; 34 | 35 | org 0x100000 36 | bits 64 37 | 38 | ; @pt p1: psb() 39 | ; @pt p2: fup(3: %l0) 40 | ; @pt p3: mode.exec(64bit) 41 | ; @pt p4: psbend() 42 | l0: times 100000 nop 43 | 44 | l1: hlt 45 | ; @pt p5: fup(2: %l1) 46 | ; @pt p6: tip.pgd(0: %l1) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 fup 3: %?l0 52 | ;%0p3 mode.exec cs.l 53 | ;%0p4 psbend 54 | ;%0p5 fup 2: %?l1.4 55 | ;%0p6 tip.pgd 0: %?l1.0 56 | 57 | 58 | ; @pt .exp(ptxed) 59 | ;insn: 100000. 60 | -------------------------------------------------------------------------------- /test/src/mtc-cyc_calibrate.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based timing. 28 | ; 29 | ; Variant: MTC-based calibration 30 | ; 31 | ; opt:ptdump --time --time-delta --no-wall-clock 32 | ; opt:ptdump --mtc-freq 4 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: mtc(0x2) 41 | ; @pt p4: cyc(0x100) 42 | ; @pt p5: mtc(0x3) 43 | ; @pt p6: cyc(0x100) 44 | ; @pt p7: mtc(0x4) 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 psbend 50 | ;%0p3 mtc 2 tsc +0 51 | ;[%p4: calibration error: no timing information] 52 | ;[%p4: error updating time: no calibration] 53 | ;%0p4 cyc 100 tsc +0 54 | ;%0p5 mtc 3 tsc +40 55 | ;%0p6 cyc 100 tsc +40 56 | ;%0p7 mtc 4 tsc +0 57 | -------------------------------------------------------------------------------- /test/src/mtc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based timing. 28 | ; 29 | ; Variant: No calibration needed. 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal --no-wall-clock 32 | ; opt:ptdump --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: mtc(0xc1) 41 | ; @pt p4: mtc(0xc2) 42 | ; @pt p5: mtc(0xc4) 43 | 44 | 45 | ; @pt .exp(ptdump) 46 | ;%0p1 psb 47 | ;%0p2 psbend 48 | ;%0p3 mtc c1 tsc +0 49 | ;%0p4 mtc c2 tsc +400 50 | ;%0p5 mtc c4 tsc +800 51 | -------------------------------------------------------------------------------- /test/src/ovf-fup.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test packet generation overflow 28 | ; 29 | ; Variant: tracing remains enabled 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: hlt 40 | 41 | ; @pt p4: ovf() 42 | ; @pt p5: fup(3: %l1) 43 | l1: nop 44 | 45 | ; @pt p6: fup(1: %l2) 46 | ; @pt p7: tip.pgd(0: %l3) 47 | l2: nop 48 | l3: hlt 49 | 50 | 51 | ; @pt .exp(ptxed) 52 | ;[overflow] 53 | ;%0l1 54 | ;[disabled] 55 | 56 | ; @pt .exp(ptdump) 57 | ;%0p0 psb 58 | ;%0p1 mode.exec cs.l 59 | ;%0p2 fup 3: %?l0 60 | ;%0p3 psbend 61 | ;%0p4 ovf 62 | ;%0p5 fup 3: %?l1 63 | ;%0p6 fup 1: %?l2.2 64 | ;%0p7 tip.pgd 0: %?l3.0 65 | -------------------------------------------------------------------------------- /test/src/ovf-tip_pge.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test packet generation overflow 28 | ; 29 | ; Variant: tracing disabled 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(32bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: hlt 40 | 41 | ; @pt p4: ovf() 42 | ; @pt p5: mode.exec(64bit) 43 | ; @pt p6: tip.pge(3: %l1) 44 | l1: nop 45 | 46 | ; @pt p7: fup(1: %l2) 47 | ; @pt p8: tip.pgd(0: %l3) 48 | l2: nop 49 | l3: hlt 50 | 51 | 52 | ; @pt .exp(ptxed) 53 | ;[overflow] 54 | ;[enabled] 55 | ;%0l1 56 | ;[disabled] 57 | 58 | ; @pt .exp(ptdump) 59 | ;%0p0 psb 60 | ;%0p1 mode.exec cs.d 61 | ;%0p2 fup 3: %?l0 62 | ;%0p3 psbend 63 | ;%0p4 ovf 64 | ;%0p5 mode.exec cs.l 65 | ;%0p6 tip.pge 3: %?l1 66 | ;%0p7 fup 1: %?l2.2 67 | ;%0p8 tip.pgd 0: %?l3.0 68 | -------------------------------------------------------------------------------- /test/src/pip-far_call.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that PIP binds to a far branch 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: mode.exec(64bit) 35 | ; @pt p3: fup(3: %l1) 36 | ; @pt p4: psbend() 37 | l1: nop 38 | 39 | ; @pt p5: pip(0xcdcdc0) 40 | ; @pt p6: tip(3: %l4) 41 | l2: call far [rax] ; l4 42 | l3: hlt 43 | 44 | l4: nop 45 | 46 | ; @pt p7: fup(1: %l5) 47 | ; @pt p8: tip.pgd(0: %l6) 48 | l5: nop 49 | l6: hlt 50 | 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p1 psb 54 | ;%0p2 mode.exec cs.l 55 | ;%0p3 fup 3: %?l1 56 | ;%0p4 psbend 57 | ;%0p5 pip cdcdc0 cr3 0000000000cdcdc0 58 | ;%0p6 tip 3: %?l4 59 | ;%0p7 fup 1: %?l5.2 60 | ;%0p8 tip.pgd 0: %?l6.0 61 | 62 | 63 | ; @pt .exp(ptxed) 64 | ;%0l1 # nop 65 | ;%0l2 # call far [rax] # l4 66 | ;%0l4 # nop 67 | ;[disabled] 68 | -------------------------------------------------------------------------------- /test/src/pip_mov_cr3-pip_mov_cr3.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that a paging event is bound to the next MOV CR3 instruction. 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | 38 | ; @pt p5: pip(0xa000) 39 | l1: mov cr3, rax 40 | 41 | ; @pt p6: pip(0xb000) 42 | l2: mov cr3, rax 43 | 44 | ; @pt p7: fup(1: %l3) 45 | ; @pt p8: tip.pgd(0: %l4) 46 | l3: nop 47 | l4: hlt 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 fup 3: %0l1 53 | ;%0p3 mode.exec cs.l 54 | ;%0p4 psbend 55 | ;%0p5 pip a000 cr3 000000000000a000 56 | ;%0p6 pip b000 cr3 000000000000b000 57 | ;%0p7 fup 1: %?l3.2 58 | ;%0p8 tip.pgd 0: %?l4.0 59 | 60 | 61 | ; @pt .exp(ptxed) 62 | ;%0l1 # mov cr3, rax 63 | ;%0l2 # mov cr3, rax 64 | ;[disabled] 65 | -------------------------------------------------------------------------------- /test/src/psb-empty.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we do not diagnose an error for an empty trace. 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: psbend() 35 | 36 | ; yasm does not like empty files 37 | nop 38 | 39 | 40 | ; @pt .exp(ptxed) 41 | 42 | 43 | ; @pt .exp(ptdump) 44 | ;%0p1 psb 45 | ;%0p2 psbend 46 | -------------------------------------------------------------------------------- /test/src/psb-fup-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that FUP + TIP.PGD disables tracing as part of the asynchronous 28 | ; branch. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: nop 39 | l2: nop 40 | ; @pt p5: fup(1: %l1) 41 | ; @pt p6: tip.pgd(3: %l2) 42 | 43 | 44 | ; @pt .exp(ptxed) 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 fup 3: %0l1 50 | ;%0p3 mode.exec cs.l 51 | ;%0p4 psbend 52 | ;%0p5 fup 1: %?l1.2 53 | ;%0p6 tip.pgd 3: %?l2 54 | -------------------------------------------------------------------------------- /test/src/psb-ovf-fup.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test packet generation overflow 28 | ; 29 | ; Variant: tracing remains enabled, overflow during PSB+ 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: ovf() 39 | ; @pt p4: fup(3: %l1) 40 | l0: hlt 41 | l1: nop 42 | 43 | ; @pt p5: fup(1: %l2) 44 | ; @pt p6: tip.pgd(0: %l3) 45 | l2: nop 46 | l3: hlt 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;[overflow] 51 | ;%0l1 52 | ;[disabled] 53 | 54 | ; @pt .exp(ptdump) 55 | ;%0p0 psb 56 | ;%0p1 mode.exec cs.l 57 | ;%0p2 fup 3: %?l0 58 | ;%0p3 ovf 59 | ;%0p4 fup 3: %?l1 60 | ;%0p5 fup 1: %?l2.2 61 | ;%0p6 tip.pgd 0: %?l3.0 62 | -------------------------------------------------------------------------------- /test/src/psb-ovf-tip_pge.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test packet generation overflow 28 | ; 29 | ; Variant: tracing disabled, overflow during PSB+ 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(32bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: ovf() 39 | l0: hlt 40 | 41 | ; @pt p4: mode.exec(64bit) 42 | ; @pt p5: tip.pge(3: %l1) 43 | l1: nop 44 | 45 | ; @pt p6: fup(1: %l2) 46 | ; @pt p7: tip.pgd(0: %l3) 47 | l2: nop 48 | l3: hlt 49 | 50 | 51 | ; @pt .exp(ptxed) 52 | ;[overflow] 53 | ;[enabled] 54 | ;%0l1 55 | ;[disabled] 56 | 57 | ; @pt .exp(ptdump) 58 | ;%0p0 psb 59 | ;%0p1 mode.exec cs.d 60 | ;%0p2 fup 3: %?l0 61 | ;%0p3 ovf 62 | ;%0p4 mode.exec cs.l 63 | ;%0p5 tip.pge 3: %?l1 64 | ;%0p6 fup 1: %?l2.2 65 | ;%0p7 tip.pgd 0: %?l3.0 66 | -------------------------------------------------------------------------------- /test/src/psb-pip-psb.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that a PIP is processed while tracing is disabled. 28 | ; 29 | ; Variant: not enabled between two syncpoints. 30 | ; 31 | 32 | org 0x100000 33 | bits 64 34 | 35 | ; @pt p1: psb() 36 | ; @pt p2: psbend() 37 | 38 | ; @pt p3: pip(0xa00) 39 | 40 | ; @pt p4: psb() 41 | ; @pt p5: psbend() 42 | 43 | ; yasm does not like empty files 44 | nop 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 psbend 53 | ;%0p3 pip a00 cr3 0000000000000a00 54 | ;%0p4 psb 55 | ;%0p5 psbend 56 | -------------------------------------------------------------------------------- /test/src/psb-pip-tip_pge.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that a PIP is processed while tracing is disabled. 28 | ; 29 | ; Variant: not enabled at syncpoint. 30 | ; 31 | 32 | org 0x100000 33 | bits 64 34 | 35 | ; @pt p1: psb() 36 | ; @pt p2: mode.exec(64bit) 37 | ; @pt p3: psbend() 38 | 39 | ; @pt p4: pip(0xa00) 40 | ; @pt p5: tip.pge(3: %l1) 41 | l1: nop 42 | 43 | l2: nop 44 | l3: hlt 45 | ; @pt p6: fup(1: %l2) 46 | ; @pt p7: tip.pgd(0: %l3) 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;[enabled] 51 | ;%0l1 # nop 52 | ;[disabled] 53 | 54 | ; @pt .exp(ptdump) 55 | ;%0p1 psb 56 | ;%0p2 mode.exec cs.l 57 | ;%0p3 psbend 58 | ;%0p4 pip a00 cr3 0000000000000a00 59 | ;%0p5 tip.pge 3: %0l1 60 | ;%0p6 fup 1: %?l2.2 61 | ;%0p7 tip.pgd 0: %?l3.0 62 | -------------------------------------------------------------------------------- /test/src/psb-psb.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that linear code between two PSB+ is printed correctly 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: psbend() 37 | l1: nop 38 | 39 | ; @pt p5: psb() 40 | ; @pt p6: fup(3: %l2) 41 | ; @pt p7: mode.exec(64bit) 42 | ; @pt p8: psbend() 43 | 44 | ; @pt p9: fup(3: %l2) 45 | ; @pt p10: tip.pgd(0: 0) 46 | l2: nop 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l1 # nop 51 | ;[disabled] 52 | 53 | 54 | ; @pt .exp(ptdump) 55 | ;%0p1 psb 56 | ;%0p2 fup 3: %0l1 57 | ;%0p3 mode.exec cs.l 58 | ;%0p4 psbend 59 | ;%0p5 psb 60 | ;%0p6 fup 3: %0l2 61 | ;%0p7 mode.exec cs.l 62 | ;%0p8 psbend 63 | ;%0p9 fup 3: %0l2 64 | ;%0p10 tip.pgd 0: ???????????????? 65 | -------------------------------------------------------------------------------- /test/src/psb-stop.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TraceStop is applied to the same instruction as a preceding TIP.PGD. 28 | ; 29 | ; Variant: we just sync'ed. 30 | ; 31 | 32 | org 0x100000 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: psbend() 36 | ; @pt p3: stop() 37 | 38 | ; yasm does not like empty files 39 | nop 40 | 41 | ; @pt .exp(ptxed) 42 | 43 | ; @pt .exp(ptdump) 44 | ;%0p1 psb 45 | ;%0p2 psbend 46 | ;%0p3 stop 47 | -------------------------------------------------------------------------------- /test/src/psb-tip_pgd-stop.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TraceStop is applied to the same instruction as a preceding TIP.PGD. 28 | ; 29 | ; Variant: we sync'ed right at the TIP.PGD. 30 | ; 31 | 32 | org 0x100000 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: psbend() 37 | l1: nop 38 | 39 | ; @pt p4: fup(1: %l1) 40 | ; @pt p5: tip.pgd(0: %l2) 41 | ; @pt p6: stop() 42 | l2: hlt 43 | 44 | ; @pt .exp(ptxed) 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 fup 3: %0l1 49 | ;%0p3 psbend 50 | ;%0p4 fup 1: %?l1.2 51 | ;%0p5 tip.pgd 0: %?l2.0 52 | ;%0p6 stop 53 | -------------------------------------------------------------------------------- /test/src/psb-tsx.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that MODE.TSX in PSB+ is used to initialize the ptxed state. 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: fup(3: %l1) 35 | ; @pt p3: mode.exec(64bit) 36 | ; @pt p4: mode.tsx(begin) 37 | ; @pt p5: psbend() 38 | l1: nop 39 | 40 | ; @pt p6: fup(3: %l2) 41 | ; @pt p7: tip.pgd(0: 0) 42 | l2: nop 43 | 44 | 45 | ; @pt .exp(ptxed) 46 | ;? %0l1 # nop 47 | ;[disabled] 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p1 psb 52 | ;%0p2 fup 3: %0l1 53 | ;%0p3 mode.exec cs.l 54 | ;%0p4 mode.tsx intx 55 | ;%0p5 psbend 56 | ;%0p6 fup 3: %0l2 57 | ;%0p7 tip.pgd 0: ???????????????? 58 | -------------------------------------------------------------------------------- /test/src/psb-vmcs.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we print VMCS correctly 28 | ; 29 | 30 | org 0x100000 31 | 32 | ; @pt p1: psb() 33 | ; @pt p2: vmcs(0xcdcdf000) 34 | ; @pt p3: psbend() 35 | 36 | ; yasm does not like empty files 37 | nop 38 | 39 | 40 | ; @pt .exp(ptdump) 41 | ;%0p1 psb 42 | ;%0p2 vmcs cdcdf000 vmcs 00000000cdcdf000 43 | ;%0p3 psbend 44 | 45 | 46 | ; @pt .exp(ptxed) 47 | -------------------------------------------------------------------------------- /test/src/psb_nofup-psb.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that linear code between two PSB+ is printed correctly 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: psbend() 35 | nop 36 | 37 | ; @pt p3: psb() 38 | ; @pt p4: fup(3: %l2) 39 | ; @pt p5: mode.exec(64bit) 40 | ; @pt p6: psbend() 41 | l2: nop 42 | 43 | ; @pt p7: fup(3: %l3) 44 | ; @pt p8: tip.pgd(0: 0) 45 | l3: nop 46 | 47 | 48 | ; @pt .exp(ptxed) 49 | ;%0l2 # nop 50 | ;[disabled] 51 | 52 | 53 | ; @pt .exp(ptdump) 54 | ;%0p1 psb 55 | ;%0p2 psbend 56 | ;%0p3 psb 57 | ;%0p4 fup 3: %0l2 58 | ;%0p5 mode.exec cs.l 59 | ;%0p6 psbend 60 | ;%0p7 fup 3: %0l3 61 | ;%0p8 tip.pgd 0: ???????????????? 62 | -------------------------------------------------------------------------------- /test/src/ptdump-exec-mode.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptdump prints the execution mode correctly. 28 | ; 29 | ; opt:ptdump --exec-mode 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: mode.exec(64bit) 36 | ; @pt p3: mode.exec(32bit) 37 | ; @pt p4: mode.exec(16bit) 38 | ; @pt p5: psbend() 39 | 40 | 41 | ; @pt .exp(ptdump) 42 | ;%0p1 psb 43 | ;%0p2 mode.exec cs.l em 64-bit 44 | ;%0p3 mode.exec cs.d em 32-bit 45 | ;%0p4 mode.exec em 16-bit 46 | ;%0p5 psbend 47 | -------------------------------------------------------------------------------- /test/src/ptdump-last-ip.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptdump prints last-ip correctly. 28 | ; 29 | ; opt:ptdump --lastip 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p0: psb() 35 | ; @pt p1: psbend() 36 | 37 | ; @pt p2: fup(6: 0x0a00ccccddddeeee) 38 | ; @pt p3: tip(4: 0xffffeeeeffff) 39 | ; @pt p4: tip.pge(1: 0xdddd) 40 | ; @pt p5: fup(3: 0xffffddddeeee) 41 | ; @pt p6: tip.pgd(2: 0xeeeeffff) 42 | 43 | 44 | ; yasm does not like empty files 45 | nop 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p0 psb 50 | ;%0p1 psbend 51 | ;%0p2 fup 6: 0a00ccccddddeeee ip 0a00ccccddddeeee 52 | ;%0p3 tip 4: ????ffffeeeeffff ip 0a00ffffeeeeffff 53 | ;%0p4 tip.pge 1: ????????????dddd ip 0a00ffffeeeedddd 54 | ;%0p5 fup 3: ffffffffddddeeee ip ffffffffddddeeee 55 | ;%0p6 tip.pgd 2: ????????eeeeffff ip ffffffffeeeeffff 56 | -------------------------------------------------------------------------------- /test/src/ptdump-no-offset-raw.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptdump honors --no-offset 28 | ; 29 | ; Variant: the raw packet bytes are printed in the first column. 30 | ; 31 | ; opt:ptdump --no-offset --raw 32 | 33 | org 0x1000 34 | bits 64 35 | 36 | ; @pt psb() 37 | ; @pt psbend() 38 | 39 | ; yasm does not like empty files 40 | nop 41 | 42 | 43 | ; @pt .exp(ptdump) 44 | ;02820282028202820282028202820282 psb 45 | ;0223 psbend 46 | -------------------------------------------------------------------------------- /test/src/ptdump-no-offset.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptdump honors --no-offset 28 | ; 29 | ; Variant: the packet is printed inthe first column. 30 | ; 31 | ; opt:ptdump --no-offset 32 | 33 | org 0x1000 34 | bits 64 35 | 36 | ; @pt psb() 37 | ; @pt psbend() 38 | 39 | ; yasm does not like empty files 40 | nop 41 | 42 | 43 | ; @pt .exp(ptdump) 44 | ;psb 45 | ;psbend 46 | -------------------------------------------------------------------------------- /test/src/ptxed-block-stat.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptxed counts instructions and blocks correctly. 28 | ; 29 | ; opt:ptxed --block-decoder --stat 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p0: psb() 35 | ; @pt p1: mode.exec(64bit) 36 | ; @pt p2: fup(3: %l0) 37 | ; @pt p3: psbend() 38 | l0: nop 39 | l1: nop 40 | l2: nop 41 | l3: nop 42 | 43 | ; @pt p4: fup(1: %l4) 44 | ; @pt p5: tip.pgd(0: %l4) 45 | l4: hlt 46 | 47 | 48 | ; @pt .exp(ptxed) 49 | ;%0l0 50 | ;%0l1 51 | ;%0l2 52 | ;%0l3 53 | ;[disabled] 54 | ;insn: 4. 55 | ;blocks: 1. 56 | 57 | ; @pt .exp(ptdump) 58 | ;%0p0 psb 59 | ;%0p1 mode.exec cs.l 60 | ;%0p2 fup 3: %?l0 61 | ;%0p3 psbend 62 | ;%0p4 fup 1: %?l4.2 63 | ;%0p5 tip.pgd 0: %?l4.0 64 | -------------------------------------------------------------------------------- /test/src/ptxed-block-stat_blocks.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptxed counts instructions and blocks correctly. 28 | ; 29 | ; opt:ptxed --block-decoder --stat --stat:blocks 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p0: psb() 35 | ; @pt p1: mode.exec(64bit) 36 | ; @pt p2: fup(3: %l0) 37 | ; @pt p3: psbend() 38 | l0: nop 39 | l1: nop 40 | l2: nop 41 | l3: nop 42 | 43 | ; @pt p4: fup(1: %l4) 44 | ; @pt p5: tip.pgd(0: %l4) 45 | l4: hlt 46 | 47 | 48 | ; @pt .exp(ptxed) 49 | ;%0l0 50 | ;%0l1 51 | ;%0l2 52 | ;%0l3 53 | ;[disabled] 54 | ;blocks: 1. 55 | 56 | ; @pt .exp(ptdump) 57 | ;%0p0 psb 58 | ;%0p1 mode.exec cs.l 59 | ;%0p2 fup 3: %?l0 60 | ;%0p3 psbend 61 | ;%0p4 fup 1: %?l4.2 62 | ;%0p5 tip.pgd 0: %?l4.0 63 | -------------------------------------------------------------------------------- /test/src/ptxed-end_on_call-fup-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test the end-on-call block decoder option. 28 | ; 29 | ; Variant: there's an async disable event after the call. 30 | ; 31 | ; opt:ptxed --block-decoder --block:show-blocks --block:end-on-call 32 | 33 | org 0x1000 34 | bits 64 35 | 36 | ; @pt p0: psb() 37 | ; @pt p1: mode.exec(64bit) 38 | ; @pt p2: fup(3: %l0) 39 | ; @pt p3: psbend() 40 | l0: nop 41 | l1: call l3 42 | l2: hlt 43 | 44 | l3: nop 45 | 46 | ; @pt p4: fup(1: %l4) 47 | ; @pt p5: tip.pgd(0: %l4) 48 | l4: hlt 49 | 50 | 51 | ; @pt .exp(ptdump) 52 | ;%0p0 psb 53 | ;%0p1 mode.exec cs.l 54 | ;%0p2 fup 3: %?l0 55 | ;%0p3 psbend 56 | ;%0p4 fup 1: %?l4.2 57 | ;%0p5 tip.pgd 0: %?l4.0 58 | 59 | 60 | ; @pt .exp(ptxed) 61 | ;[block] 62 | ;%0l0 # nop 63 | ;%0l1 # call l3 64 | ;[block] 65 | ;%0l3 # nop 66 | ;[disabled] 67 | -------------------------------------------------------------------------------- /test/src/ptxed-end_on_call-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test the end-on-call block decoder option. 28 | ; 29 | ; Variant: there's a disable event after the call. 30 | ; 31 | ; opt:ptxed --block-decoder --block:show-blocks --block:end-on-call 32 | 33 | org 0x1000 34 | bits 64 35 | 36 | ; @pt p0: psb() 37 | ; @pt p1: mode.exec(64bit) 38 | ; @pt p2: fup(3: %l0) 39 | ; @pt p3: psbend() 40 | l0: nop 41 | l1: call l3 42 | l2: hlt 43 | 44 | l3: nop 45 | l4: ret 46 | 47 | ; @pt p4: tip.pgd(0: %l2) 48 | 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p0 psb 52 | ;%0p1 mode.exec cs.l 53 | ;%0p2 fup 3: %?l0 54 | ;%0p3 psbend 55 | ;%0p4 tip.pgd 0: %?l2.0 56 | 57 | 58 | ; @pt .exp(ptxed) 59 | ;[block] 60 | ;%0l0 # nop 61 | ;%0l1 # call l3 62 | ;[block] 63 | ;%0l3 # nop 64 | ;%0l4 # ret 65 | ;[disabled] 66 | -------------------------------------------------------------------------------- /test/src/ptxed-insn-stat.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptxed counts instructions correctly. 28 | ; 29 | ; opt:ptxed --insn-decoder --stat 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p0: psb() 35 | ; @pt p1: mode.exec(64bit) 36 | ; @pt p2: fup(3: %l0) 37 | ; @pt p3: psbend() 38 | l0: nop 39 | l1: nop 40 | l2: nop 41 | l3: nop 42 | 43 | ; @pt p4:fup(3: %l4) 44 | ; @pt p5:tip.pgd(0: %l5) 45 | l4: nop 46 | l5: hlt 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l0 51 | ;%0l1 52 | ;%0l2 53 | ;%0l3 54 | ;[disabled] 55 | ;insn: 4. 56 | 57 | ; @pt .exp(ptdump) 58 | ;%0p0 psb 59 | ;%0p1 mode.exec cs.l 60 | ;%0p2 fup 3: %0l0 61 | ;%0p3 psbend 62 | ;%0p4 fup 3: %0l4 63 | ;%0p5 tip.pgd 0: %?l5.0 64 | -------------------------------------------------------------------------------- /test/src/ptxed-stat_insn.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that ptxed counts instructions correctly. 28 | ; 29 | ; opt:ptxed --stat --stat:insn 30 | 31 | org 0x1000 32 | bits 64 33 | 34 | ; @pt p0: psb() 35 | ; @pt p1: mode.exec(64bit) 36 | ; @pt p2: fup(3: %l0) 37 | ; @pt p3: psbend() 38 | l0: nop 39 | l1: nop 40 | l2: nop 41 | l3: nop 42 | 43 | ; @pt p4:fup(3: %l4) 44 | ; @pt p5:tip.pgd(0: %l5) 45 | l4: nop 46 | l5: hlt 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l0 51 | ;%0l1 52 | ;%0l2 53 | ;%0l3 54 | ;[disabled] 55 | ;insn: 4. 56 | 57 | ; @pt .exp(ptdump) 58 | ;%0p0 psb 59 | ;%0p1 mode.exec cs.l 60 | ;%0p2 fup 3: %0l0 61 | ;%0p3 psbend 62 | ;%0p4 fup 3: %0l4 63 | ;%0p5 tip.pgd 0: %?l5.0 64 | -------------------------------------------------------------------------------- /test/src/syscall-sysret-cpl_0.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that SYSCALL followed by SYSRET are decoded correctly. 28 | ; 29 | ; Variant: cpl 3 filtered out 30 | ; 31 | 32 | org 0x100000 33 | bits 64 34 | ; @pt p1: psb() 35 | ; @pt p2: mode.exec(64bit) 36 | ; @pt p3: psbend() 37 | 38 | ; @pt p4: tip.pge(3: %l5) 39 | 40 | l1: syscall 41 | l2: nop 42 | l3: nop 43 | l4: hlt 44 | 45 | l5: nop 46 | l6: sysret 47 | l7: hlt 48 | 49 | ; @pt p5: tip.pgd(0: %l2) 50 | 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p1 psb 54 | ;%0p2 mode.exec cs.l 55 | ;%0p3 psbend 56 | ;%0p4 tip.pge 3: %0l5 57 | ;%0p5 tip.pgd 0: %?l2.0 58 | 59 | ; @pt .exp(ptxed) 60 | ;[enabled] 61 | ;%0l5 # nop 62 | ;%0l6 # sysret 63 | ;[disabled] 64 | -------------------------------------------------------------------------------- /test/src/sysenter-sysexit-cpl_0.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that SYSENTER followed by SYSEXIT are decoded correctly. 28 | ; 29 | ; Variant: cpl 3 filtered out 30 | ; 31 | 32 | org 0x100000 33 | bits 64 34 | ; @pt p1: psb() 35 | ; @pt p2: mode.exec(64bit) 36 | ; @pt p3: psbend() 37 | 38 | ; @pt p4: tip.pge(3: %l5) 39 | 40 | l1: db 0x0f, 0x34 ; sysenter 41 | l2: nop 42 | l3: nop 43 | l4: hlt 44 | 45 | l5: nop 46 | l6: db 0x0f, 0x35 ; sysexit 47 | l7: hlt 48 | 49 | ; @pt p5: tip.pgd(0: %l2) 50 | 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p1 psb 54 | ;%0p2 mode.exec cs.l 55 | ;%0p3 psbend 56 | ;%0p4 tip.pge 3: %0l5 57 | ;%0p5 tip.pgd 0: %?l2.0 58 | 59 | ; @pt .exp(ptxed) 60 | ;[enabled] 61 | ;%0l5 # nop 62 | ;%0l6 # sysexit 63 | ;[disabled] 64 | -------------------------------------------------------------------------------- /test/src/tip-eos.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we indicate the end of the trace without a TIP.PGD. 28 | ; 29 | ; Variant: the trace ends after an indirect branch 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: jmp rax 40 | l1: hlt 41 | 42 | ; @pt p4:tip(3: %l2) 43 | l2: hlt 44 | 45 | 46 | ; @pt .exp(ptxed) 47 | ;%0l0 48 | ;[end of trace] 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p0 psb 52 | ;%0p1 mode.exec cs.l 53 | ;%0p2 fup 3: %0l0 54 | ;%0p3 psbend 55 | ;%0p4 tip 3: %0l2 56 | -------------------------------------------------------------------------------- /test/src/tip_pgd-direct_call.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next direct branch (call in this case) 28 | ; whose target matches the TIP.PGD payload. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: call l3 39 | l2: hlt 40 | l3: call l5 41 | l4: hlt 42 | 43 | ; @pt p5: tip.pgd(3: %l5) 44 | l5: nop 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l1 # call l3 49 | ;%0l3 # call l5 50 | ;[disabled] 51 | 52 | 53 | ; @pt .exp(ptdump) 54 | ;%0p1 psb 55 | ;%0p2 fup 3: %0l1 56 | ;%0p3 mode.exec cs.l 57 | ;%0p4 psbend 58 | ;%0p5 tip.pgd 3: %0l5 59 | -------------------------------------------------------------------------------- /test/src/tip_pgd-direct_jump.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next direct branch (jump in this case) 28 | ; whose target matches the TIP.PGD payload. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: jmp l3 39 | l2: hlt 40 | l3: jmp l5 41 | l4: hlt 42 | 43 | ; @pt p5: tip.pgd(3: %l5) 44 | l5: nop 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l1 # jmp l3 49 | ;%0l3 # jmp l5 50 | ;[disabled] 51 | 52 | 53 | ; @pt .exp(ptdump) 54 | ;%0p1 psb 55 | ;%0p2 fup 3: %0l1 56 | ;%0p3 mode.exec cs.l 57 | ;%0p4 psbend 58 | ;%0p5 tip.pgd 3: %0l5 59 | -------------------------------------------------------------------------------- /test/src/tip_pgd-indirect_call.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next branch (call in this case) that 28 | ; would normally generate a TIP packet. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: call l3 39 | l2: hlt 40 | l3: call rax 41 | l4: hlt 42 | 43 | ; @pt p5: tip.pgd(3: %l5) 44 | l5: nop 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l1 # call l3 49 | ;%0l3 # call rax 50 | ;[disabled] 51 | 52 | 53 | ; @pt .exp(ptdump) 54 | ;%0p1 psb 55 | ;%0p2 fup 3: %0l1 56 | ;%0p3 mode.exec cs.l 57 | ;%0p4 psbend 58 | ;%0p5 tip.pgd 3: %0l5 59 | -------------------------------------------------------------------------------- /test/src/tip_pgd-indirect_jump.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next branch (jump in this case) that 28 | ; would normally generate a TIP packet. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: jmp l3 39 | l2: hlt 40 | l3: jmp rax 41 | l4: hlt 42 | 43 | ; @pt p5: tip.pgd(3: %l5) 44 | l5: nop 45 | 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l1 # jmp l3 49 | ;%0l3 # jmp rax 50 | ;[disabled] 51 | 52 | 53 | ; @pt .exp(ptdump) 54 | ;%0p1 psb 55 | ;%0p2 fup 3: %0l1 56 | ;%0p3 mode.exec cs.l 57 | ;%0p4 psbend 58 | ;%0p5 tip.pgd 3: %0l5 59 | -------------------------------------------------------------------------------- /test/src/tip_pgd-psb-stop.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TraceStop is applied to the same instruction as a preceding TIP.PGD. 28 | ; 29 | ; Variant: encountered PSB+ between TIP.PGD and TraceStop 30 | ; 31 | 32 | org 0x100000 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: nop 39 | 40 | 41 | ; @pt p5: fup(1: %l2) 42 | ; @pt p6: tip.pgd(0: %l3) 43 | l2: nop 44 | l3: hlt 45 | 46 | ; @pt p7: psb() 47 | ; @pt p8: psbend() 48 | ; @pt p9: stop() 49 | 50 | ; @pt .exp(ptxed) 51 | ;%0l1 # nop 52 | ;[disabled] 53 | ;[stopped] 54 | 55 | ; @pt .exp(ptdump) 56 | ;%0p1 psb 57 | ;%0p2 fup 3: %0l1 58 | ;%0p3 mode.exec cs.l 59 | ;%0p4 psbend 60 | ;%0p5 fup 1: %?l2.2 61 | ;%0p6 tip.pgd 0: %?l3.0 62 | ;%0p7 psb 63 | ;%0p8 psbend 64 | ;%0p9 stop 65 | -------------------------------------------------------------------------------- /test/src/tip_pgd-stop.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TraceStop is applied to the same instruction as a preceding TIP.PGD. 28 | ; 29 | ; Variant: encountered during normal tracing. 30 | ; 31 | 32 | org 0x100000 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: mode.exec(64bit) 36 | ; @pt p3: fup(3: %l1) 37 | ; @pt p4: psbend() 38 | l1: nop 39 | 40 | 41 | ; @pt p5: fup(1: %l2) 42 | ; @pt p6: tip.pgd(0: %l3) 43 | ; @pt p7: stop() 44 | l2: nop 45 | l3: hlt 46 | 47 | ; @pt .exp(ptxed) 48 | ;%0l1 # nop 49 | ;[disabled] 50 | ;[stopped] 51 | 52 | ; @pt .exp(ptdump) 53 | ;%0p1 psb 54 | ;%0p2 mode.exec cs.l 55 | ;%0p3 fup 3: %0l1 56 | ;%0p4 psbend 57 | ;%0p5 fup 1: %?l2.2 58 | ;%0p6 tip.pgd 0: %?l3.0 59 | ;%0p7 stop 60 | -------------------------------------------------------------------------------- /test/src/tip_pgd-tnt_not_taken.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next branch that would normally 28 | ; generate a TNT packet. 29 | ; 30 | ; Variant: disable on not taken. 31 | ; 32 | 33 | org 0x100000 34 | bits 64 35 | 36 | ; @pt p1: psb() 37 | ; @pt p2: fup(3: %l1) 38 | ; @pt p3: mode.exec(64bit) 39 | ; @pt p4: psbend() 40 | l1: jle l3 41 | ; @pt p5: tnt(t) 42 | l2: hlt 43 | l3: jle l5 44 | l4: nop 45 | l5: hlt 46 | ; @pt p6: tip.pgd(3: %l4) 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l1 # jle l3 51 | ;%0l3 # jle l5 52 | ;[disabled] 53 | 54 | 55 | ; @pt .exp(ptdump) 56 | ;%0p1 psb 57 | ;%0p2 fup 3: %0l1 58 | ;%0p3 mode.exec cs.l 59 | ;%0p4 psbend 60 | ;%0p5 tnt.8 ! 61 | ;%0p6 tip.pgd 3: %0l4 62 | -------------------------------------------------------------------------------- /test/src/tip_pgd-tnt_taken.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD is applied to the next branch that would normally 28 | ; generate a TNT packet. 29 | ; 30 | ; Variant: disable on taken. 31 | ; 32 | 33 | org 0x100000 34 | bits 64 35 | 36 | ; @pt p1: psb() 37 | ; @pt p2: fup(3: %l1) 38 | ; @pt p3: mode.exec(64bit) 39 | ; @pt p4: psbend() 40 | l1: jle l3 41 | ; @pt p5: tnt(t) 42 | l2: hlt 43 | l3: jle l5 44 | l4: hlt 45 | l5: nop 46 | ; @pt p6: tip.pgd(3: %l5) 47 | 48 | 49 | ; @pt .exp(ptxed) 50 | ;%0l1 # jle l3 51 | ;%0l3 # jle l5 52 | ;[disabled] 53 | 54 | 55 | ; @pt .exp(ptdump) 56 | ;%0p1 psb 57 | ;%0p2 fup 3: %0l1 58 | ;%0p3 mode.exec cs.l 59 | ;%0p4 psbend 60 | ;%0p5 tnt.8 ! 61 | ;%0p6 tip.pgd 3: %0l5 62 | -------------------------------------------------------------------------------- /test/src/tip_pgd_noip-far_jump.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD with suppressed IP payload is applied to the next far branch 28 | ; (far jump in this case). 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | l1: jmp far [rax] ; l3 39 | l2: hlt 40 | ; @pt p5: tip.pgd(0: %l3) 41 | 42 | l3: hlt 43 | 44 | ; @pt .exp(ptxed) 45 | ;%0l1 # jmp far [rax] ; l3 46 | ;[disabled] 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 fup 3: %0l1 52 | ;%0p3 mode.exec cs.l 53 | ;%0p4 psbend 54 | ;%0p5 tip.pgd 0: %?l3.0 55 | -------------------------------------------------------------------------------- /test/src/tip_pgd_noip-mov_cr3.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that TIP.PGD with suppressed IP payload is applied to the next 28 | ; MOV CR3 instruction. 29 | ; 30 | 31 | org 0x100000 32 | bits 64 33 | 34 | ; @pt p1: psb() 35 | ; @pt p2: fup(3: %l1) 36 | ; @pt p3: mode.exec(64bit) 37 | ; @pt p4: psbend() 38 | 39 | l1: mov cr3, rax 40 | l2: hlt 41 | ; @pt p5: tip.pgd(0: %l2) 42 | 43 | 44 | ; @pt .exp(ptxed) 45 | ;%0l1 # mov cr3, rax 46 | ;[disabled] 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 fup 3: %0l1 52 | ;%0p3 mode.exec cs.l 53 | ;%0p4 psbend 54 | ;%0p5 tip.pgd 0: %?l2.0 55 | -------------------------------------------------------------------------------- /test/src/tip_pge-fup-tip_pgd.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2013-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test enable and async disable around a single instruction. 28 | ; 29 | 30 | org 0x100000 31 | bits 64 32 | 33 | ; @pt p1: psb() 34 | ; @pt p2: mode.exec(64bit) 35 | ; @pt p3: psbend() 36 | ; @pt p4: tip.pge(3: %l1) 37 | l1: nop 38 | l2: nop 39 | ; @pt p5: fup(1: %l2) 40 | ; @pt p6: tip.pgd(0: %l3) 41 | l3: hlt 42 | 43 | 44 | ; @pt .exp(ptdump) 45 | ;%0p1 psb 46 | ;%0p2 mode.exec cs.l 47 | ;%0p3 psbend 48 | ;%0p4 tip.pge 3: %0l1 49 | ;%0p5 fup 1: %?l2.2 50 | ;%0p6 tip.pgd 0: %?l3.0 51 | 52 | 53 | ; @pt .exp(ptxed) 54 | ;[enabled] 55 | ;%0l1 # nop 56 | ;[disabled] 57 | -------------------------------------------------------------------------------- /test/src/tnt_n-eos.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we indicate the end of the trace without a TIP.PGD. 28 | ; 29 | ; Variant: the trace ends after a non-taken conditional branch 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: je l2 40 | l1: hlt 41 | 42 | ; @pt p4:tnt(n) 43 | l2: hlt 44 | 45 | 46 | ; @pt .exp(ptxed) 47 | ;%0l0 48 | ;[end of trace] 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p0 psb 52 | ;%0p1 mode.exec cs.l 53 | ;%0p2 fup 3: %0l0 54 | ;%0p3 psbend 55 | ;%0p4 tnt.8 . 56 | -------------------------------------------------------------------------------- /test/src/tnt_t-eos.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test that we indicate the end of the trace without a TIP.PGD. 28 | ; 29 | ; Variant: the trace ends after a taken conditional branch 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: je l2 40 | l1: hlt 41 | 42 | ; @pt p4:tnt(t) 43 | l2: hlt 44 | 45 | 46 | ; @pt .exp(ptxed) 47 | ;%0l0 48 | ;[end of trace] 49 | 50 | ; @pt .exp(ptdump) 51 | ;%0p0 psb 52 | ;%0p1 mode.exec cs.l 53 | ;%0p2 fup 3: %0l0 54 | ;%0p3 psbend 55 | ;%0p4 tnt.8 ! 56 | -------------------------------------------------------------------------------- /test/src/truncated.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test an instruction crossing section boundaries. 28 | ; 29 | ; opt:ptxed --raw truncated.bin:0x2:0x1002 30 | ; 31 | 32 | org 0x1000 33 | bits 64 34 | 35 | ; @pt p0: psb() 36 | ; @pt p1: mode.exec(64bit) 37 | ; @pt p2: fup(3: %l0) 38 | ; @pt p3: psbend() 39 | l0: nop 40 | 41 | l1: jmp l3 42 | l2: hlt 43 | 44 | l3: nop 45 | 46 | ; @pt p4: fup(1: %l4) 47 | ; @pt p5: tip.pgd(0: %l4) 48 | l4: hlt 49 | 50 | 51 | ; @pt .exp(ptxed) 52 | ;%0l0 # nop 53 | ;%0l1 # jmp l3 54 | ;%0l3 # nop 55 | ;[disabled] 56 | 57 | ; @pt .exp(ptdump) 58 | ;%0p0 psb 59 | ;%0p1 mode.exec cs.l 60 | ;%0p2 fup 3: %?l0 61 | ;%0p3 psbend 62 | ;%0p4 fup 1: %?l4.2 63 | ;%0p5 tip.pgd 0: %?l4.0 64 | -------------------------------------------------------------------------------- /test/src/tsc-cbr-cyc-tsc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, time correction on TSC 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --nom-freq 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: tsc(0xa0000) 39 | ; @pt p3: cbr(0x2) 40 | ; @pt p4: psbend() 41 | 42 | ; @pt p5: cyc(0x3) 43 | ; @pt p6: cyc(0x1) 44 | 45 | ; @pt p7: tsc(0xa0007) 46 | ; @pt p8: cyc(0x2) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 tsc a0000 tsc +a0000 52 | ;%0p3 cbr 2 53 | ;%0p4 psbend 54 | ;%0p5 cyc 3 tsc +6 55 | ;%0p6 cyc 1 tsc +2 56 | ;%0p7 tsc a0007 tsc -1 57 | ;%0p8 cyc 2 tsc +4 58 | -------------------------------------------------------------------------------- /test/src/tsc-mtc-tma-mtc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: MTC between TSC and TMA are ignored 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal 32 | ; opt:ptdump --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: mtc(0xc1) 42 | ; @pt p5: tma(0xc2d2, 0xe) 43 | ; @pt p6: mtc(0xc3) 44 | 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 psbend 49 | ;%0p3 tsc a0000 tsc +a0000 50 | ;%0p4 mtc c1 tsc +0 51 | ;%0p5 tma c2d2, e tsc +0 52 | ;%0p6 mtc c3 tsc +aa 53 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-cyc-mtc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, 30 | ; CYC between TMA and MTC, time corrected on MTC 31 | ; 32 | ; opt:ptdump --time --time-delta 33 | ; opt:ptdump --nom-freq 4 --mtc-freq 4 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 1 34 | 35 | org 0x100000 36 | bits 64 37 | 38 | ; @pt p1: psb() 39 | ; @pt p2: psbend() 40 | 41 | ; @pt p3: tsc(0xa0000) 42 | ; @pt p4: tma(0x12, 0x4) 43 | ; @pt p5: cbr(0x2) 44 | ; @pt p6: cyc(0x3) 45 | ; @pt p7: cyc(0x1) 46 | ; @pt p8: mtc(0x2) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0000 tsc +a0000 53 | ;%0p4 tma 12, 4 tsc +0 54 | ;%0p5 cbr 2 55 | ;%0p6 cyc 3 tsc +6 56 | ;%0p7 cyc 1 tsc +2 57 | ;%0p8 mtc 2 tsc -5 58 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, 30 | ; CYC between TMA and MTC (not shown) 31 | ; 32 | ; opt:ptdump --time --time-delta 33 | ; opt:ptdump --nom-freq 4 --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 34 | 35 | org 0x100000 36 | bits 64 37 | 38 | ; @pt p1: psb() 39 | ; @pt p2: psbend() 40 | 41 | ; @pt p3: tsc(0xa0000) 42 | ; @pt p4: tma(0x102, 0x8) 43 | ; @pt p5: cbr(0x2) 44 | ; @pt p6: cyc(0x3) 45 | ; @pt p7: cyc(0x1) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 psbend 51 | ;%0p3 tsc a0000 tsc +a0000 52 | ;%0p4 tma 102, 8 tsc +0 53 | ;%0p5 cbr 2 54 | ;%0p6 cyc 3 tsc +6 55 | ;%0p7 cyc 1 tsc +2 56 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-mtc-cyc-mtc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, time correction on MTC 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 0 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xf01, 0x1) 42 | ; @pt p5: cbr(0x2) 43 | ; @pt p6: mtc(0x2) 44 | ; @pt p7: cyc(0x3) 45 | ; @pt p8: cyc(0x1) 46 | ; @pt p9: mtc(0x3) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0000 tsc +a0000 53 | ;%0p4 tma f01, 1 tsc +0 54 | ;%0p5 cbr 2 55 | ;%0p6 mtc 2 tsc +3 56 | ;%0p7 cyc 3 tsc +6 57 | ;%0p8 cyc 1 tsc +2 58 | ;%0p9 mtc 3 tsc -4 59 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-mtc-cyc-no_cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2015-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: Ignore CYC packets. 30 | ; 31 | ; opt:ptdump --time --time-delta --no-cyc 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 0 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xf01, 0x1) 42 | ; @pt p5: cbr(0x2) 43 | ; @pt p6: mtc(0x2) 44 | ; @pt p7: cyc(0x3) 45 | ; @pt p8: cyc(0x1) 46 | ; @pt p9: mtc(0x3) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0000 tsc +a0000 53 | ;%0p4 tma f01, 1 tsc +0 54 | ;%0p5 cbr 2 55 | ;%0p6 mtc 2 tsc +3 56 | ;%0p9 mtc 3 tsc +4 57 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-mtc-cyc-tsc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, time correction on TSC 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 0 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xf01, 0x1) 42 | ; @pt p5: cbr(0x2) 43 | ; @pt p6: mtc(0x2) 44 | ; @pt p7: cyc(0x3) 45 | ; @pt p8: cyc(0x1) 46 | ; @pt p9: tsc(0xa0008) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0000 tsc +a0000 53 | ;%0p4 tma f01, 1 tsc +0 54 | ;%0p5 cbr 2 55 | ;%0p6 mtc 2 tsc +3 56 | ;%0p7 cyc 3 tsc +6 57 | ;%0p8 cyc 1 tsc +2 58 | ;%0p9 tsc a0008 tsc -3 59 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cbr-mtc-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --nom-freq 4 --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0x102, 0x8) 42 | ; @pt p5: cbr(0x2) 43 | ; @pt p6: mtc(0x2) 44 | ; @pt p7: cyc(0x3) 45 | ; @pt p8: cyc(0x1) 46 | 47 | 48 | ; @pt .exp(ptdump) 49 | ;%0p1 psb 50 | ;%0p2 psbend 51 | ;%0p3 tsc a0000 tsc +a0000 52 | ;%0p4 tma 102, 8 tsc +0 53 | ;%0p5 cbr 2 54 | ;%0p6 mtc 2 tsc +3f0 55 | ;%0p7 cyc 3 tsc +6 56 | ;%0p8 cyc 1 tsc +2 57 | -------------------------------------------------------------------------------- /test/src/tsc-tma-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: No calibration. 30 | ; 31 | ; opt:ptdump --time --time-delta 32 | ; opt:ptdump --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0x102, 0x8) 42 | ; @pt p5: cyc(0x3) 43 | 44 | 45 | ; @pt .exp(ptdump) 46 | ;%0p1 psb 47 | ;%0p2 psbend 48 | ;%0p3 tsc a0000 tsc +a0000 49 | ;%0p4 tma 102, 8 tsc +0 50 | ;[%p5: calibration error: no timing information] 51 | ;[%p5: error updating time: no calibration] 52 | ;%0p5 cyc 3 tsc +0 53 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc-tsc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: time correction on TSC 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal 32 | ; opt:ptdump --mtc-freq 4 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 1 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xf012, 0x6) 42 | ; @pt p5: mtc(0x2) 43 | ; @pt p6: mtc(0x3) 44 | ; @pt p7: tsc(0xa0008) 45 | 46 | 47 | ; @pt .exp(ptdump) 48 | ;%0p1 psb 49 | ;%0p2 psbend 50 | ;%0p3 tsc a0000 tsc +a0000 51 | ;%0p4 tma f012, 6 tsc +0 52 | ;%0p5 mtc 2 tsc +1 53 | ;%0p6 mtc 3 tsc +8 54 | ;%0p7 tsc a0008 tsc -1 55 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc_absolute.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: time displayed as absolute number 30 | ; 31 | ; opt:ptdump --time --no-tcal 32 | ; opt:ptdump --mtc-freq 0 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 1 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xff08, 0x1) 42 | ; @pt p5: mtc(0x9) 43 | ; @pt p6: mtc(0xa) 44 | 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 psbend 49 | ;%0p3 tsc a0000 tsc 00000000000a0000 50 | ;%0p4 tma ff08, 1 tsc 00000000000a0000 51 | ;%0p5 mtc 9 tsc 00000000000a0000 52 | ;%0p6 mtc a tsc 00000000000a0001 53 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc_infreq.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: low MTC frequency 30 | ; 31 | ; the MTC frequency is too low for TMA to provide the full CTC 32 | ; estimate the missing bits using the next MTC 33 | ; 34 | ; opt:ptdump --time --no-tcal 35 | ; opt:ptdump --mtc-freq 12 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 1 36 | 37 | org 0x100000 38 | bits 64 39 | 40 | ; @pt p1: psb() 41 | ; @pt p2: psbend() 42 | 43 | ; @pt p3: tsc(0xa0018) 44 | ; @pt p4: tma(0xe020, 0x8) 45 | ; @pt p5: mtc(0xaf) 46 | ; @pt p6: mtc(0xb0) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0018 tsc 00000000000a0018 53 | ;%0p4 tma e020, 8 tsc 00000000000a0018 54 | ;%0p5 mtc af tsc 00000000000a0800 55 | ;%0p6 mtc b0 tsc 00000000000a1000 56 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc_infreq_wrap.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: low MTC frequency, wrap CTC 30 | ; 31 | ; the MTC frequency is too low for TMA to provide the full CTC 32 | ; estimate the missing bits using the next MTC 33 | ; 34 | ; opt:ptdump --time --no-tcal 35 | ; opt:ptdump --mtc-freq 12 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 1 36 | 37 | org 0x100000 38 | bits 64 39 | 40 | ; @pt p1: psb() 41 | ; @pt p2: psbend() 42 | 43 | ; @pt p3: tsc(0xa0018) 44 | ; @pt p4: tma(0xf020, 0x8) 45 | ; @pt p5: mtc(0xa0) 46 | ; @pt p6: mtc(0xa1) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0018 tsc 00000000000a0018 53 | ;%0p4 tma f020, 8 tsc 00000000000a0018 54 | ;%0p5 mtc a0 tsc 00000000000a0800 55 | ;%0p6 mtc a1 tsc 00000000000a1000 56 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc_relative.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: time displayed as delta 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal 32 | ; opt:ptdump --mtc-freq 4 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 1 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0xf012, 0x6) 42 | ; @pt p5: mtc(0x2) 43 | ; @pt p6: mtc(0x3) 44 | 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 psbend 49 | ;%0p3 tsc a0000 tsc +a0000 50 | ;%0p4 tma f012, 6 tsc +0 51 | ;%0p5 mtc 2 tsc +1 52 | ;%0p6 mtc 3 tsc +8 53 | -------------------------------------------------------------------------------- /test/src/tsc-tma-mtc_wrap.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: wrap the CTC counter in MTC 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal 32 | ; opt:ptdump --mtc-freq 0 --cpuid-0x15.eax 3 --cpuid-0x15.ebx 9 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0x1fff, 0x1) 42 | ; @pt p5: mtc(0x0) 43 | ; @pt p6: mtc(0x1) 44 | 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 psbend 49 | ;%0p3 tsc a0000 tsc +a0000 50 | ;%0p4 tma 1fff, 1 tsc +0 51 | ;%0p5 mtc 0 tsc +2 52 | ;%0p6 mtc 1 tsc +3 53 | -------------------------------------------------------------------------------- /test/src/tsc-tma_zero_fc-cbr-cyc.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2016-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC and CYC-based TSC estimation. 28 | ; 29 | ; Variant: CBR-based calibration, 30 | ; CYC between TMA and MTC (not shown) 31 | ; TMA provides an FC of zero (which triggers CYC adjustment) 32 | ; 33 | ; opt:ptdump --time --time-delta 34 | ; opt:ptdump --nom-freq 4 --mtc-freq 8 --cpuid-0x15.eax 1 --cpuid-0x15.ebx 4 35 | 36 | org 0x100000 37 | bits 64 38 | 39 | ; @pt p1: psb() 40 | ; @pt p2: psbend() 41 | 42 | ; @pt p3: tsc(0xa0000) 43 | ; @pt p4: tma(0x102, 0) 44 | ; @pt p5: cbr(0x2) 45 | ; @pt p6: cyc(0x3) 46 | ; @pt p7: cyc(0x1) 47 | 48 | 49 | ; @pt .exp(ptdump) 50 | ;%0p1 psb 51 | ;%0p2 psbend 52 | ;%0p3 tsc a0000 tsc +a0000 53 | ;%0p4 tma 102, 0 tsc +0 54 | ;%0p5 cbr 2 55 | ;%0p6 cyc 3 tsc +6 56 | ;%0p7 cyc 1 tsc +2 57 | -------------------------------------------------------------------------------- /test/src/tsc_tma_mtc_gap.ptt: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2014-2017, Intel Corporation 2 | ; 3 | ; Redistribution and use in source and binary forms, with or without 4 | ; modification, are permitted provided that the following conditions are met: 5 | ; 6 | ; * Redistributions of source code must retain the above copyright notice, 7 | ; this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright notice, 9 | ; this list of conditions and the following disclaimer in the documentation 10 | ; and/or other materials provided with the distribution. 11 | ; * Neither the name of Intel Corporation nor the names of its contributors 12 | ; may be used to endorse or promote products derived from this software 13 | ; without specific prior written permission. 14 | ; 15 | ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19 | ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | ; POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ; Test MTC-based TSC estimation. 28 | ; 29 | ; Variant: omit some MTC 30 | ; 31 | ; opt:ptdump --time --time-delta --no-tcal 32 | ; opt:ptdump --mtc-freq 0 --cpuid-0x15.eax 2 --cpuid-0x15.ebx 8 33 | 34 | org 0x100000 35 | bits 64 36 | 37 | ; @pt p1: psb() 38 | ; @pt p2: psbend() 39 | 40 | ; @pt p3: tsc(0xa0000) 41 | ; @pt p4: tma(0x1, 0x4) 42 | ; @pt p5: mtc(0x4) 43 | ; @pt p6: mtc(0xa) 44 | 45 | 46 | ; @pt .exp(ptdump) 47 | ;%0p1 psb 48 | ;%0p2 psbend 49 | ;%0p3 tsc a0000 tsc +a0000 50 | ;%0p4 tma 1, 4 tsc +0 51 | ;%0p5 mtc 4 tsc +8 52 | ;%0p6 mtc a tsc +18 53 | --------------------------------------------------------------------------------