Lines Matching refs:ctrl

230 	enum dbg_active_el dbg_el = debug_exception_level(info->ctrl.privilege);  in hw_breakpoint_control()
231 u32 ctrl; in hw_breakpoint_control() local
233 if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { in hw_breakpoint_control()
267 ctrl = encode_ctrl_reg(info->ctrl); in hw_breakpoint_control()
269 reg_enable ? ctrl | 0x1 : ctrl & ~0x1); in hw_breakpoint_control()
342 len = get_hbp_len(hw->ctrl.len); in arch_check_bp_in_kernelspace()
352 int arch_bp_generic_fields(struct arch_hw_breakpoint_ctrl ctrl, in arch_bp_generic_fields() argument
356 switch (ctrl.type) { in arch_bp_generic_fields()
373 if (!ctrl.len) in arch_bp_generic_fields()
375 *offset = __ffs(ctrl.len); in arch_bp_generic_fields()
378 switch (ctrl.len >> *offset) { in arch_bp_generic_fields()
420 hw->ctrl.type = ARM_BREAKPOINT_EXECUTE; in arch_build_bp_info()
423 hw->ctrl.type = ARM_BREAKPOINT_LOAD; in arch_build_bp_info()
426 hw->ctrl.type = ARM_BREAKPOINT_STORE; in arch_build_bp_info()
429 hw->ctrl.type = ARM_BREAKPOINT_LOAD | ARM_BREAKPOINT_STORE; in arch_build_bp_info()
438 hw->ctrl.len = ARM_BREAKPOINT_LEN_1; in arch_build_bp_info()
441 hw->ctrl.len = ARM_BREAKPOINT_LEN_2; in arch_build_bp_info()
444 hw->ctrl.len = ARM_BREAKPOINT_LEN_3; in arch_build_bp_info()
447 hw->ctrl.len = ARM_BREAKPOINT_LEN_4; in arch_build_bp_info()
450 hw->ctrl.len = ARM_BREAKPOINT_LEN_5; in arch_build_bp_info()
453 hw->ctrl.len = ARM_BREAKPOINT_LEN_6; in arch_build_bp_info()
456 hw->ctrl.len = ARM_BREAKPOINT_LEN_7; in arch_build_bp_info()
459 hw->ctrl.len = ARM_BREAKPOINT_LEN_8; in arch_build_bp_info()
470 if (hw->ctrl.type == ARM_BREAKPOINT_EXECUTE) { in arch_build_bp_info()
472 if (hw->ctrl.len != ARM_BREAKPOINT_LEN_2 && in arch_build_bp_info()
473 hw->ctrl.len != ARM_BREAKPOINT_LEN_4) in arch_build_bp_info()
475 } else if (hw->ctrl.len != ARM_BREAKPOINT_LEN_4) { in arch_build_bp_info()
482 hw->ctrl.len = ARM_BREAKPOINT_LEN_4; in arch_build_bp_info()
495 hw->ctrl.privilege = AARCH64_BREAKPOINT_EL1; in arch_build_bp_info()
497 hw->ctrl.privilege = AARCH64_BREAKPOINT_EL0; in arch_build_bp_info()
500 hw->ctrl.enabled = !attr->disabled; in arch_build_bp_info()
530 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_8) in hw_breakpoint_arch_parse()
542 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) in hw_breakpoint_arch_parse()
548 if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) in hw_breakpoint_arch_parse()
556 if (hw->ctrl.type == ARM_BREAKPOINT_EXECUTE) in hw_breakpoint_arch_parse()
564 hw->ctrl.len <<= offset; in hw_breakpoint_arch_parse()
570 if (hw->ctrl.privilege == AARCH64_BREAKPOINT_EL1 && bp->hw.target) in hw_breakpoint_arch_parse()
584 u32 ctrl; in toggle_bp_registers() local
604 privilege = counter_arch_bp(slots[i])->ctrl.privilege; in toggle_bp_registers()
608 ctrl = read_wb_reg(reg, i); in toggle_bp_registers()
610 ctrl |= 0x1; in toggle_bp_registers()
612 ctrl &= ~0x1; in toggle_bp_registers()
613 write_wb_reg(reg, i, ctrl); in toggle_bp_registers()
629 struct arch_hw_breakpoint_ctrl ctrl; in breakpoint_handler() local
650 decode_ctrl_reg(ctrl_reg, &ctrl); in breakpoint_handler()
651 if (!((1 << (addr & 0x3)) & ctrl.len)) in breakpoint_handler()
714 struct arch_hw_breakpoint_ctrl *ctrl) in get_distance_from_watchpoint() argument
721 lens = __ffs(ctrl->len); in get_distance_from_watchpoint()
722 lene = __fls(ctrl->len); in get_distance_from_watchpoint()
747 if (!user_mode(regs) && info->ctrl.privilege == AARCH64_BREAKPOINT_EL0) in watchpoint_report()
764 struct arch_hw_breakpoint_ctrl ctrl; in watchpoint_handler() local
791 decode_ctrl_reg(ctrl_reg, &ctrl); in watchpoint_handler()
792 dist = get_distance_from_watchpoint(addr, val, &ctrl); in watchpoint_handler()