(WARNING: I've browsed the ARMv7 breakpoints implementation
but I may have an erratic/incomplete understanding, then parts
of this review might make little sense)
2010/3/10 Will Deacon <will.deacon@arm.com>:
What do you mean here by unpredictable? It would be a pity to limit the
resources to one register.
Doh! That must explain the problem with DFAR...
That's really not convenient :-(
Ok...
Ok, alternatively, why not having the control register in the arch
breakpoint structure:
u32 __reserved : 19,
len : 7,
type : 2,
privilege : 2,
enabled : 1;
It will avoid you to play with bitwise operations that may scale into dirty
and error prone as you may support more features from the control register
(link, mask, etc...).
So in the future if you want to support more things, you can just split out
the __reserved field into the features it has, depending on the ARM versions.
Ah and it will make ptrace support easier: the user writes into the val/ctrl
fields directly as if they were the true registers, then you can just validate
the fields you want without bitwise ops.
You seem to make a wrong assumption here.
This is not because the breakpoint is task-bound that we don't
want it to trigger on the kernel. We may want to trigger breakpoints
on tasklist_lock accesses from a given task.
The only case for which we don't want it to trigger on the kernel
is for ptrace breakpoints.
I guess I should remove this tsk parameter as it makes the things
only confusing. We should simply create ptrace breakpoints with
bp->attr.exclude_kernel set to 1.
Because when bp->attr.exclude_kernel is set to 1, then it truly makes sense
to think about user and supervisor privileges, just to avoid to filter the
event in the software level. Note we do this filtering on software level,
but it going to be less costly if done from hardware.
Even if you don't support ptrace right now, we can define a kernel exluded
breakpoint from perf syscall.
(Note for myself: set exclude_kernel to ptrace breakpoints in x86)
Do you actually support ptrace breakpoints?
We don't need this callback anymore, it has been removed because
of ptrace corner cases...
Thanks!
--