/kernel/linux/linux-5.10/arch/x86/lib/ |
D | insn.c | 22 #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 …]
|
D | insn-eval.c | 38 static bool is_string_insn(struct insn *insn) in is_string_insn() argument 40 insn_get_opcode(insn); in is_string_insn() 43 if (insn->opcode.nbytes != 1) in is_string_insn() 46 switch (insn->opcode.bytes[0]) { in is_string_insn() 64 bool insn_has_rep_prefix(struct insn *insn) in insn_has_rep_prefix() argument 69 insn_get_prefixes(insn); in insn_has_rep_prefix() 71 for_each_insn_prefix(insn, i, p) { in insn_has_rep_prefix() 93 static int get_seg_reg_override_idx(struct insn *insn) in get_seg_reg_override_idx() argument 99 insn_get_prefixes(insn); in get_seg_reg_override_idx() 102 for_each_insn_prefix(insn, i, p) { in get_seg_reg_override_idx() [all …]
|
/kernel/linux/linux-5.10/tools/arch/x86/lib/ |
D | insn.c | 22 #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 …]
|
/kernel/linux/linux-5.10/tools/arch/x86/include/asm/ |
D | insn.h | 23 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 …]
|
/kernel/linux/linux-5.10/arch/x86/include/asm/ |
D | insn.h | 23 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 …]
|
/kernel/linux/linux-5.10/kernel/bpf/ |
D | disasm.c | 17 const struct bpf_insn *insn, in __func_get_name() argument 22 if (insn->src_reg != BPF_PSEUDO_CALL && in __func_get_name() 23 insn->imm >= 0 && insn->imm < __BPF_FUNC_MAX_ID && in __func_get_name() 24 func_id_str[insn->imm]) in __func_get_name() 25 return func_id_str[insn->imm]; in __func_get_name() 28 return cbs->cb_call(cbs->private_data, insn); in __func_get_name() 30 if (insn->src_reg == BPF_PSEUDO_CALL) in __func_get_name() 31 snprintf(buff, len, "%+d", insn->imm); in __func_get_name() 37 const struct bpf_insn *insn, in __func_imm_name() argument 41 return cbs->cb_imm(cbs->private_data, insn, full_imm); in __func_imm_name() [all …]
|
/kernel/linux/linux-5.10/arch/arm64/kernel/ |
D | insn.c | 49 enum aarch64_insn_encoding_class __kprobes aarch64_get_insn_class(u32 insn) in aarch64_get_insn_class() argument 51 return aarch64_insn_encoding_class[(insn >> 25) & 0xf]; in aarch64_get_insn_class() 54 bool __kprobes aarch64_insn_is_steppable_hint(u32 insn) in aarch64_insn_is_steppable_hint() argument 56 if (!aarch64_insn_is_hint(insn)) in aarch64_insn_is_steppable_hint() 59 switch (insn & 0xFE0) { in aarch64_insn_is_steppable_hint() 78 bool aarch64_insn_is_branch_imm(u32 insn) in aarch64_insn_is_branch_imm() argument 80 return (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn) || in aarch64_insn_is_branch_imm() 81 aarch64_insn_is_tbz(insn) || aarch64_insn_is_tbnz(insn) || in aarch64_insn_is_branch_imm() 82 aarch64_insn_is_cbz(insn) || aarch64_insn_is_cbnz(insn) || in aarch64_insn_is_branch_imm() 83 aarch64_insn_is_bcond(insn)); in aarch64_insn_is_branch_imm() [all …]
|
D | armv8_deprecated.c | 90 struct insn_emulation *insn = (struct insn_emulation *)data; in enable_insn_hw_mode() local 91 if (insn->ops->set_hw_mode) in enable_insn_hw_mode() 92 insn->ops->set_hw_mode(true); in enable_insn_hw_mode() 97 struct insn_emulation *insn = (struct insn_emulation *)data; in disable_insn_hw_mode() local 98 if (insn->ops->set_hw_mode) in disable_insn_hw_mode() 99 insn->ops->set_hw_mode(false); in disable_insn_hw_mode() 103 static int run_all_cpu_set_hw_mode(struct insn_emulation *insn, bool enable) in run_all_cpu_set_hw_mode() argument 105 if (!insn->ops->set_hw_mode) in run_all_cpu_set_hw_mode() 108 on_each_cpu(enable_insn_hw_mode, (void *)insn, true); in run_all_cpu_set_hw_mode() 110 on_each_cpu(disable_insn_hw_mode, (void *)insn, true); in run_all_cpu_set_hw_mode() [all …]
|
/kernel/linux/linux-5.10/tools/objtool/ |
D | check.c | 25 struct instruction *insn; member 38 struct instruction *insn; in find_insn() local 40 hash_for_each_possible(file->insn_hash, insn, hash, sec_offset_hash(sec, offset)) { in find_insn() 41 if (insn->sec == sec && insn->offset == offset) in find_insn() 42 return insn; in find_insn() 49 struct instruction *insn) in next_insn_same_sec() argument 51 struct instruction *next = list_next_entry(insn, list); in next_insn_same_sec() 53 if (!next || &next->list == &file->insn_list || next->sec != insn->sec) in next_insn_same_sec() 60 struct instruction *insn) in next_insn_same_func() argument 62 struct instruction *next = list_next_entry(insn, list); in next_insn_same_func() [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/xmon/ |
D | spu.h | 80 #define SIGNED_EXTRACT(insn,size,pos) (((int)((insn) << (32-size-pos))) >> (32-size)) argument 81 #define UNSIGNED_EXTRACT(insn,size,pos) (((insn) >> pos) & ((1 << size)-1)) argument 83 #define DECODE_INSN_RT(insn) (insn & 0x7f) argument 84 #define DECODE_INSN_RA(insn) ((insn >> 7) & 0x7f) argument 85 #define DECODE_INSN_RB(insn) ((insn >> 14) & 0x7f) argument 86 #define DECODE_INSN_RC(insn) ((insn >> 21) & 0x7f) argument 88 #define DECODE_INSN_I10(insn) SIGNED_EXTRACT(insn,10,14) argument 89 #define DECODE_INSN_U10(insn) UNSIGNED_EXTRACT(insn,10,14) argument 92 #define DECODE_INSN_I16(insn) SIGNED_EXTRACT(insn,16,7) argument 93 #define DECODE_INSN_U16(insn) UNSIGNED_EXTRACT(insn,16,7) argument [all …]
|
/kernel/linux/linux-5.10/arch/s390/tools/ |
D | gen_opcode_table.c | 22 struct insn { struct 44 struct insn *insn; argument 154 struct insn insn; in read_instructions() local 158 rc = scanf("%s %s %s", insn.opcode, insn.name, insn.format); in read_instructions() 163 insn.type = insn_format_to_type(insn.format); in read_instructions() 164 insn.name_len = strlen(insn.name); in read_instructions() 165 for (i = 0; i <= insn.name_len; i++) in read_instructions() 166 insn.upper[i] = toupper((unsigned char)insn.name[i]); in read_instructions() 168 desc->insn = realloc(desc->insn, desc->nr * sizeof(*desc->insn)); in read_instructions() 169 if (!desc->insn) in read_instructions() [all …]
|
/kernel/linux/linux-5.10/arch/riscv/kernel/ |
D | traps_misaligned.c | 85 #define INSN_LEN(insn) ((((insn) & 0x3) < 0x3) ? 2 : 4) argument 118 #define RVC_RS1S(insn) (8 + RV_X(insn, SH_RD, 3)) argument 119 #define RVC_RS2S(insn) (8 + RV_X(insn, SH_RS2C, 3)) argument 120 #define RVC_RS2(insn) RV_X(insn, SH_RS2C, 5) argument 128 #define REG_OFFSET(insn, pos) \ argument 129 (SHIFT_RIGHT((insn), (pos) - LOG_REGBYTES) & REG_MASK) 131 #define REG_PTR(insn, pos, regs) \ argument 132 (ulong *)((ulong)(regs) + REG_OFFSET(insn, pos)) 134 #define GET_RM(insn) (((insn) >> 12) & 7) argument 136 #define GET_RS1(insn, regs) (*REG_PTR(insn, SH_RS1, regs)) argument [all …]
|
/kernel/linux/linux-5.10/arch/arm/probes/kprobes/ |
D | actions-thumb.c | 24 t32_simulate_table_branch(probes_opcode_t insn, in t32_simulate_table_branch() argument 28 int rn = (insn >> 16) & 0xf; in t32_simulate_table_branch() 29 int rm = insn & 0xf; in t32_simulate_table_branch() 35 if (insn & 0x10) /* TBH */ in t32_simulate_table_branch() 44 t32_simulate_mrs(probes_opcode_t insn, in t32_simulate_mrs() argument 47 int rd = (insn >> 8) & 0xf; in t32_simulate_mrs() 53 t32_simulate_cond_branch(probes_opcode_t insn, in t32_simulate_cond_branch() argument 58 long offset = insn & 0x7ff; /* imm11 */ in t32_simulate_cond_branch() 59 offset += (insn & 0x003f0000) >> 5; /* imm6 */ in t32_simulate_cond_branch() 60 offset += (insn & 0x00002000) << 4; /* J1 */ in t32_simulate_cond_branch() [all …]
|
D | actions-common.c | 18 static void __kprobes simulate_ldm1stm1(probes_opcode_t insn, in simulate_ldm1stm1() argument 22 int rn = (insn >> 16) & 0xf; in simulate_ldm1stm1() 23 int lbit = insn & (1 << 20); in simulate_ldm1stm1() 24 int wbit = insn & (1 << 21); in simulate_ldm1stm1() 25 int ubit = insn & (1 << 23); in simulate_ldm1stm1() 26 int pbit = insn & (1 << 24); in simulate_ldm1stm1() 32 reg_bit_vector = insn & 0xffff; in simulate_ldm1stm1() 42 reg_bit_vector = insn & 0xffff; in simulate_ldm1stm1() 60 static void __kprobes simulate_stm1_pc(probes_opcode_t insn, in simulate_stm1_pc() argument 67 simulate_ldm1stm1(insn, asi, regs); in simulate_stm1_pc() [all …]
|
/kernel/linux/linux-5.10/arch/mips/kernel/ |
D | branch.c | 62 union mips_instruction insn = (union mips_instruction)dec_insn.insn; in __mm_isBranchInstr() local 68 switch (insn.mm_i_format.opcode) { in __mm_isBranchInstr() 70 if ((insn.mm_i_format.simmediate & MM_POOL32A_MINOR_MASK) == in __mm_isBranchInstr() 72 switch (insn.mm_i_format.simmediate >> in __mm_isBranchInstr() 78 if (insn.mm_i_format.rt != 0) /* Not mm_jr */ in __mm_isBranchInstr() 79 regs->regs[insn.mm_i_format.rt] = in __mm_isBranchInstr() 83 *contpc = regs->regs[insn.mm_i_format.rs]; in __mm_isBranchInstr() 89 switch (insn.mm_i_format.rt) { in __mm_isBranchInstr() 97 if ((long)regs->regs[insn.mm_i_format.rs] < 0) in __mm_isBranchInstr() 100 (insn.mm_i_format.simmediate << 1); in __mm_isBranchInstr() [all …]
|
/kernel/linux/linux-5.10/arch/sparc/kernel/ |
D | unaligned_32.c | 33 static inline enum direction decode_direction(unsigned int insn) in decode_direction() argument 35 unsigned long tmp = (insn >> 21) & 1; in decode_direction() 40 if(((insn>>19)&0x3f) == 15) in decode_direction() 48 static inline int decode_access_size(unsigned int insn) in decode_access_size() argument 50 insn = (insn >> 19) & 3; in decode_access_size() 52 if(!insn) in decode_access_size() 54 else if(insn == 3) in decode_access_size() 56 else if(insn == 2) in decode_access_size() 59 printk("Impossible unaligned trap. insn=%08x\n", insn); in decode_access_size() 66 static inline int decode_signedness(unsigned int insn) in decode_signedness() argument [all …]
|
/kernel/linux/linux-5.10/arch/arm64/kernel/probes/ |
D | decode-insn.c | 18 static bool __kprobes aarch64_insn_is_steppable(u32 insn) in aarch64_insn_is_steppable() argument 27 if (aarch64_get_insn_class(insn) == AARCH64_INSN_CLS_BR_SYS) { in aarch64_insn_is_steppable() 28 if (aarch64_insn_is_branch(insn) || in aarch64_insn_is_steppable() 29 aarch64_insn_is_msr_imm(insn) || in aarch64_insn_is_steppable() 30 aarch64_insn_is_msr_reg(insn) || in aarch64_insn_is_steppable() 31 aarch64_insn_is_exception(insn) || in aarch64_insn_is_steppable() 32 aarch64_insn_is_eret(insn) || in aarch64_insn_is_steppable() 33 aarch64_insn_is_eret_auth(insn)) in aarch64_insn_is_steppable() 41 if (aarch64_insn_is_mrs(insn)) in aarch64_insn_is_steppable() 42 return aarch64_insn_extract_system_reg(insn) in aarch64_insn_is_steppable() [all …]
|
/kernel/linux/linux-5.10/arch/csky/kernel/probes/ |
D | decode-insn.c | 19 probe_opcode_t insn = le32_to_cpu(*addr); in csky_probe_decode_insn() local 21 CSKY_INSN_SET_SIMULATE(br16, insn); in csky_probe_decode_insn() 22 CSKY_INSN_SET_SIMULATE(bt16, insn); in csky_probe_decode_insn() 23 CSKY_INSN_SET_SIMULATE(bf16, insn); in csky_probe_decode_insn() 24 CSKY_INSN_SET_SIMULATE(jmp16, insn); in csky_probe_decode_insn() 25 CSKY_INSN_SET_SIMULATE(jsr16, insn); in csky_probe_decode_insn() 26 CSKY_INSN_SET_SIMULATE(lrw16, insn); in csky_probe_decode_insn() 27 CSKY_INSN_SET_SIMULATE(pop16, insn); in csky_probe_decode_insn() 29 CSKY_INSN_SET_SIMULATE(br32, insn); in csky_probe_decode_insn() 30 CSKY_INSN_SET_SIMULATE(bt32, insn); in csky_probe_decode_insn() [all …]
|
/kernel/linux/linux-5.10/arch/s390/lib/ |
D | probes.c | 12 int probe_is_prohibited_opcode(u16 *insn) in probe_is_prohibited_opcode() argument 14 if (!is_known_insn((unsigned char *)insn)) in probe_is_prohibited_opcode() 16 switch (insn[0] >> 8) { in probe_is_prohibited_opcode() 25 switch (insn[0] & 0x0f) { in probe_is_prohibited_opcode() 30 switch (insn[0]) { in probe_is_prohibited_opcode() 46 int probe_get_fixup_type(u16 *insn) in probe_get_fixup_type() argument 51 switch (insn[0] >> 8) { in probe_get_fixup_type() 56 if ((insn[0] & 0x0f) == 0) in probe_get_fixup_type() 77 if ((insn[0] & 0xff) == 0xb2) in probe_get_fixup_type() 81 if ((insn[0] & 0x0f) == 0x05) in probe_get_fixup_type() [all …]
|
/kernel/linux/linux-5.10/drivers/staging/comedi/kcomedilib/ |
D | kcomedilib_main.c | 67 struct comedi_insn *insn, in comedi_do_insn() argument 81 if (insn->subdev >= dev->n_subdevices) { in comedi_do_insn() 85 s = &dev->subdevices[insn->subdev]; in comedi_do_insn() 89 "%d not usable subdevice\n", insn->subdev); in comedi_do_insn() 96 ret = comedi_check_chanlist(s, 1, &insn->chanspec); in comedi_do_insn() 109 switch (insn->insn) { in comedi_do_insn() 111 ret = s->insn_bits(dev, s, insn, data); in comedi_do_insn() 115 ret = s->insn_config(dev, s, insn, data); in comedi_do_insn() 132 struct comedi_insn insn; in comedi_dio_get_config() local 136 memset(&insn, 0, sizeof(insn)); in comedi_dio_get_config() [all …]
|
/kernel/linux/linux-5.10/arch/x86/kernel/kprobes/ |
D | core.c | 114 } __packed *insn; in __synthesize_relative_insn() local 116 insn = (struct __arch_relative_insn *)dest; in __synthesize_relative_insn() 117 insn->raddr = (s32)((long)(to) - ((long)(from) + 5)); in __synthesize_relative_insn() 118 insn->op = op; in __synthesize_relative_insn() 138 static kprobe_opcode_t *skip_prefixes(kprobe_opcode_t *insn) in skip_prefixes() argument 142 attr = inat_get_opcode_attribute((insn_byte_t)*insn); in skip_prefixes() 144 insn++; in skip_prefixes() 145 attr = inat_get_opcode_attribute((insn_byte_t)*insn); in skip_prefixes() 149 insn++; in skip_prefixes() 151 return insn; in skip_prefixes() [all …]
|
/kernel/linux/linux-5.10/arch/x86/tools/ |
D | insn_sanity.c | 67 static void dump_insn(FILE *fp, struct insn *insn) in dump_insn() argument 70 dump_field(fp, "prefixes", "\t", &insn->prefixes); in dump_insn() 71 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); in dump_insn() 72 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); in dump_insn() 73 dump_field(fp, "opcode", "\t", &insn->opcode); in dump_insn() 74 dump_field(fp, "modrm", "\t", &insn->modrm); in dump_insn() 75 dump_field(fp, "sib", "\t", &insn->sib); in dump_insn() 76 dump_field(fp, "displacement", "\t", &insn->displacement); in dump_insn() 77 dump_field(fp, "immediate1", "\t", &insn->immediate1); in dump_insn() 78 dump_field(fp, "immediate2", "\t", &insn->immediate2); in dump_insn() [all …]
|
D | insn_decoder_test.c | 70 static void dump_insn(FILE *fp, struct insn *insn) in dump_insn() argument 73 dump_field(fp, "prefixes", "\t", &insn->prefixes); in dump_insn() 74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); in dump_insn() 75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); in dump_insn() 76 dump_field(fp, "opcode", "\t", &insn->opcode); in dump_insn() 77 dump_field(fp, "modrm", "\t", &insn->modrm); in dump_insn() 78 dump_field(fp, "sib", "\t", &insn->sib); in dump_insn() 79 dump_field(fp, "displacement", "\t", &insn->displacement); in dump_insn() 80 dump_field(fp, "immediate1", "\t", &insn->immediate1); in dump_insn() 81 dump_field(fp, "immediate2", "\t", &insn->immediate2); in dump_insn() [all …]
|
/kernel/linux/linux-5.10/tools/perf/util/intel-pt-decoder/ |
D | intel-pt-insn-decoder.c | 27 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 …]
|
/kernel/linux/linux-5.10/arch/x86/kernel/ |
D | uprobes.c | 41 #define OPCODE1(insn) ((insn)->opcode.bytes[0]) argument 42 #define OPCODE2(insn) ((insn)->opcode.bytes[1]) argument 43 #define OPCODE3(insn) ((insn)->opcode.bytes[2]) argument 44 #define MODRM_REG(insn) X86_MODRM_REG((insn)->modrm.value) argument 256 static bool is_prefix_bad(struct insn *insn) in is_prefix_bad() argument 261 for_each_insn_prefix(insn, i, p) { in is_prefix_bad() 277 static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool x86_64) in uprobe_init_insn() argument 281 insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64); in uprobe_init_insn() 283 insn_get_length(insn); in uprobe_init_insn() 284 if (!insn_complete(insn)) in uprobe_init_insn() [all …]
|