Lines Matching defs:insn

16 #include <asm/insn.h>
48 u32 insn);
231 static bool try_emulate_swp(struct pt_regs *regs, u32 insn)
237 if ((insn & 0x0fb00ff0) != 0x01000090)
240 return swp_handler(regs, insn) == 0;
314 static bool try_emulate_cp15_barrier(struct pt_regs *regs, u32 insn)
319 if ((insn & 0x0fff0fdf) == 0x0e070f9a)
320 return cp15barrier_handler(regs, insn) == 0;
322 if ((insn & 0x0fff0fff) == 0x0e070f95)
323 return cp15barrier_handler(regs, insn) == 0;
351 char *insn;
356 insn = "setend be";
359 insn = "setend le";
363 trace_instruction_emulation(insn, regs->pc);
384 static bool try_emulate_setend(struct pt_regs *regs, u32 insn)
387 (insn & 0xfffffff7) == 0x0000b650)
388 return t16_setend_handler(regs, insn) == 0;
391 (insn & 0xfffffdff) == 0xf1010000)
392 return a32_setend_handler(regs, insn) == 0;
421 struct insn_emulation *insn = data;
422 if (insn->set_hw_mode)
423 insn->set_hw_mode(true);
428 struct insn_emulation *insn = data;
429 if (insn->set_hw_mode)
430 insn->set_hw_mode(false);
434 static int run_all_cpu_set_hw_mode(struct insn_emulation *insn, bool enable)
436 if (!insn->set_hw_mode)
439 on_each_cpu(enable_insn_hw_mode, (void *)insn, true);
441 on_each_cpu(disable_insn_hw_mode, (void *)insn, true);
463 struct insn_emulation *insn = insn_emulations[i];
464 bool enable = READ_ONCE(insn->current_mode) == INSN_HW;
465 if (insn->set_hw_mode && insn->set_hw_mode(enable)) {
467 cpu, insn->name);
476 static int update_insn_emulation_mode(struct insn_emulation *insn,
487 if (!run_all_cpu_set_hw_mode(insn, false))
488 pr_notice("Disabled %s support\n", insn->name);
492 switch (insn->current_mode) {
498 ret = run_all_cpu_set_hw_mode(insn, true);
500 pr_notice("Enabled %s support\n", insn->name);
512 struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);
513 enum insn_emulation_mode prev_mode = insn->current_mode;
518 if (ret || !write || prev_mode == insn->current_mode)
521 ret = update_insn_emulation_mode(insn, prev_mode);
524 WRITE_ONCE(insn->current_mode, prev_mode);
525 update_insn_emulation_mode(insn, INSN_UNDEF);
532 static void __init register_insn_emulation(struct insn_emulation *insn)
536 insn->min = INSN_UNDEF;
538 switch (insn->status) {
540 insn->current_mode = INSN_EMULATE;
542 run_all_cpu_set_hw_mode(insn, false);
543 insn->max = INSN_HW;
546 insn->current_mode = INSN_UNDEF;
547 insn->max = INSN_EMULATE;
550 insn->current_mode = INSN_UNDEF;
551 insn->max = INSN_UNDEF;
556 update_insn_emulation_mode(insn, INSN_UNDEF);
558 if (insn->status != INSN_UNAVAILABLE) {
559 sysctl = &insn->sysctl;
564 sysctl->procname = insn->name;
565 sysctl->data = &insn->current_mode;
566 sysctl->extra1 = &insn->min;
567 sysctl->extra2 = &insn->max;
574 bool try_emulate_armv8_deprecated(struct pt_regs *regs, u32 insn)
590 if (ie->try_emulate(regs, insn))