All of lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Gustavo Romero <gromero@linux.vnet.ibm.com>
Cc: mikey@neuling.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] selftests/powerpc: Fix earlyclobber in tm-vmxcopy
Date: Tue, 18 Jun 2019 07:00:59 -0500	[thread overview]
Message-ID: <20190618120059.GJ7313@gate.crashing.org> (raw)
In-Reply-To: <1560806698-26651-1-git-send-email-gromero@linux.vnet.ibm.com>

On Mon, Jun 17, 2019 at 05:24:58PM -0400, Gustavo Romero wrote:
> In some cases, compiler can allocate the same register for operand 'res'
> and 'vecoutptr', resulting in segfault at 'stxvd2x 40,0,%[vecoutptr]'
> because base register will contain 1, yielding a false-positive.
> 
> This is because output 'res' must be marked as an earlyclobber operand so
> it may not overlap an input operand ('vecoutptr').
> 
> Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>

Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>


Segher


> ---
>  tools/testing/selftests/powerpc/tm/tm-vmxcopy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/powerpc/tm/tm-vmxcopy.c b/tools/testing/selftests/powerpc/tm/tm-vmxcopy.c
> index 147c6dc..c1e788a 100644
> --- a/tools/testing/selftests/powerpc/tm/tm-vmxcopy.c
> +++ b/tools/testing/selftests/powerpc/tm/tm-vmxcopy.c
> @@ -79,7 +79,7 @@ int test_vmxcopy()
>  
>  		"5:;"
>  		"stxvd2x 40,0,%[vecoutptr];"
> -		: [res]"=r"(aborted)
> +		: [res]"=&r"(aborted)
>  		: [vecinptr]"r"(&vecin),
>  		  [vecoutptr]"r"(&vecout),
>  		  [map]"r"(a)
> -- 
> 2.7.4

  reply	other threads:[~2019-06-18 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 21:24 [PATCH] selftests/powerpc: Fix earlyclobber in tm-vmxcopy Gustavo Romero
2019-06-18 12:00 ` Segher Boessenkool [this message]
2019-06-30  8:37 ` 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=20190618120059.GJ7313@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gromero@linux.vnet.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 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.