linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ganesh <ganeshgr@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: mikey@neuling.org, mahesh@linux.ibm.com, npiggin@gmail.com
Subject: Re: [PATCH v2 2/3] selftests/powerpc: Add test for real address error handling
Date: Thu, 26 Aug 2021 18:27:58 +0530	[thread overview]
Message-ID: <902f49c7-31d7-b174-2e99-0880bec599f3@linux.ibm.com> (raw)
In-Reply-To: <87eeagc2c1.fsf@mpe.ellerman.id.au>

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]


On 8/26/21 8:57 AM, Michael Ellerman wrote:
> Ganesh <ganeshgr@linux.ibm.com> writes:
>> On 8/24/21 6:18 PM, Michael Ellerman wrote:
>>
>>> Ganesh Goudar <ganeshgr@linux.ibm.com> writes:
>>>> Add test for real address or control memory address access
>>>> error handling, using NX-GZIP engine.
>>>>
>>>> The error is injected by accessing the control memory address
>>>> using illegal instruction, on successful handling the process
>>>> attempting to access control memory address using illegal
>>>> instruction receives SIGBUS.
>>> ...
>>>
>>>> diff --git a/tools/testing/selftests/powerpc/mce/inject-ra-err.sh b/tools/testing/selftests/powerpc/mce/inject-ra-err.sh
>>>> new file mode 100755
>>>> index 000000000000..3633cdc651a1
>>>> --- /dev/null
>>>> +++ b/tools/testing/selftests/powerpc/mce/inject-ra-err.sh
>>>> @@ -0,0 +1,18 @@
>>>> +#!/bin/bash
>>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>>> +
>>>> +if [[ ! -w /dev/crypto/nx-gzip ]]; then
>>>> +	echo "WARN: Can't access /dev/crypto/nx-gzip, skipping"
>>>> +	exit 0
>>>> +fi
>>>> +
>>>> +timeout 5 ./inject-ra-err
>>>> +
>>>> +# 128 + 7 (SIGBUS) = 135, 128 is a exit code with special meaning.
>>>> +if [ $? -ne 135 ]; then
>>>> +	echo "FAILED: Real address or Control memory access error not handled"
>>>> +	exit $?
>>>> +fi
>>>> +
>>>> +echo "OK: Real address or Control memory access error is handled"
>>>> +exit 0
>>> I don't think we really need the shell script, we should be able to do
>>> all that in the C code.
>>>
>>> Can you try this?
>> it works!, We need to set timeout, with 120 sec timeout we may flood the dmesg.
> Hmm. Does it keep faulting? The regs->nip += 4 is meant to avoid that.

Yes, it keeps faulting, if we fail to handle and not send SIGBUS to the process.

>
> cheers

[-- Attachment #2: Type: text/html, Size: 2865 bytes --]

  reply	other threads:[~2021-08-27  0:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05  9:20 [PATCH v2 1/3] powerpc/pseries: Parse control memory access error Ganesh Goudar
2021-08-05  9:20 ` [PATCH v2 2/3] selftests/powerpc: Add test for real address error handling Ganesh Goudar
2021-08-24 12:48   ` Michael Ellerman
2021-08-25 11:31     ` Ganesh
2021-08-26  3:27       ` Michael Ellerman
2021-08-26 12:57         ` Ganesh [this message]
2021-08-05  9:20 ` [PATCH v2 3/3] powerpc/mce: Modify the real address error logging messages Ganesh Goudar
2021-08-23 18:53 ` [PATCH v2 1/3] powerpc/pseries: Parse control memory access error Ganesh
2021-08-24  6:39 ` Michael Ellerman
2021-08-24 21:24   ` Segher Boessenkool
2021-08-25 11:36     ` Ganesh
2021-08-25 14:47       ` Segher Boessenkool
2021-08-25 11:03   ` Ganesh
2021-08-26  2:36     ` Michael Ellerman

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=902f49c7-31d7-b174-2e99-0880bec599f3@linux.ibm.com \
    --to=ganeshgr@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.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 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 NNTP newsgroup(s).