linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Breno Leitao <leitao@debian.org>, linuxppc-dev@lists.ozlabs.org
Cc: Breno Leitao <leitao@debian.org>
Subject: Re: [v2,1/3] selftests/powerpc: Allocate base registers
Date: Tue, 27 Nov 2018 20:22:21 +1100 (AEDT)	[thread overview]
Message-ID: <433yws366jz9s9G@ozlabs.org> (raw)
In-Reply-To: <1540996702-27161-1-git-send-email-leitao@debian.org>

On Wed, 2018-10-31 at 14:38:20 UTC, Breno Leitao wrote:
> Some ptrace selftests are passing input operands using a constraint that
> can allocate any register for the operand, and using these registers on
> load/store operations.
> 
> If the register allocated by the compiler happens to be zero (r0), it might
> cause an invalid memory address access, since load and store operations
> consider the content of 0x0 address if the base register is r0, instead of
> the content of the r0 register. For example:
> 
> 	r1 := 0xdeadbeef
> 	r0 := 0xdeadbeef
> 
> 	ld r2, 0(1) /* will load into r2 the content of r1 address */
> 	ld r2, 0(0) /* will load into r2 the content of 0x0 */
> 
> In order to avoid this possible problem, the inline assembly constraint
> should be aware that these registers will be used as a base register, thus,
> r0 should not be allocated.
> 
> Other than that, this patch removes inline assembly operands that are not
> used by the tests.
> 
> Signed-off-by: Breno Leitao <leitao@debian.org>
> Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5249497a7bb6334fcc128588d6a7e1

cheers

      parent reply	other threads:[~2018-11-27  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 14:38 [PATCH v2 1/3] selftests/powerpc: Allocate base registers Breno Leitao
2018-10-31 14:38 ` [PATCH v2 2/3] selftests/powerpc: Create a new SKIP_IF macro Breno Leitao
2018-10-31 15:44   ` Thiago Jung Bauermann
2018-10-31 14:38 ` [PATCH v2 3/3] selftests/powerpc: Skip test instead of failing Breno Leitao
2018-10-31 15:45   ` Thiago Jung Bauermann
2018-11-27  9:22 ` Michael Ellerman [this message]

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=433yws366jz9s9G@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=leitao@debian.org \
    --cc=linuxppc-dev@lists.ozlabs.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).