linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Gustavo Luiz Duarte <gustavold@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Cc: mikey@neuling.org, gromero@linux.ibm.com,
	Gustavo Luiz Duarte <gustavold@linux.ibm.com>
Subject: Re: [PATCH v3 3/3] selftests/powerpc: Don't rely on segfault to rerun the test
Date: Thu, 26 Mar 2020 23:06:24 +1100 (AEDT)	[thread overview]
Message-ID: <48p3cK08fPz9sRN@ozlabs.org> (raw)
In-Reply-To: <20200211033831.11165-3-gustavold@linux.ibm.com>

On Tue, 2020-02-11 at 03:38:31 UTC, Gustavo Luiz Duarte wrote:
> The test case tm-signal-context-force-tm expects a segfault to happen on
> returning from signal handler, and then does a setcontext() to run the test
> again. However, the test doesn't always segfault, causing the test to run a
> single time.
> 
> This patch fixes the test by putting it within a loop and jumping, via
> setcontext, just prior to the loop in case it segfaults. This way we get the
> desired behavior (run the test COUNT_MAX times) regardless if it segfaults or
> not. This also reduces the use of setcontext for control flow logic, keeping it
> only in the segfault handler.
> 
> Also, since 'count' is changed within the signal handler, it is declared as
> volatile to prevent any compiler optimization getting confused with
> asynchronous changes.
> 
> Signed-off-by: Gustavo Luiz Duarte <gustavold@linux.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/0f8f554e5244f56f496b4ce30ada1126fe290345

cheers

  reply	other threads:[~2020-03-26 12:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  3:38 [PATCH v3 1/3] powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery Gustavo Luiz Duarte
2020-02-11  3:38 ` [PATCH v3 2/3] selftests/powerpc: Add tm-signal-pagefault test Gustavo Luiz Duarte
2020-03-26 12:06   ` Michael Ellerman
2020-02-11  3:38 ` [PATCH v3 3/3] selftests/powerpc: Don't rely on segfault to rerun the test Gustavo Luiz Duarte
2020-03-26 12:06   ` Michael Ellerman [this message]
2020-02-11 14:17 ` [PATCH v3 1/3] powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery Sasha Levin
2020-02-12  3:44 ` Michael Neuling
2020-02-19 12:39 ` 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=48p3cK08fPz9sRN@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=gromero@linux.ibm.com \
    --cc=gustavold@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.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 NNTP newsgroup(s).