linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Paul Mackerras <paulus@ozlabs.org>, linuxppc-dev@ozlabs.org
Subject: Re: powerpc: Don't try to fix up misaligned load-with-reservation instructions
Date: Thu,  6 Apr 2017 23:09:04 +1000 (AEST)	[thread overview]
Message-ID: <3vzNMN6qw4z9s8S@ozlabs.org> (raw)
In-Reply-To: <20170404045605.gmr2uqelm3uxouwt@oak.ozlabs.ibm.com>

On Tue, 2017-04-04 at 04:56:05 UTC, Paul Mackerras wrote:
> In the past, there was only one load-with-reservation instruction,
> lwarx, and if a program attempted a lwarx on a misaligned address, it
> would take an alignment interrupt and the kernel handler would emulate
> it as though it was lwzx, which was not really correct, but benign
> since it is loading the right amount of data, and the lwarx should be
> paired with a stwcx. to the same address, which would also cause an
> alignment interrupt which would result in a SIGBUS being delivered to
> the process.
> 
> We now have 5 different sizes of load-with-reservation instruction.
> Of those, lharx and ldarx cause an immediate SIGBUS by luck since
> their entries in aligninfo[] overlap instructions which were not
> fixed up, but lqarx overlaps with lhz and will be emulated as such.
> lbarx can never generate an alignment interrupt since it only
> operates on 1 byte.
> 
> To straighten this out and fix the lqarx case, this adds code to
> detect the l[hwdq]arx instructions and return without fixing them
> up, resulting in a SIGBUS being delivered to the process.
> 
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/48fe9e9488743eec9b7c1addd3c93f

cheers

      reply	other threads:[~2017-04-06 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  4:56 [PATCH] powerpc: Don't try to fix up misaligned load-with-reservation instructions Paul Mackerras
2017-04-06 13:09 ` 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=3vzNMN6qw4z9s8S@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@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).