This is both intuitive and required, as any previous breakpoint settings
may not be applicable to the new process.
Reported by: arichardson
Differential D29672
arm64: clear debug registers in exec_setregs() mhorne on Apr 9 2021, 2:18 PM. Authored by Tags None Referenced Files
Details This is both intuitive and required, as any previous breakpoint settings Reported by: arichardson
Diff Detail
Event TimelineComment Actions It is not required since we do not allow setting user dbregs for 32-bit processes. Still, doing so would guard against any future changes so yes, I think it's worth adding there too. Comment Actions Also clear in freebsd32_setregs(). Add a local pcb pointer instead of using td->pcb repeatedly. Comment Actions I am curious how this is arranged. Could you please point me?
Comment Actions The debug registers are not directly accessible at EL0, and set_dbregs32() is a stub. Perhaps it is more precise to say that setting them is not supported, than disallowed. emaste's recent change 5be27cbf16c85 is somewhat relevant here. Comment Actions That might be possible, it seems like this case is not handled. The code in kern_ptrace() is slightly tricky, but it seems like PROC_WRITE(dbreg, td2, addr) would expand to set_dbregs(td2, addr) for a 64-bit client but 32-bit td2. Is this correct, and why? I would sort of expect set_dbregs32(td2, addr), but there must be some reason otherwise. Comment Actions Idea is that full execution environment for the host is 64bit, and the register set does not depend on the mode of the target process. On the other hand, 32bit process itself represents some specific ABI that needs a translation to the full native one. So e.g. set_dbregs32() is there to translate from 32bit ABI to native (wide), not to handle 32bit target. |