Home
last modified time | relevance | path

Searched refs:ppc_inst (Results 1 - 25 of 61) sorted by relevance

123

/kernel/linux/linux-5.10/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()
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
69 #define ppc_inst global() macro
[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 inst
[all...]
H A Duprobes.h27 struct ppc_inst insn;
28 struct ppc_inst ixol;
/kernel/linux/linux-5.10/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 *add
[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_STFD in test_lfdx_stfdx()
[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 *star in patch_feature_section()
[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 *ins
[all...]
/kernel/linux/linux-5.10/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 o
[all...]
/kernel/linux/linux-5.10/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_OR in patch_imm64_load_insns()
[all...]
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 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 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 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 ins in try_to_emulate()
[all...]
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()
/kernel/linux/linux-6.6/arch/powerpc/lib/
H A Dtest_emulate_step.c99 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LD(5, 3, 0))); in test_ld()
140 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LWZ(5, 3, 0))); in test_lwz()
184 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LWZX(5, 3, 4))); in test_lwzx()
202 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STD(5, 3, 0))); in test_std()
250 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LDARX(5, 3, 4, 0))); in test_ldarx_stdcx()
268 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STDCX(5, 3, 4))); in test_ldarx_stdcx()
308 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LFSX(10, 3, 4))); in test_lfsx_stfsx()
321 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STFSX(10, 3, 4))); in test_lfsx_stfsx()
398 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LFDX(10, 3, 4))); in test_lfdx_stfdx()
411 stepped = emulate_step(&regs, ppc_inst(PPC_RAW_STFD in test_lfdx_stfdx()
[all...]
H A Dtest-code-patching.c39 check(instr_is_branch_iform(ppc_inst(0x48000000))); in test_branch_iform()
41 check(instr_is_branch_iform(ppc_inst(0x4bffffff))); in test_branch_iform()
43 check(!instr_is_branch_iform(ppc_inst(0xcbffffff))); in test_branch_iform()
45 check(!instr_is_branch_iform(ppc_inst(0x7bffffff))); in test_branch_iform()
48 check(instr_is_branch_iform(ppc_inst(0x48000001))); in test_branch_iform()
50 check(instr_is_branch_iform(ppc_inst(0x4bfffffd))); in test_branch_iform()
52 check(instr_is_branch_iform(ppc_inst(0x4bff00fd))); in test_branch_iform()
54 check(!instr_is_branch_iform(ppc_inst(0x7bfffffd))); in test_branch_iform()
57 ppc_inst_write(iptr, ppc_inst(0x48000103)); in test_branch_iform()
60 ppc_inst_write(iptr, ppc_inst( in test_branch_iform()
[all...]
/kernel/linux/linux-6.6/arch/powerpc/kernel/
H A Doptprobes.c129 patch_instruction(addr++, ppc_inst(PPC_RAW_LIS(reg, PPC_HI(val)))); in patch_imm32_load_insns()
130 patch_instruction(addr, ppc_inst(PPC_RAW_ORI(reg, reg, PPC_LO(val)))); in patch_imm32_load_insns()
139 patch_instruction(addr++, ppc_inst(PPC_RAW_LIS(reg, PPC_HIGHEST(val)))); in patch_imm64_load_insns()
140 patch_instruction(addr++, ppc_inst(PPC_RAW_ORI(reg, reg, PPC_HIGHER(val)))); in patch_imm64_load_insns()
141 patch_instruction(addr++, ppc_inst(PPC_RAW_SLDI(reg, reg, 32))); in patch_imm64_load_insns()
142 patch_instruction(addr++, ppc_inst(PPC_RAW_ORIS(reg, reg, PPC_HI(val)))); in patch_imm64_load_insns()
143 patch_instruction(addr, ppc_inst(PPC_RAW_ORI(reg, reg, PPC_LO(val)))); in patch_imm64_load_insns()
195 rc = patch_instruction(buff + i, ppc_inst(*(optprobe_template_entry + i))); in arch_prepare_optimized_kprobe()
H A Dstatic_call.c20 err = patch_instruction(tramp + PPC_SCT_DATA, ppc_inst(target)); in arch_static_call_transform()
26 err = patch_instruction(tramp, ppc_inst(PPC_RAW_BLR())); in arch_static_call_transform()
30 err = patch_instruction(tramp, ppc_inst(PPC_RAW_NOP())); in arch_static_call_transform()
H A Dsecurity.c446 patch_instruction_site(site, ppc_inst(PPC_RAW_NOP())); in update_branch_cache_flush()
447 patch_instruction_site(site2, ppc_inst(PPC_RAW_NOP())); in update_branch_cache_flush()
457 patch_instruction_site(site, ppc_inst(PPC_RAW_NOP())); in update_branch_cache_flush()
459 patch_instruction_site(site, ppc_inst(PPC_RAW_NOP())); in update_branch_cache_flush()
461 patch_instruction_site(site, ppc_inst(PPC_RAW_NOP())); in update_branch_cache_flush()
472 patch_instruction_site(site, ppc_inst(0x39207fff)); // li r9,0x7fff in update_branch_cache_flush()
474 patch_instruction_site(site, ppc_inst(0x7d2903a6)); // mtctr r9 in update_branch_cache_flush()
476 patch_instruction_site(site, ppc_inst(PPC_INST_BCCTR_FLUSH)); in update_branch_cache_flush()
484 ppc_inst(PPC_RAW_BLR())); in update_branch_cache_flush()
489 ppc_inst(PPC_RAW_BL in update_branch_cache_flush()
[all...]
/kernel/linux/linux-6.6/arch/powerpc/include/asm/
H A Dinst.h24 __gui_inst = ppc_inst(__prefix); \
46 #define ppc_inst(x) ((ppc_inst_t){ .val = (x) }) macro
53 #define ppc_inst(x) (x) macro
70 #define ppc_inst_prefix(x, y) ((void)y, ppc_inst(x))
84 return ppc_inst(*ptr); in ppc_inst_read()
155 *inst = ppc_inst(val); in __copy_inst_from_kernel_nofault()
/kernel/linux/linux-6.6/arch/powerpc/kernel/trace/
H A Dftrace_64_pg.c160 if (!ppc_inst_equal(op, ppc_inst(PPC_RAW_MFLR(_R0))) && in __ftrace_make_nop()
161 !ppc_inst_equal(op, ppc_inst(PPC_INST_STD_LR))) { in __ftrace_make_nop()
176 if (!ppc_inst_equal(op, ppc_inst(PPC_INST_LD_TOC))) { in __ftrace_make_nop()
199 pop = ppc_inst(PPC_RAW_NOP()); in __ftrace_make_nop()
201 pop = ppc_inst(PPC_RAW_BRANCH(8)); /* b +8 */ in __ftrace_make_nop()
334 if (patch_instruction((u32 *)ip, ppc_inst(PPC_RAW_NOP()))) { in __ftrace_make_nop_kernel()
356 new = ppc_inst(PPC_RAW_NOP()); in ftrace_make_nop()
397 return ppc_inst_equal(op0, ppc_inst(PPC_RAW_NOP())); in expected_nop_sequence()
399 return ppc_inst_equal(op0, ppc_inst(PPC_RAW_BRANCH(8))) && in expected_nop_sequence()
400 ppc_inst_equal(op1, ppc_inst(PPC_INST_LD_TO in expected_nop_sequence()
[all...]
H A Dftrace.c144 old = ppc_inst(PPC_RAW_NOP()); in ftrace_make_call()
165 ppc_inst_t nop_inst = ppc_inst(PPC_RAW_NOP()); in ftrace_replace_code()
225 ret = ftrace_validate_inst(ip - 4, ppc_inst(PPC_RAW_NOP())); in ftrace_init_nop()
227 ret = ftrace_validate_inst(ip, ppc_inst(PPC_RAW_NOP())); in ftrace_init_nop()
230 ret = ftrace_validate_inst(ip - 8, ppc_inst(PPC_RAW_MFLR(_R0))); in ftrace_init_nop()
232 ret = ftrace_validate_inst(ip - 4, ppc_inst(PPC_RAW_STW(_R0, _R1, 4))); in ftrace_init_nop()
236 if (!ret && !ppc_inst_equal(old, ppc_inst(PPC_RAW_MFLR(_R0)))) { in ftrace_init_nop()
237 ret = ftrace_validate_inst(ip - 8, ppc_inst(PPC_RAW_MFLR(_R0))); in ftrace_init_nop()
238 ret |= ftrace_validate_inst(ip - 4, ppc_inst(PPC_RAW_STD(_R0, _R1, 16))); in ftrace_init_nop()
256 new = ppc_inst(PPC_RAW_NO in ftrace_init_nop()
[all...]
/kernel/linux/linux-5.10/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))
/kernel/linux/linux-5.10/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()
/kernel/linux/linux-5.10/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()

Completed in 11 milliseconds

123