Home
last modified time | relevance | path

Searched refs:insn (Results 1 – 25 of 45) sorted by relevance

12

/tools/arch/x86/lib/
Dinsn.c22 #define validate_next(t, insn, n) \ argument
23 ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr)
25 #define __get_next(t, insn) \ argument
26 ({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
28 #define __peek_nbyte_next(t, insn, n) \ argument
29 ({ t r = *(t*)((insn)->next_byte + n); r; })
31 #define get_next(t, insn) \ argument
32 ({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); })
34 #define peek_nbyte_next(t, insn, n) \ argument
35 ({ if (unlikely(!validate_next(t, insn, n))) goto err_out; __peek_nbyte_next(t, insn, n); })
[all …]
/tools/arch/x86/include/asm/
Dinsn.h23 struct insn { struct
89 extern void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64);
90 extern int insn_get_prefixes(struct insn *insn);
91 extern int insn_get_opcode(struct insn *insn);
92 extern int insn_get_modrm(struct insn *insn);
93 extern int insn_get_sib(struct insn *insn);
94 extern int insn_get_displacement(struct insn *insn);
95 extern int insn_get_immediate(struct insn *insn);
96 extern int insn_get_length(struct insn *insn);
106 extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
[all …]
/tools/objtool/
Dcheck.c26 struct instruction *insn; member
39 struct instruction *insn; in find_insn() local
41 hash_for_each_possible(file->insn_hash, insn, hash, sec_offset_hash(sec, offset)) { in find_insn()
42 if (insn->sec == sec && insn->offset == offset) in find_insn()
43 return insn; in find_insn()
50 struct instruction *insn) in next_insn_same_sec() argument
52 struct instruction *next = list_next_entry(insn, list); in next_insn_same_sec()
54 if (!next || &next->list == &file->insn_list || next->sec != insn->sec) in next_insn_same_sec()
61 struct instruction *insn) in next_insn_same_func() argument
63 struct instruction *next = list_next_entry(insn, list); in next_insn_same_func()
[all …]
Dcheck.h73 static inline bool is_static_jump(struct instruction *insn) in is_static_jump() argument
75 return insn->type == INSN_JUMP_CONDITIONAL || in is_static_jump()
76 insn->type == INSN_JUMP_UNCONDITIONAL; in is_static_jump()
79 static inline bool is_dynamic_jump(struct instruction *insn) in is_dynamic_jump() argument
81 return insn->type == INSN_JUMP_DYNAMIC || in is_dynamic_jump()
82 insn->type == INSN_JUMP_DYNAMIC_CONDITIONAL; in is_dynamic_jump()
85 static inline bool is_jump(struct instruction *insn) in is_jump() argument
87 return is_static_jump(insn) || is_dynamic_jump(insn); in is_jump()
93 #define for_each_insn(file, insn) \ argument
94 list_for_each_entry(insn, &file->insn_list, list)
[all …]
Dorc_gen.c16 struct instruction *insn) in init_orc_entry() argument
62 insn->sec, insn->offset, cfi->cfa.base); in init_orc_entry()
78 insn->sec, insn->offset, bp->base); in init_orc_entry()
157 struct instruction *insn; in orc_create() local
163 sec_for_each_insn(file, sec, insn) { in orc_create()
164 struct alt_group *alt_group = insn->alt_group; in orc_create()
168 if (init_orc_entry(&orc, insn->cfi, insn)) in orc_create()
173 insn->offset)) in orc_create()
193 if (init_orc_entry(&orc, cfi, insn)) in orc_create()
197 if (orc_list_add(&orc_list, &orc, insn->sec, in orc_create()
[all …]
Dspecial.h37 struct instruction *insn,
40 struct instruction *insn);
Dwarn.h55 #define BT_FUNC(format, insn, ...) \ argument
57 struct instruction *_insn = (insn); \
/tools/perf/util/intel-pt-decoder/
Dintel-pt-insn-decoder.c27 static void intel_pt_insn_decoder(struct insn *insn, in intel_pt_insn_decoder() argument
36 if (insn_is_avx(insn)) { in intel_pt_insn_decoder()
39 intel_pt_insn->length = insn->length; in intel_pt_insn_decoder()
43 switch (insn->opcode.bytes[0]) { in intel_pt_insn_decoder()
45 switch (insn->opcode.bytes[1]) { in intel_pt_insn_decoder()
109 ext = (insn->modrm.bytes[0] >> 3) & 0x7; in intel_pt_insn_decoder()
131 intel_pt_insn->length = insn->length; in intel_pt_insn_decoder()
136 switch (insn->immediate.nbytes) { in intel_pt_insn_decoder()
138 intel_pt_insn->rel = insn->immediate.value; in intel_pt_insn_decoder()
142 bswap_16((short)insn->immediate.value); in intel_pt_insn_decoder()
[all …]
DBuild1 perf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-d…
3 inat_tables_script = $(srctree)/tools/arch/x86/tools/gen-insn-attr-x86.awk
12 $(OUTPUT)util/intel-pt-decoder/intel-pt-insn-decoder.o: util/intel-pt-decoder/intel-pt-insn-decoder…
16 CFLAGS_intel-pt-insn-decoder.o += -I$(OUTPUT)util/intel-pt-decoder
19 CFLAGS_intel-pt-insn-decoder.o += -Wno-override-init
/tools/perf/arch/x86/util/
Darchinsn.c13 struct insn insn; in arch_fetch_insn() local
19 len = thread__memcpy(thread, machine, sample->insn, sample->ip, sizeof(sample->insn), &is64bit); in arch_fetch_insn()
22 insn_init(&insn, sample->insn, len, is64bit); in arch_fetch_insn()
23 insn_get_length(&insn); in arch_fetch_insn()
24 if (insn_complete(&insn) && insn.length <= len) in arch_fetch_insn()
25 sample->insn_len = insn.length; in arch_fetch_insn()
/tools/perf/arch/x86/tests/
Dgen-insn-x86-dat.sh20 gcc -g -c insn-x86-dat-src.c
22 objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-64.c
24 rm -f insn-x86-dat-src.o
28 gcc -g -c -m32 insn-x86-dat-src.c
30 objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-32.c
32 rm -f insn-x86-dat-src.o
Dinsn-x86.c98 struct insn insn; in test_data_item() local
101 insn_init(&insn, dat->data, MAX_INSN_SIZE, x86_64); in test_data_item()
102 insn_get_length(&insn); in test_data_item()
104 if (!insn_complete(&insn)) { in test_data_item()
109 if (insn.length != dat->expected_length) { in test_data_item()
111 insn.length, dat->expected_length, dat->asm_rep); in test_data_item()
/tools/arch/s390/include/uapi/asm/
Dsie.h230 #define INSN_DECODE_IPA0(ipa0, insn, rshift, mask) \ argument
231 (insn >> 56) == (ipa0) ? \
232 ((ipa0 << 8) | ((insn >> rshift) & mask)) :
234 #define INSN_DECODE(insn) (insn >> 56) argument
241 #define icpt_insn_decoder(insn) ( \ argument
242 INSN_DECODE_IPA0(0x01, insn, 48, 0xff) \
243 INSN_DECODE_IPA0(0xaa, insn, 48, 0x0f) \
244 INSN_DECODE_IPA0(0xb2, insn, 48, 0xff) \
245 INSN_DECODE_IPA0(0xb9, insn, 48, 0xff) \
246 INSN_DECODE_IPA0(0xe3, insn, 48, 0xff) \
[all …]
/tools/bpf/bpftool/
Dxlated_dumper.c141 const struct bpf_insn *insn) in print_call_pcrel() argument
146 "%+d", insn->off); in print_call_pcrel()
149 "%+d#%s", insn->off, sym->name); in print_call_pcrel()
152 "%+d#0x%lx", insn->off, address); in print_call_pcrel()
170 const struct bpf_insn *insn) in print_call() argument
173 unsigned long address = dd->address_call_base + insn->imm; in print_call()
176 if (insn->src_reg == BPF_PSEUDO_CALL && in print_call()
177 (__u32) insn->imm < dd->nr_jited_ksyms && dd->jited_ksyms) in print_call()
178 address = dd->jited_ksyms[insn->imm]; in print_call()
181 if (insn->src_reg == BPF_PSEUDO_CALL) in print_call()
[all …]
Dcfg.c63 static struct func_node *cfg_append_func(struct cfg *cfg, struct bpf_insn *insn) in cfg_append_func() argument
68 if (func->start == insn) in cfg_append_func()
70 else if (func->start > insn) in cfg_append_func()
80 new_func->start = insn; in cfg_append_func()
89 struct bpf_insn *insn) in func_append_bb() argument
94 if (bb->head == insn) in func_append_bb()
96 else if (bb->head > insn) in func_append_bb()
106 new_bb->head = insn; in func_append_bb()
244 struct bpf_insn *insn) in func_search_bb_with_head() argument
249 if (bb->head == insn) in func_search_bb_with_head()
[all …]
/tools/objtool/arch/x86/
Dspecial.c42 struct instruction *insn, in arch_support_alt_relocation() argument
50 return insn->offset == special_alt->new_off && in arch_support_alt_relocation()
51 (insn->type == INSN_CALL || is_jump(insn)); in arch_support_alt_relocation()
95 struct instruction *insn) in arch_find_switch_table() argument
102 text_reloc = find_reloc_by_dest_range(file->elf, insn->sec, in arch_find_switch_table()
103 insn->offset, insn->len); in arch_find_switch_table()
Ddecode.c77 unsigned long arch_jump_destination(struct instruction *insn) in arch_jump_destination() argument
79 return insn->offset + insn->len + insn->immediate; in arch_jump_destination()
93 struct insn insn; in arch_decode_instruction() local
105 insn_init(&insn, sec->data->d_buf + offset, maxlen, x86_64); in arch_decode_instruction()
106 insn_get_length(&insn); in arch_decode_instruction()
108 if (!insn_complete(&insn)) { in arch_decode_instruction()
113 *len = insn.length; in arch_decode_instruction()
116 if (insn.vex_prefix.nbytes) in arch_decode_instruction()
119 op1 = insn.opcode.bytes[0]; in arch_decode_instruction()
120 op2 = insn.opcode.bytes[1]; in arch_decode_instruction()
[all …]
/tools/testing/selftests/bpf/
Dtest_verifier.c142 struct bpf_insn *insn = self->fill_insns; in bpf_fill_ld_abs_vlan_push_pop() local
145 insn[i++] = BPF_MOV64_REG(BPF_REG_6, BPF_REG_1); in bpf_fill_ld_abs_vlan_push_pop()
148 insn[i++] = BPF_LD_ABS(BPF_B, 0); in bpf_fill_ld_abs_vlan_push_pop()
150 insn[i] = BPF_JMP32_IMM(BPF_JNE, BPF_REG_0, 0x34, len - i - 3); in bpf_fill_ld_abs_vlan_push_pop()
152 insn[i++] = BPF_MOV64_REG(BPF_REG_1, BPF_REG_6); in bpf_fill_ld_abs_vlan_push_pop()
153 insn[i++] = BPF_MOV64_IMM(BPF_REG_2, 1); in bpf_fill_ld_abs_vlan_push_pop()
154 insn[i++] = BPF_MOV64_IMM(BPF_REG_3, 2); in bpf_fill_ld_abs_vlan_push_pop()
155 insn[i++] = BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, in bpf_fill_ld_abs_vlan_push_pop()
157 insn[i] = BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, len - i - 3); in bpf_fill_ld_abs_vlan_push_pop()
162 insn[i++] = BPF_LD_ABS(BPF_B, 0); in bpf_fill_ld_abs_vlan_push_pop()
[all …]
/tools/testing/selftests/powerpc/primitives/
Dload_unaligned_zeropad.c65 int insn; member
77 unsigned long insn, fixup; in segv_handler() local
79 insn = (unsigned long)&entry->insn + entry->insn; in segv_handler()
82 if (insn == *ip) { in segv_handler()
/tools/testing/selftests/arm64/fp/
Dassembler.h17 .macro _for var:req, from:req, to:req, insn:vararg
20 \insn
39 .macro define_accessor name, num, insn
41 \insn \n, 1
/tools/perf/util/
Dbpf-prologue.c328 struct bpf_insn *insn; in prologue_relocate() local
333 for (insn = pos->begin; insn < pos->pos; insn++) { in prologue_relocate()
335 u8 class = BPF_CLASS(insn->code); in prologue_relocate()
340 opcode = BPF_OP(insn->code); in prologue_relocate()
344 switch (insn->off) { in prologue_relocate()
359 insn->off = target - (insn + 1); in prologue_relocate()
/tools/perf/arch/s390/util/
Dkvm-stat.c31 unsigned long insn; in event_icpt_insn_get_key() local
33 insn = evsel__intval(evsel, sample, "instruction"); in event_icpt_insn_get_key()
34 key->key = icpt_insn_decoder(insn); in event_icpt_insn_get_key()
/tools/testing/selftests/x86/
Dtest_FCMOV.c16 #define TEST(insn) \ argument
17 long double __attribute__((noinline)) insn(long flags) \
25 " " #insn " %%st(1), %%st" "\n" \
/tools/testing/selftests/powerpc/copyloops/
Dexc_validate.c29 unsigned long insn, fixup; in segv_handler() local
31 insn = *ex_p++; in segv_handler()
34 if (insn == *ip) { in segv_handler()
/tools/lib/traceevent/plugins/
Dplugin_kvm.c25 static const char *disassemble(unsigned char *insn, int len, uint64_t rip, in disassemble() argument
44 ud_set_input_buffer(&ud, insn, len); in disassemble()
55 static const char *disassemble(unsigned char *insn, int len, uint64_t rip, in disassemble() argument
63 sprintf(out + i * 3, "%02x ", insn[i]); in disassemble()
304 uint8_t *insn; in kvm_emulate_insn_handler() local
322 insn = tep_get_field_raw(s, event, "insn", record, &llen, 1); in kvm_emulate_insn_handler()
323 if (!insn) in kvm_emulate_insn_handler()
326 disasm = disassemble(insn, len, rip, in kvm_emulate_insn_handler()

12