LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Ram Pai <linuxram@us.ibm.com>,
	Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers
Date: Thu, 24 May 2018 23:14:27 -0300	[thread overview]
Message-ID: <874liwqy64.fsf@morokweng.localdomain> (raw)
In-Reply-To: <87tvr6mlbe.fsf@concordia.ellerman.id.au>


Michael Ellerman <mpe@ellerman.id.au> writes:

> Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> writes:
>
>> This test exercises read and write access to the AMR, IAMR and UAMOR.
>>
>> Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
>> ---
>>  tools/testing/selftests/powerpc/include/reg.h      |   1 +
>>  tools/testing/selftests/powerpc/ptrace/Makefile    |   5 +-
>>  tools/testing/selftests/powerpc/ptrace/child.h     | 130 ++++++++
>>  .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 326 +++++++++++++++++++++
>
> This is failing on machines without pkeys:
>
>   test: ptrace_pkey
>   tags: git_version:52e7d87
>   [FAIL] Test FAILED on line 117
>   [FAIL] Test FAILED on line 191
>   failure: ptrace_pkey
>
>
> I think the first fail is in the child here:
>
> int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[],
> 		     int n)
> {
> 	struct iovec iov;
> 	long ret;
>
> 	FAIL_IF(start_trace(child));
>
> 	iov.iov_base = regs;
> 	iov.iov_len = n * sizeof(unsigned long);
>
> 	ret = ptrace(PTRACE_GETREGSET, child, type, &iov);
> 	FAIL_IF(ret != 0);
>
>
> Which makes sense.

Yes, that is indeed what is going on.

> The test needs to skip if pkeys are not available/enabled. Using the
> availability of the REGSET might actually be a nice way to detect that,
> because it's read-only.

 I forgot to consider the case of pkeys not available or not enabled,
 sorry about that.

I just sent a v2 which implements your suggestion above.

--
Thiago Jung Bauermann
IBM Linux Technology Center

  reply	other threads:[~2018-05-25  2:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 18:33 [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers Thiago Jung Bauermann
2018-02-23 18:33 ` [PATCH 2/2] selftests/powerpc: Add core file test " Thiago Jung Bauermann
2018-02-23 18:51   ` Ram Pai
2018-05-17 14:03   ` Michael Ellerman
2018-02-23 18:50 ` [PATCH 1/2] selftests/powerpc: Add ptrace tests " Ram Pai
2018-03-27 17:35   ` Thiago Jung Bauermann
2018-05-17 14:03 ` Michael Ellerman
2018-05-25  2:14   ` Thiago Jung Bauermann [this message]
2018-05-25 10:26     ` Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2018-01-26  5:55 [PATCH 0/2] Testcases for protection keys feature in powerpc/next Thiago Jung Bauermann
2018-01-26  5:55 ` [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers Thiago Jung Bauermann

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=874liwqy64.fsf@morokweng.localdomain \
    --to=bauerman@linux.ibm.com \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=linuxram@us.ibm.com \
    --cc=mpe@ellerman.id.au \
    /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