Home
last modified time | relevance | path

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

12345678910>>...24

/linux-6.6.21/arch/x86/lib/
Dinsn.c37 #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 …]
Dinsn-eval.c38 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-6.6.21/tools/arch/x86/lib/
Dinsn.c37 #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-6.6.21/kernel/bpf/
Ddisasm.c17 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-6.6.21/tools/testing/selftests/bpf/
Ddisasm.c17 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-6.6.21/arch/arm64/lib/
Dinsn.c88 u64 aarch64_insn_decode_immediate(enum aarch64_insn_imm_type type, u32 insn) in aarch64_insn_decode_immediate() argument
96 immlo = (insn >> ADR_IMM_LOSHIFT) & ADR_IMM_LOMASK; in aarch64_insn_decode_immediate()
97 immhi = (insn >> ADR_IMM_HISHIFT) & ADR_IMM_HIMASK; in aarch64_insn_decode_immediate()
98 insn = (immhi << ADR_IMM_HILOSPLIT) | immlo; in aarch64_insn_decode_immediate()
109 return (insn >> shift) & mask; in aarch64_insn_decode_immediate()
113 u32 insn, u64 imm) in aarch64_insn_encode_immediate() argument
118 if (insn == AARCH64_BREAK_FAULT) in aarch64_insn_encode_immediate()
140 insn &= ~(mask << shift); in aarch64_insn_encode_immediate()
141 insn |= (imm & mask) << shift; in aarch64_insn_encode_immediate()
143 return insn; in aarch64_insn_encode_immediate()
[all …]
/linux-6.6.21/tools/arch/x86/include/asm/
Dinsn.h68 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-6.6.21/arch/x86/include/asm/
Dinsn.h68 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-6.6.21/arch/powerpc/xmon/
Dspu.h80 #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-6.6.21/arch/s390/tools/
Dgen_opcode_table.c22 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-6.6.21/tools/objtool/
Dcheck.c26 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 if (insn->idx == INSN_CHUNK_MAX) in next_insn_same_sec()
54 return find_insn(file, insn->sec, insn->offset + insn->len); in next_insn_same_sec()
56 insn++; in next_insn_same_sec()
57 if (!insn->len) in next_insn_same_sec()
[all …]
/linux-6.6.21/arch/riscv/kernel/
Dtraps_misaligned.c86 #define INSN_LEN(insn) ((((insn) & 0x3) < 0x3) ? 2 : 4) argument
119 #define RVC_RS1S(insn) (8 + RV_X(insn, SH_RD, 3)) argument
120 #define RVC_RS2S(insn) (8 + RV_X(insn, SH_RS2C, 3)) argument
121 #define RVC_RS2(insn) RV_X(insn, SH_RS2C, 5) argument
129 #define REG_OFFSET(insn, pos) \ argument
130 (SHIFT_RIGHT((insn), (pos) - LOG_REGBYTES) & REG_MASK)
132 #define REG_PTR(insn, pos, regs) \ argument
133 (ulong *)((ulong)(regs) + REG_OFFSET(insn, pos))
135 #define GET_RM(insn) (((insn) >> 12) & 7) argument
137 #define GET_RS1(insn, regs) (*REG_PTR(insn, SH_RS1, regs)) argument
[all …]
/linux-6.6.21/arch/arm/probes/kprobes/
Dactions-thumb.c24 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 …]
/linux-6.6.21/arch/mips/kernel/
Dbranch.c62 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-6.6.21/arch/riscv/kvm/
Dvcpu_insn.c72 #define INSN_IS_16BIT(insn) (((insn) & INSN_16BIT_MASK) != INSN_16BIT_MASK) argument
74 #define INSN_LEN(insn) (INSN_IS_16BIT(insn) ? 2 : 4) argument
105 #define RVC_RS1S(insn) (8 + RV_X(insn, SH_RD, 3)) argument
106 #define RVC_RS2S(insn) (8 + RV_X(insn, SH_RS2C, 3)) argument
107 #define RVC_RS2(insn) RV_X(insn, SH_RS2C, 5) argument
115 #define REG_OFFSET(insn, pos) \ argument
116 (SHIFT_RIGHT((insn), (pos) - LOG_REGBYTES) & REG_MASK)
118 #define REG_PTR(insn, pos, regs) \ argument
119 ((ulong *)((ulong)(regs) + REG_OFFSET(insn, pos)))
121 #define GET_FUNCT3(insn) (((insn) >> 12) & 7) argument
[all …]
/linux-6.6.21/arch/arm64/kernel/probes/
Ddecode-insn.c18 static bool __kprobes aarch64_insn_is_steppable(u32 insn) in aarch64_insn_is_steppable() argument
27 if (aarch64_insn_is_class_branch_sys(insn)) { 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-6.6.21/arch/csky/kernel/probes/
Ddecode-insn.c19 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-6.6.21/arch/sparc/kernel/
Dunaligned_32.c34 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-6.6.21/arch/loongarch/kernel/
Dinst.c13 void simu_pc(struct pt_regs *regs, union loongarch_instruction insn) in simu_pc() argument
16 unsigned int rd = insn.reg1i20_format.rd; in simu_pc()
17 unsigned int imm = insn.reg1i20_format.immediate; in simu_pc()
24 switch (insn.reg1i20_format.opcode) { in simu_pc()
46 void simu_branch(struct pt_regs *regs, union loongarch_instruction insn) in simu_branch() argument
56 imm_l = insn.reg0i26_format.immediate_l; in simu_branch()
57 imm_h = insn.reg0i26_format.immediate_h; in simu_branch()
58 switch (insn.reg0i26_format.opcode) { in simu_branch()
68 imm_l = insn.reg1i21_format.immediate_l; in simu_branch()
69 imm_h = insn.reg1i21_format.immediate_h; in simu_branch()
[all …]
/linux-6.6.21/arch/arm64/kernel/
Darmv8_deprecated.c48 u32 insn);
233 static bool try_emulate_swp(struct pt_regs *regs, u32 insn) in try_emulate_swp() argument
239 if ((insn & 0x0fb00ff0) != 0x01000090) in try_emulate_swp()
242 return swp_handler(regs, insn) == 0; in try_emulate_swp()
316 static bool try_emulate_cp15_barrier(struct pt_regs *regs, u32 insn) in try_emulate_cp15_barrier() argument
321 if ((insn & 0x0fff0fdf) == 0x0e070f9a) in try_emulate_cp15_barrier()
322 return cp15barrier_handler(regs, insn) == 0; in try_emulate_cp15_barrier()
324 if ((insn & 0x0fff0fff) == 0x0e070f95) in try_emulate_cp15_barrier()
325 return cp15barrier_handler(regs, insn) == 0; in try_emulate_cp15_barrier()
353 char *insn; in compat_setend_handler() local
[all …]
/linux-6.6.21/drivers/comedi/kcomedilib/
Dkcomedilib_main.c67 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-6.6.21/arch/s390/lib/
Dprobes.c12 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-6.6.21/arch/arm64/include/asm/
Dinsn.h431 static __always_inline bool aarch64_insn_is_steppable_hint(u32 insn) in aarch64_insn_is_steppable_hint() argument
433 if (!aarch64_insn_is_hint(insn)) in aarch64_insn_is_steppable_hint()
436 switch (insn & 0xFE0) { in aarch64_insn_is_steppable_hint()
455 static __always_inline bool aarch64_insn_is_branch(u32 insn) in aarch64_insn_is_branch() argument
459 return aarch64_insn_is_b(insn) || in aarch64_insn_is_branch()
460 aarch64_insn_is_bl(insn) || in aarch64_insn_is_branch()
461 aarch64_insn_is_cbz(insn) || in aarch64_insn_is_branch()
462 aarch64_insn_is_cbnz(insn) || in aarch64_insn_is_branch()
463 aarch64_insn_is_tbz(insn) || in aarch64_insn_is_branch()
464 aarch64_insn_is_tbnz(insn) || in aarch64_insn_is_branch()
[all …]
Dasm-extable.h28 #define __ASM_EXTABLE_RAW(insn, fixup, type, data) \
31 .long ((insn) - .); \
40 #define _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, err, zero) \
41 __ASM_EXTABLE_RAW(insn, fixup, \
48 #define _ASM_EXTABLE_UACCESS_ERR(insn, fixup, err) \
49 _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, err, wzr)
51 #define _ASM_EXTABLE_UACCESS(insn, fixup) \
52 _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, wzr, wzr)
58 .macro _asm_extable_uaccess, insn, fixup
59 _ASM_EXTABLE_UACCESS(\insn, \fixup)
[all …]
/linux-6.6.21/arch/x86/kernel/kprobes/
Dcore.c115 } __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 …]

12345678910>>...24