Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\hw_breakpoint.c Create Date:2022-07-28 07:45:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Handle debug exception notifications.* Return value is either NOTIFY_STOP or NOTIFY_DONE as explained below.* NOTIFY_DONE returned if one of the following conditions is true.* i) When the causative address is from user-space and the exception

Proto:static int hw_breakpoint_handler(struct die_args *args)

Type:int

Parameter:

TypeParameterName
struct die_args *args
440  rc = Clean way to return from the notifier and stop further calls.
446  dr6_p = ERR_PTR(err)
447  dr6 = dr6_p
450  If dr6 & single-step Then Return Don't care
454  If (dr6 & DR_TRAP_BITS) == 0 Then Return Don't care
457  These special macros can be used to get or set a debugging register(dr7, 7)
459  set_debugreg(0UL, 7)
465  debugreg6 &= ~DR_TRAP_BITS
466  cpu = get_cpu()
469  When i < Total number of available HW breakpoint registers cycle
470  If Value is more likely to compile time(!(dr6 & (db0 << i))) Then Continue
479  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
481  bp = per_cpu(Stores the breakpoints currently in use on each breakpoint address* register for each cpus[i], cpu)
486  dr6_p &= ~(db0 << i)
491  If Not bp Then
493  Break
496  perf_bp_event(bp, regs)
502  If type == rigger on instruction execute Then flags |= X86_EFLAGS_RF
505  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
512  If debugreg6 & DR_TRAP_BITS || dr6 & ~DR_TRAP_BITS Then rc = Don't care
516  set_debugreg(dr7, 7)
517  put_cpu()
519  Return rc
Caller
NameDescribe
hw_breakpoint_exceptions_notifyHandle debug exception notifications.