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:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:arch_build_bp_info

Proto:static int arch_build_bp_info(struct perf_event *bp, const struct perf_event_attr *attr, struct arch_hw_breakpoint *hw)

Type:int

Parameter:

TypeParameterName
struct perf_event *bp
const struct perf_event_attr *attr
struct arch_hw_breakpoint *hw
234  address = bp_addr
235  mask = 0
239  Case bp_type == HW_BREAKPOINT_W
240  type = rigger on memory write
241  Break
242  Case bp_type == HW_BREAKPOINT_W | HW_BREAKPOINT_R
243  type = rigger on memory read or write
244  Break
245  Case bp_type == HW_BREAKPOINT_X
251  If bp_addr >= TASK_SIZE_MAX Then
252  If within_kprobe_blacklist(bp_addr) Then Return -EINVAL
256  type = rigger on instruction execute
262  If bp_len == sizeof(long) Then
264  Return 0
267  Default
268  Return -EINVAL
273  Case bp_len == HW_BREAKPOINT_LEN_1
275  Break
276  Case bp_len == HW_BREAKPOINT_LEN_2
278  Break
279  Case bp_len == HW_BREAKPOINT_LEN_4
281  Break
283  Case bp_len == HW_BREAKPOINT_LEN_8
285  Break
287  Default
291  If bp_addr & bp_len - 1 Then Return -EINVAL
304  mask = bp_len - 1
308  Return 0
Caller
NameDescribe
hw_breakpoint_arch_parseValidate the arch-specific HW Breakpoint register settings