Christoffer Dall <christoffer.dall@xxxxxxxxxx> writes: > On Thu, Nov 20, 2014 at 04:55:14PM +0000, Alex Bennée wrote: <snip> >> >> * ptrace(PTRACE_GETREGSET, NT_ARM_HW_WATCH) >> >> This is used by GDB to access the host details in debug-monitors. >> However the ptrace API really wants you to attach to a process before >> calling PTRACE_GETREGSET. Currently I've tried attaching to the >> thread_id of the vCPU but this fails with EPERM, I suspect because >> attaching to your own threads likely upsets the kernel. > > Can you confirm your suspicion? This seems like a rather good approach > so we should really investigate why this doesn't work and explore ways > to get it working. >From ptrace_attach: retval = -EPERM; if (unlikely(task->flags & PF_KTHREAD)) goto out; if (same_thread_group(task, current)) goto out; I think this is what is triggering my EPERM. I'm going to dig into the history of code around that bit. While I can see it might be undesirable I'm not sure if it has to be verbotten... -- Alex Bennée -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html