/linux-5.19.10/tools/arch/x86/lib/ |
D | insn.c | 37 #define validate_next(t, insn, n) \ argument 38 ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr) 40 #define __get_next(t, insn) \ argument 41 …({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r);… 43 #define __peek_nbyte_next(t, insn, n) \ argument 44 ({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); }) 46 #define get_next(t, insn) \ argument 47 ({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); }) 49 #define peek_nbyte_next(t, insn, n) \ argument 50 ({ if (unlikely(!validate_next(t, insn, n))) goto err_out; __peek_nbyte_next(t, insn, n); }) [all …]
|
/linux-5.19.10/arch/x86/lib/ |
D | insn.c | 37 #define validate_next(t, insn, n) \ argument 38 ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr) 40 #define __get_next(t, insn) \ argument 41 …({ t r = get_unaligned((t *)(insn)->next_byte); (insn)->next_byte += sizeof(t); leXX_to_cpu(t, r);… 43 #define __peek_nbyte_next(t, insn, n) \ argument 44 ({ t r = get_unaligned((t *)(insn)->next_byte + n); leXX_to_cpu(t, r); }) 46 #define get_next(t, insn) \ argument 47 ({ if (unlikely(!validate_next(t, insn, 0))) goto err_out; __get_next(t, insn); }) 49 #define peek_nbyte_next(t, insn, n) \ argument 50 ({ 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 41 if (insn->opcode.nbytes != 1) in is_string_insn() 44 switch (insn->opcode.bytes[0]) { in is_string_insn() 62 bool insn_has_rep_prefix(struct insn *insn) in insn_has_rep_prefix() argument 67 insn_get_prefixes(insn); in insn_has_rep_prefix() 69 for_each_insn_prefix(insn, i, p) { in insn_has_rep_prefix() 91 static int get_seg_reg_override_idx(struct insn *insn) in get_seg_reg_override_idx() argument 97 insn_get_prefixes(insn); in get_seg_reg_override_idx() 100 for_each_insn_prefix(insn, i, p) { in get_seg_reg_override_idx() 154 static bool check_seg_overrides(struct insn *insn, int regoff) in check_seg_overrides() argument [all …]
|
/linux-5.19.10/kernel/bpf/ |
D | disasm.c | 17 const struct bpf_insn *insn, in __func_get_name() argument 22 if (!insn->src_reg && 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() 30 res = cbs->cb_call(cbs->private_data, insn); in __func_get_name() 35 if (insn->src_reg == BPF_PSEUDO_CALL) in __func_get_name() 36 snprintf(buff, len, "%+d", insn->imm); in __func_get_name() 37 else if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) in __func_get_name() 44 const struct bpf_insn *insn, in __func_imm_name() argument [all …]
|
/linux-5.19.10/arch/arm64/lib/ |
D | insn.c | 42 enum aarch64_insn_encoding_class __kprobes aarch64_get_insn_class(u32 insn) in aarch64_get_insn_class() argument 44 return aarch64_insn_encoding_class[(insn >> 25) & 0xf]; in aarch64_get_insn_class() 47 bool __kprobes aarch64_insn_is_steppable_hint(u32 insn) in aarch64_insn_is_steppable_hint() argument 49 if (!aarch64_insn_is_hint(insn)) in aarch64_insn_is_steppable_hint() 52 switch (insn & 0xFE0) { in aarch64_insn_is_steppable_hint() 71 bool aarch64_insn_is_branch_imm(u32 insn) in aarch64_insn_is_branch_imm() argument 73 return (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn) || in aarch64_insn_is_branch_imm() 74 aarch64_insn_is_tbz(insn) || aarch64_insn_is_tbnz(insn) || in aarch64_insn_is_branch_imm() 75 aarch64_insn_is_cbz(insn) || aarch64_insn_is_cbnz(insn) || in aarch64_insn_is_branch_imm() 76 aarch64_insn_is_bcond(insn)); in aarch64_insn_is_branch_imm() [all …]
|
/linux-5.19.10/tools/arch/x86/include/asm/ |
D | insn.h | 68 struct insn { struct 134 extern void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64); 135 extern int insn_get_prefixes(struct insn *insn); 136 extern int insn_get_opcode(struct insn *insn); 137 extern int insn_get_modrm(struct insn *insn); 138 extern int insn_get_sib(struct insn *insn); 139 extern int insn_get_displacement(struct insn *insn); 140 extern int insn_get_immediate(struct insn *insn); 141 extern int insn_get_length(struct insn *insn); 151 extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m); [all …]
|
/linux-5.19.10/arch/x86/include/asm/ |
D | insn.h | 68 struct insn { struct 134 extern void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64); 135 extern int insn_get_prefixes(struct insn *insn); 136 extern int insn_get_opcode(struct insn *insn); 137 extern int insn_get_modrm(struct insn *insn); 138 extern int insn_get_sib(struct insn *insn); 139 extern int insn_get_displacement(struct insn *insn); 140 extern int insn_get_immediate(struct insn *insn); 141 extern int insn_get_length(struct insn *insn); 151 extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m); [all …]
|
/linux-5.19.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 …]
|
/linux-5.19.10/tools/objtool/ |
D | check.c | 27 struct instruction *insn; member 40 struct instruction *insn; in find_insn() local 42 hash_for_each_possible(file->insn_hash, insn, hash, sec_offset_hash(sec, offset)) { in find_insn() 43 if (insn->sec == sec && insn->offset == offset) in find_insn() 44 return insn; in find_insn() 51 struct instruction *insn) in next_insn_same_sec() argument 53 struct instruction *next = list_next_entry(insn, list); in next_insn_same_sec() 55 if (!next || &next->list == &file->insn_list || next->sec != insn->sec) in next_insn_same_sec() 62 struct instruction *insn) in next_insn_same_func() argument 64 struct instruction *next = list_next_entry(insn, list); in next_insn_same_func() [all …]
|
/linux-5.19.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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.10/arch/riscv/kvm/ |
D | vcpu_exit.c | 64 #define INSN_IS_16BIT(insn) (((insn) & INSN_16BIT_MASK) != INSN_16BIT_MASK) argument 66 #define INSN_LEN(insn) (INSN_IS_16BIT(insn) ? 2 : 4) argument 96 #define RVC_RS1S(insn) (8 + RV_X(insn, SH_RD, 3)) argument 97 #define RVC_RS2S(insn) (8 + RV_X(insn, SH_RS2C, 3)) argument 98 #define RVC_RS2(insn) RV_X(insn, SH_RS2C, 5) argument 106 #define REG_OFFSET(insn, pos) \ argument 107 (SHIFT_RIGHT((insn), (pos) - LOG_REGBYTES) & REG_MASK) 109 #define REG_PTR(insn, pos, regs) \ argument 110 ((ulong *)((ulong)(regs) + REG_OFFSET(insn, pos))) 112 #define GET_RM(insn) (((insn) >> 12) & 7) argument [all …]
|
/linux-5.19.10/arch/sparc/kernel/ |
D | unaligned_32.c | 34 static inline enum direction decode_direction(unsigned int insn) in decode_direction() argument 36 unsigned long tmp = (insn >> 21) & 1; in decode_direction() 41 if(((insn>>19)&0x3f) == 15) in decode_direction() 49 static inline int decode_access_size(unsigned int insn) in decode_access_size() argument 51 insn = (insn >> 19) & 3; in decode_access_size() 53 if(!insn) in decode_access_size() 55 else if(insn == 3) in decode_access_size() 57 else if(insn == 2) in decode_access_size() 60 printk("Impossible unaligned trap. insn=%08x\n", insn); in decode_access_size() 67 static inline int decode_signedness(unsigned int insn) in decode_signedness() argument [all …]
|
/linux-5.19.10/drivers/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 …]
|
/linux-5.19.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 …]
|
/linux-5.19.10/arch/loongarch/kernel/ |
D | inst.c | 9 union loongarch_instruction insn; in larch_insn_gen_lu32id() local 11 insn.reg1i20_format.opcode = lu32id_op; in larch_insn_gen_lu32id() 12 insn.reg1i20_format.rd = rd; in larch_insn_gen_lu32id() 13 insn.reg1i20_format.immediate = imm; in larch_insn_gen_lu32id() 15 return insn.word; in larch_insn_gen_lu32id() 20 union loongarch_instruction insn; in larch_insn_gen_lu52id() local 22 insn.reg2i12_format.opcode = lu52id_op; in larch_insn_gen_lu52id() 23 insn.reg2i12_format.rd = rd; in larch_insn_gen_lu52id() 24 insn.reg2i12_format.rj = rj; in larch_insn_gen_lu52id() 25 insn.reg2i12_format.immediate = imm; in larch_insn_gen_lu52id() [all …]
|
/linux-5.19.10/arch/arm64/kernel/ |
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 …]
|
/linux-5.19.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 283 ret = insn_decode(insn, auprobe->insn, sizeof(auprobe->insn), m); in uprobe_init_insn() 287 if (is_prefix_bad(insn)) in uprobe_init_insn() 291 if (insn_masking_exception(insn)) in uprobe_init_insn() [all …]
|
/linux-5.19.10/arch/x86/kernel/kprobes/ |
D | core.c | 115 } __packed *insn; in __synthesize_relative_insn() local 117 insn = (struct __arch_relative_insn *)dest; in __synthesize_relative_insn() 118 insn->raddr = (s32)((long)(to) - ((long)(from) + 5)); in __synthesize_relative_insn() 119 insn->op = op; in __synthesize_relative_insn() 140 int can_boost(struct insn *insn, void *addr) in can_boost() argument 150 if (insn->opcode.nbytes == 2) in can_boost() 151 return test_bit(insn->opcode.bytes[1], in can_boost() 154 if (insn->opcode.nbytes != 1) in can_boost() 157 for_each_insn_prefix(insn, i, prefix) { in can_boost() 166 opcode = insn->opcode.bytes[0]; in can_boost() [all …]
|
/linux-5.19.10/arch/x86/tools/ |
D | insn_sanity.c | 63 static void dump_insn(FILE *fp, struct insn *insn) in dump_insn() argument 66 dump_field(fp, "prefixes", "\t", &insn->prefixes); in dump_insn() 67 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix); in dump_insn() 68 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix); in dump_insn() 69 dump_field(fp, "opcode", "\t", &insn->opcode); in dump_insn() 70 dump_field(fp, "modrm", "\t", &insn->modrm); in dump_insn() 71 dump_field(fp, "sib", "\t", &insn->sib); in dump_insn() 72 dump_field(fp, "displacement", "\t", &insn->displacement); in dump_insn() 73 dump_field(fp, "immediate1", "\t", &insn->immediate1); in dump_insn() 74 dump_field(fp, "immediate2", "\t", &insn->immediate2); in dump_insn() [all …]
|