public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] S390: Sync ptrace.h with kernel. [BZ #21539]
Date: Mon, 19 Jun 2017 14:34:00 -0000	[thread overview]
Message-ID: <03ef9dd8-0bf0-9747-ad8e-87aae15dfe6b@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170619132645.GA10947@altlinux.org>

On 06/19/2017 03:26 PM, Dmitry V. Levin wrote:
> On Mon, Jun 19, 2017 at 03:10:57PM +0200, Stefan Liebler wrote:
>> On 06/13/2017 10:05 PM, Dmitry V. Levin wrote:
>>> On Tue, Jun 06, 2017 at 12:17:33PM +0200, Stefan Liebler wrote:
>>> [...]
>>>> diff --git a/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c b/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c
>>>> new file mode 100644
>>   >> [...]
>>>> +      /* Get information about tracee: gprs, last breaking address.  */
>>>> +      parea.len = sizeof (regs);
>>>> +      parea.process_addr = (unsigned long) &regs;
>>>> +      parea.kernel_addr = 0;
>>>> +      ptrace (PTRACE_PEEKUSR_AREA, pid, &parea);
>>>
>>> Note that you can verify whether PTRACE_PEEKUSR_AREA has returned
>>> the expected result by comparing registers with those returned
>>> by PTRACE_GETREGSET.  The latter is implemented on s390 since
>>> linux 2.6.27 so its use in glibc is safe.
>>>
>> Okay. Now the gprs are obtained by PTRACE_PEEKUSR_AREA and
>> PTRACE_GETREGSET. Afterwards I use memcmp to check whether the values
>> are the same.
>>>> +      ptrace (PTRACE_GET_LAST_BREAK, pid, NULL, &last_break);
>>>
>>> As these ptrace calls are expected to succeed,
>>> you might want to check their return code.
>>>
>> Done with several usages of TEST_VERIFY_EXIT.
>>
>>>> +
>>>> +      printf ("child IA: %p last_break: %p\n",
>>>> +	      (void *) regs[1], (void *) last_break);
>>>> +
>>>> +      /* Execute tracee until next taken branch.
>>>> +
>>>> +	 Note:
>>>> +	 Before the commit which introduced this testcase,
>>>> +	 <glibc>/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
>>>> +	 uses ptrace-request 12 for PTRACE_GETREGS,
>>>> +	 but <kernel>/include/uapi/linux/ptrace.h
>>>> +	 uses 12 for PTRACE_SINGLEBLOCK.
>>>> +
>>>> +	 The s390 kernel has no support for PTRACE_GETREGS!
>>>> +	 Thus glibc ptrace.h is adjusted to match kernel ptrace.h.
>>>> +
>>>> +	 This test ensures, that PTRACE_SINGLEBLOCK defined in glibc
>>>> +	 works as expected.  If the kernel would interpret it as
>>>> +	 PTRACE_GETREGS, then the tracee will not make any progress
>>>> +	 and this testcase will time out.  */
>>>> +      ptrace (req_singleblock, pid, NULL, NULL);
>>>
>>> Likewise.
>>
>> I've attached the patch with the mentioned changes and the NEWS entry
>> requested by Andreas.
>>
>> Is this okay?
> 
> Looks fine, thanks.
> 
> 
Committed.

Thanks.
Stefan

  reply	other threads:[~2017-06-19 14:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 10:17 Stefan Liebler
2017-06-06 10:44 ` Andreas Schwab
2017-06-06 10:58   ` Dmitry V. Levin
2017-06-06 11:56   ` Stefan Liebler
2017-06-08 12:02     ` Stefan Liebler
2017-06-13 20:05 ` Dmitry V. Levin
2017-06-19 13:11   ` Stefan Liebler
2017-06-19 13:26     ` Dmitry V. Levin
2017-06-19 14:34       ` Stefan Liebler [this message]
2017-06-30 10:09     ` Florian Weimer
2017-07-04  8:22       ` Stefan Liebler
2017-07-04  9:41         ` Florian Weimer
2017-07-04 15:37           ` Stefan Liebler
2017-07-07 10:22             ` Stefan Liebler
2017-07-07 10:45               ` Florian Weimer
2017-07-07 13:54                 ` Stefan Liebler
2017-07-11  8:39                   ` Stefan Liebler
2017-07-18 10:20     ` Dmitry V. Levin
2017-07-18 13:31       ` Carlos O'Donell
2017-07-18 13:39         ` Dmitry V. Levin
2017-07-18 14:11           ` Carlos O'Donell
2017-07-18 14:28             ` Mark Wielaard
2017-07-18 14:40               ` Mark Wielaard
2017-07-20  7:38             ` Stefan Liebler
2017-07-20  8:07               ` Carlos O'Donell
2017-07-20  8:32                 ` Stefan Liebler
2017-07-24  3:51                   ` Dmitry V. Levin
2017-07-24  7:18                     ` Stefan Liebler
2017-07-18 13:41       ` Stefan Liebler
2017-07-18 14:12         ` Carlos O'Donell
2017-07-18 14:16         ` Dmitry V. Levin
2017-07-19  8:40           ` Stefan Liebler

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=03ef9dd8-0bf0-9747-ad8e-87aae15dfe6b@linux.vnet.ibm.com \
    --to=stli@linux.vnet.ibm.com \
    --cc=libc-alpha@sourceware.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).