Lines Matching +full:smp +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-only
13 #define MAX_PATCH_SIZE (((u8)(-1)) / LOONGARCH_INSN_SIZE)
22 __setup("debug-alternative", debug_alt);
40 for (_j = 0; _j < count - 1; _j++) \
49 while (count--) { in add_nops()
50 insn->word = INSN_NOP; in add_nops()
67 long offset; in recompute_jump() local
72 si_l = src->reg0i26_format.immediate_l; in recompute_jump()
73 si_h = src->reg0i26_format.immediate_h; in recompute_jump()
74 switch (src->reg0i26_format.opcode) { in recompute_jump()
80 offset = jump_addr - pc; in recompute_jump()
81 BUG_ON(offset < -SZ_128M || offset >= SZ_128M); in recompute_jump()
82 offset >>= 2; in recompute_jump()
83 buf->reg0i26_format.immediate_h = offset >> 16; in recompute_jump()
84 buf->reg0i26_format.immediate_l = offset; in recompute_jump()
88 si_l = src->reg1i21_format.immediate_l; in recompute_jump()
89 si_h = src->reg1i21_format.immediate_h; in recompute_jump()
90 switch (src->reg1i21_format.opcode) { in recompute_jump()
92 BUG_ON(buf->reg1i21_format.rj & BIT(4)); in recompute_jump()
99 offset = jump_addr - pc; in recompute_jump()
100 BUG_ON(offset < -SZ_4M || offset >= SZ_4M); in recompute_jump()
101 offset >>= 2; in recompute_jump()
102 buf->reg1i21_format.immediate_h = offset >> 16; in recompute_jump()
103 buf->reg1i21_format.immediate_l = offset; in recompute_jump()
107 si = src->reg2i16_format.immediate; in recompute_jump()
108 switch (src->reg2i16_format.opcode) { in recompute_jump()
118 offset = jump_addr - pc; in recompute_jump()
119 BUG_ON(offset < -SZ_128K || offset >= SZ_128K); in recompute_jump()
120 offset >>= 2; in recompute_jump()
121 buf->reg2i16_format.immediate = offset; in recompute_jump()
136 return -EINVAL; in copy_alt_insns()
149 * text_poke_early - Update instructions on a live kernel at boot time
178 * before SMP is initialized to avoid SMP problems with self modifying code.
190 DPRINTK("alt table %px, -> %px", start, end); in apply_alternatives()
203 instr = (void *)&a->instr_offset + a->instr_offset; in apply_alternatives()
204 replacement = (void *)&a->replace_offset + a->replace_offset; in apply_alternatives()
206 BUG_ON(a->instrlen > sizeof(insnbuf)); in apply_alternatives()
207 BUG_ON(a->instrlen & 0x3); in apply_alternatives()
208 BUG_ON(a->replacementlen & 0x3); in apply_alternatives()
210 nr_instr = a->instrlen / LOONGARCH_INSN_SIZE; in apply_alternatives()
211 nr_repl = a->replacementlen / LOONGARCH_INSN_SIZE; in apply_alternatives()
213 if (!cpu_has(a->feature)) { in apply_alternatives()
215 a->feature, instr, a->instrlen, in apply_alternatives()
216 replacement, a->replacementlen); in apply_alternatives()
222 a->feature, instr, a->instrlen, in apply_alternatives()
223 replacement, a->replacementlen); in apply_alternatives()
232 add_nops(insnbuf + nr_repl, nr_instr - nr_repl); in apply_alternatives()
233 nr_insnbuf += nr_instr - nr_repl; in apply_alternatives()