From: "Alex Bennée" <alex.bennee@linaro.org>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
kvmarm@slist.cs.columbia.edu,
KVM devel mailing list <kvm@vger.kernel.org>
Subject: Re: Exposing host debug capabilities to userspace
Date: Fri, 21 Nov 2014 11:23:19 +0000 [thread overview]
Message-ID: <87y4r4dcgo.fsf@linaro.org> (raw)
In-Reply-To: <20141121100823.GT19598@cbox>
Christoffer Dall <christoffer.dall@linaro.org> 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
next prev parent reply other threads:[~2014-11-21 11:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 16:55 Exposing host debug capabilities to userspace Alex Bennée
2014-11-21 10:08 ` Christoffer Dall
2014-11-21 10:29 ` Alex Bennée
2014-11-21 11:23 ` Alex Bennée [this message]
[not found] ` <87egssn91o.fsf@zen.linaro.local.i-did-not-set--mail-host-address--so-tickle-me>
2014-11-24 11:21 ` Peter Maydell
2014-11-24 12:20 ` Christoffer Dall
2014-11-24 11:35 ` Alex Bennée
2014-11-24 12:26 ` Alexander Graf
2014-11-24 12:32 ` Peter Maydell
2014-11-24 12:41 ` Alexander Graf
2014-11-24 12:44 ` Peter Maydell
2014-11-24 12:51 ` Alexander Graf
2014-11-24 12:53 ` Christoffer Dall
2014-11-24 12:56 ` Alexander Graf
2014-11-24 13:10 ` Christoffer Dall
2014-11-24 14:07 ` Alexander Graf
2014-11-24 14:52 ` Christoffer Dall
2014-11-25 16:44 ` Paolo Bonzini
2014-11-24 12:53 ` Alex Bennée
2014-11-24 12:54 ` Christoffer Dall
2014-11-24 13:59 ` Alex Bennée
2014-11-25 16:21 ` Paolo Bonzini
2014-11-25 16:35 ` Alexander Graf
2014-11-25 16:50 ` Paolo Bonzini
2014-11-26 12:11 ` Alex Bennée
2014-11-26 12:23 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4r4dcgo.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=christoffer.dall@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@slist.cs.columbia.edu \
--cc=marc.zyngier@arm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.