Home
last modified time | relevance | path

Searched refs:ppc_inst (Results 1 – 25 of 34) sorted by relevance

12

/OK3568_Linux_fs/kernel/arch/powerpc/include/asm/
H A Dinst.h11 struct ppc_inst { struct
18 static inline u32 ppc_inst_val(struct ppc_inst x) in ppc_inst_val() argument
23 static inline int ppc_inst_primary_opcode(struct ppc_inst x) in ppc_inst_primary_opcode()
29 #define ppc_inst(x) ((struct ppc_inst){ .val = (x), .suffix = 0xff }) macro
31 #define ppc_inst_prefix(x, y) ((struct ppc_inst){ .val = (x), .suffix = (y) })
33 static inline u32 ppc_inst_suffix(struct ppc_inst x) in ppc_inst_suffix()
38 static inline bool ppc_inst_prefixed(struct ppc_inst x) in ppc_inst_prefixed()
43 static inline struct ppc_inst ppc_inst_swab(struct ppc_inst x) in ppc_inst_swab()
49 static inline struct ppc_inst ppc_inst_read(const struct ppc_inst *ptr) in ppc_inst_read()
58 return ppc_inst(val); in ppc_inst_read()
[all …]
H A Dcode-patching.h27 int create_branch(struct ppc_inst *instr, const struct ppc_inst *addr,
29 int create_cond_branch(struct ppc_inst *instr, const struct ppc_inst *addr,
31 int patch_branch(struct ppc_inst *addr, unsigned long target, int flags);
32 int patch_instruction(struct ppc_inst *addr, struct ppc_inst instr);
33 int raw_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr);
40 static inline int patch_instruction_site(s32 *site, struct ppc_inst instr) in patch_instruction_site()
42 return patch_instruction((struct ppc_inst *)patch_site_addr(site), instr); in patch_instruction_site()
47 return patch_branch((struct ppc_inst *)patch_site_addr(site), target, flags); in patch_branch_site()
53 return patch_instruction((struct ppc_inst *)addr, ppc_inst((*addr & ~clr) | set)); in modify_instruction()
61 int instr_is_relative_branch(struct ppc_inst instr);
[all …]
H A Duprobes.h27 struct ppc_inst insn;
28 struct ppc_inst ixol;
H A Dhw_breakpoint.h59 bool wp_check_constraints(struct pt_regs *regs, struct ppc_inst instr,
63 void wp_get_instr_detail(struct pt_regs *regs, struct ppc_inst *instr,
H A Dsstep.h149 struct ppc_inst instr);
166 extern int emulate_step(struct pt_regs *regs, struct ppc_inst instr);
/OK3568_Linux_fs/kernel/arch/powerpc/lib/
H A Dcode-patching.c21 static int __patch_instruction(struct ppc_inst *exec_addr, struct ppc_inst instr, in __patch_instruction()
22 struct ppc_inst *patch_addr) in __patch_instruction()
38 int raw_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr) in raw_patch_instruction()
146 static int do_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr) in do_patch_instruction()
149 struct ppc_inst *patch_addr = NULL; in do_patch_instruction()
170 patch_addr = (struct ppc_inst *)(text_poke_addr + (kaddr & ~PAGE_MASK)); in do_patch_instruction()
185 static int do_patch_instruction(struct ppc_inst *addr, struct ppc_inst instr) in do_patch_instruction()
192 int patch_instruction(struct ppc_inst *addr, struct ppc_inst instr) in patch_instruction()
203 int patch_branch(struct ppc_inst *addr, unsigned long target, int flags) in patch_branch()
205 struct ppc_inst instr; in patch_branch()
[all …]
H A Dfeature-fixups.c36 static struct ppc_inst *calc_addr(struct fixup_entry *fcur, long offset) in calc_addr()
43 return (struct ppc_inst *)((unsigned long)fcur + offset); in calc_addr()
46 static int patch_alt_instruction(struct ppc_inst *src, struct ppc_inst *dest, in patch_alt_instruction()
47 struct ppc_inst *alt_start, struct ppc_inst *alt_end) in patch_alt_instruction()
50 struct ppc_inst instr; in patch_alt_instruction()
55 struct ppc_inst *target = (struct ppc_inst *)branch_target(src); in patch_alt_instruction()
72 struct ppc_inst *start, *end, *alt_start, *alt_end, *src, *dest, nop; in patch_feature_section()
94 nop = ppc_inst(PPC_INST_NOP); in patch_feature_section()
153 patch_instruction((struct ppc_inst *)dest, ppc_inst(instrs[0])); in do_stf_entry_barrier_fixups()
156 patch_branch((struct ppc_inst *)(dest + 1), in do_stf_entry_barrier_fixups()
[all …]
H A Dtest_emulate_step.c100 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LD(5, 3, 0))); in test_ld()
141 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LWZ(5, 3, 0))); in test_lwz()
185 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LWZX(5, 3, 4))); in test_lwzx()
203 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STD(5, 3, 0))); in test_std()
251 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LDARX(5, 3, 4, 0))); in test_ldarx_stdcx()
269 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STDCX(5, 3, 4))); in test_ldarx_stdcx()
309 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LFSX(10, 3, 4))); in test_lfsx_stfsx()
322 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STFSX(10, 3, 4))); in test_lfsx_stfsx()
399 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LFDX(10, 3, 4))); in test_lfdx_stfdx()
412 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STFDX(10, 3, 4))); in test_lfdx_stfdx()
[all …]
H A Dinst.c12 int probe_user_read_inst(struct ppc_inst *inst, in probe_user_read_inst()
13 struct ppc_inst __user *nip) in probe_user_read_inst()
25 *inst = ppc_inst(val); in probe_user_read_inst()
30 int probe_kernel_read_inst(struct ppc_inst *inst, in probe_kernel_read_inst()
31 struct ppc_inst *src) in probe_kernel_read_inst()
43 *inst = ppc_inst(val); in probe_kernel_read_inst()
48 int probe_user_read_inst(struct ppc_inst *inst, in probe_user_read_inst()
49 struct ppc_inst __user *nip) in probe_user_read_inst()
56 *inst = ppc_inst(val); in probe_user_read_inst()
61 int probe_kernel_read_inst(struct ppc_inst *inst, in probe_kernel_read_inst()
[all …]
/OK3568_Linux_fs/kernel/arch/powerpc/kernel/trace/
H A Dftrace.c44 static struct ppc_inst
47 struct ppc_inst op; in ftrace_call_replace()
52 create_branch(&op, (struct ppc_inst *)ip, addr, link ? 1 : 0); in ftrace_call_replace()
58 ftrace_modify_code(unsigned long ip, struct ppc_inst old, struct ppc_inst new) in ftrace_modify_code()
60 struct ppc_inst replaced; in ftrace_modify_code()
82 if (patch_instruction((struct ppc_inst *)ip, new)) in ftrace_modify_code()
93 struct ppc_inst op; in test_24bit_addr()
97 return create_branch(&op, (struct ppc_inst *)ip, addr, 0) == 0; in test_24bit_addr()
100 static int is_bl_op(struct ppc_inst op) in is_bl_op()
105 static int is_b_op(struct ppc_inst op) in is_b_op()
[all …]
/OK3568_Linux_fs/kernel/arch/powerpc/kernel/
H A Doptprobes.c103 if (!is_conditional_branch(ppc_inst_read((struct ppc_inst *)p->ainsn.insn)) && in can_optimize()
105 ppc_inst_read((struct ppc_inst *)p->ainsn.insn)) == 1) { in can_optimize()
152 patch_instruction((struct ppc_inst *)addr, in patch_imm32_load_insns()
153 ppc_inst(PPC_INST_ADDIS | ___PPC_RT(4) | in patch_imm32_load_insns()
158 patch_instruction((struct ppc_inst *)addr, in patch_imm32_load_insns()
159 ppc_inst(PPC_INST_ORI | ___PPC_RA(4) | in patch_imm32_load_insns()
170 patch_instruction((struct ppc_inst *)addr, in patch_imm64_load_insns()
171 ppc_inst(PPC_INST_ADDIS | ___PPC_RT(reg) | in patch_imm64_load_insns()
176 patch_instruction((struct ppc_inst *)addr, in patch_imm64_load_insns()
177 ppc_inst(PPC_INST_ORI | ___PPC_RA(reg) | in patch_imm64_load_insns()
[all …]
H A Dkprobes.c110 struct ppc_inst insn = ppc_inst_read((struct ppc_inst *)p->addr); in arch_prepare_kprobe()
119 ppc_inst_prefixed(ppc_inst_read((struct ppc_inst *)(p->addr - 1)))) { in arch_prepare_kprobe()
127 ppc_inst_prefixed(ppc_inst_read((struct ppc_inst *)prev->ainsn.insn))) { in arch_prepare_kprobe()
141 patch_instruction((struct ppc_inst *)p->ainsn.insn, insn); in arch_prepare_kprobe()
152 patch_instruction((struct ppc_inst *)p->addr, ppc_inst(BREAKPOINT_INSTRUCTION)); in arch_arm_kprobe()
158 patch_instruction((struct ppc_inst *)p->addr, ppc_inst(p->opcode)); in arch_disarm_kprobe()
231 struct ppc_inst insn = ppc_inst_read((struct ppc_inst *)p->ainsn.insn); in try_to_emulate()
443 len = ppc_inst_len(ppc_inst_read((struct ppc_inst *)cur->ainsn.insn)); in kprobe_post_handler()
H A Depapr_paravirt.c40 struct ppc_inst inst = ppc_inst(be32_to_cpu(insts[i])); in early_init_dt_scan_epapr()
41 patch_instruction((struct ppc_inst *)(epapr_hypercall_start + i), inst); in early_init_dt_scan_epapr()
43 patch_instruction((struct ppc_inst *)(epapr_ev_idle_start + i), inst); in early_init_dt_scan_epapr()
H A Dsecurity.c444 patch_instruction_site(site, ppc_inst(PPC_INST_NOP)); in update_branch_cache_flush()
453 patch_instruction_site(site, ppc_inst(PPC_INST_NOP)); in update_branch_cache_flush()
455 patch_instruction_site(site, ppc_inst(PPC_INST_NOP)); in update_branch_cache_flush()
457 patch_instruction_site(site, ppc_inst(PPC_INST_NOP)); in update_branch_cache_flush()
468 patch_instruction_site(site, ppc_inst(0x39207fff)); // li r9,0x7fff in update_branch_cache_flush()
470 patch_instruction_site(site, ppc_inst(0x7d2903a6)); // mtctr r9 in update_branch_cache_flush()
472 patch_instruction_site(site, ppc_inst(PPC_INST_BCCTR_FLUSH)); in update_branch_cache_flush()
480 ppc_inst(PPC_INST_BLR)); in update_branch_cache_flush()
485 ppc_inst(PPC_INST_BLR)); in update_branch_cache_flush()
H A Djump_label.c14 struct ppc_inst *addr = (struct ppc_inst *)(unsigned long)entry->code; in arch_jump_label_transform()
19 patch_instruction(addr, ppc_inst(PPC_INST_NOP)); in arch_jump_label_transform()
H A Dsetup_32.c77 struct ppc_inst *addr = (struct ppc_inst *)patch_site_addr(&patch__memset_nocache); in machine_init()
78 struct ppc_inst insn; in machine_init()
88 patch_instruction_site(&patch__memcpy_nocache, ppc_inst(PPC_INST_NOP)); in machine_init()
H A Dkgdb.c422 struct ppc_inst *addr = (struct ppc_inst *)bpt->bpt_addr; in kgdb_arch_set_breakpoint()
428 err = patch_instruction(addr, ppc_inst(BREAK_INSTR)); in kgdb_arch_set_breakpoint()
441 struct ppc_inst *addr = (struct ppc_inst *)bpt->bpt_addr; in kgdb_arch_remove_breakpoint()
443 err = patch_instruction(addr, ppc_inst(instr)); in kgdb_arch_remove_breakpoint()
H A Dcrash_dump.c38 struct ppc_inst *p = (struct ppc_inst *)addr; in create_trampoline()
48 patch_instruction(p, ppc_inst(PPC_INST_NOP)); in create_trampoline()
H A Dhw_breakpoint_constraints.c83 bool wp_check_constraints(struct pt_regs *regs, struct ppc_inst instr, in wp_check_constraints()
100 if (unlikely(ppc_inst_equal(instr, ppc_inst(0)))) { in wp_check_constraints()
139 void wp_get_instr_detail(struct pt_regs *regs, struct ppc_inst *instr, in wp_get_instr_detail()
H A Dhw_breakpoint.c522 struct ppc_inst instr) in stepping_handler()
563 struct ppc_inst instr = ppc_inst(0); in hw_breakpoint_handler()
592 ppc_inst_equal(instr, ppc_inst(0))) { in hw_breakpoint_handler()
H A Dalign.c108 struct ppc_inst ppc_instr) in emulate_spe()
298 struct ppc_inst instr; in fix_alignment()
/OK3568_Linux_fs/kernel/arch/powerpc/platforms/86xx/
H A Dmpc86xx_smp.c76 patch_branch((struct ppc_inst *)vector, target, BRANCH_SET_LINK); in smp_86xx_kick_cpu()
86 patch_instruction((struct ppc_inst *)vector, ppc_inst(save_vector)); in smp_86xx_kick_cpu()
/OK3568_Linux_fs/kernel/arch/powerpc/perf/
H A D8xx-pmu.c169 struct ppc_inst insn = ppc_inst(PPC_INST_MFSPR | __PPC_RS(R10) | in mpc8xx_pmu_del()
178 struct ppc_inst insn = ppc_inst(PPC_INST_MFSPR | __PPC_RS(R10) | in mpc8xx_pmu_del()
/OK3568_Linux_fs/kernel/arch/powerpc/xmon/
H A Dxmon_bpts.h8 #define BPT_SIZE (sizeof(struct ppc_inst) * 2)
9 #define BPT_WORDS (BPT_SIZE / sizeof(struct ppc_inst))
H A Dxmon.c102 struct ppc_inst *instr;
124 static int mread_instr(unsigned long, struct ppc_inst *);
905 struct ppc_inst instr, instr2; in insert_bpts()
949 ppc_inst(bpinstr)); in insert_bpts()
952 if (patch_instruction((struct ppc_inst *)bp->address, in insert_bpts()
953 ppc_inst(bpinstr)) != 0) { in insert_bpts()
985 struct ppc_inst instr; in remove_bpts()
992 && ppc_inst_equal(instr, ppc_inst(bpinstr)) in remove_bpts()
994 (struct ppc_inst *)bp->address, ppc_inst_read(bp->instr)) != 0) in remove_bpts()
1201 struct ppc_inst instr; in do_step()
[all …]

12