linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: Android and compatibility with deprecated armv7 instructions
Date: Fri, 4 Jul 2014 09:24:37 +0100	[thread overview]
Message-ID: <20140704082437.GA16404@arm.com> (raw)
In-Reply-To: <CAKv+Gu-taih4ZdWkmup5JVSeWhcYbatzoHqra+=+bdZorTBCvg@mail.gmail.com>

On Fri, Jul 04, 2014 at 08:08:05AM +0100, Ard Biesheuvel wrote:
> On 4 July 2014 00:47, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > On Thu, Jul 03, 2014 at 11:16:16PM +0100, M?ns Rullg?rd wrote:
> >> Will Deacon <will.deacon@arm.com> writes:
> >>
> >> > On Thu, Jul 03, 2014 at 06:05:58PM +0100, Russell King - ARM Linux wrote:
> >> >> On Thu, Jul 03, 2014 at 05:22:30PM +0100, Grant Likely wrote:
> >> >> > So, no. I completely reject any notion that breaking existing apps is
> >> >> > okay. If we're going to say that v8 still supports 32-bit apps, then
> >> >> > it has to be all of v7, not just the 'good' bits. Nor do I think
> >> >> > saying "it's just a bunch of games" justifies anything. We're kernel
> >> >> > engineers. Applications are applications and we don't break userspace.
> >> >> > Period.
> >> >>
> >> >> +1 on all points above.  I'd go further - if we're going to say that v8
> >> >> still supports 32-bit apps, that covers at least v6 *as well*.
> >> >
> >> > We've never pretended to support anything other than ARMv8 in the compat
> >> > layer. uname even reports this in the machine name.
> >> >
> >> > If people are suddenly so concerned about *full* compatibility with an ARMv7
> >> > kernel, that needs a lot more than just SWP emulation:
> >> >
> >> >   - Alignment fixups for ldm/stm
> >>
> >> No ARM variant ever supported unaligned ldm/stm.
> >
> > Quite right but that's not the point being discussed.  Please note that
> > the sentence says "with an ARMv7 *kernel*" - we are not talking about
> > the architecture there.
> >
> > So, what's more to the point is that on 32-bit ARM userspace under Linux,
> > we _have_ supported it since early 2000 up to present.  It's not currently
> > supported on 64-bit ARM running Linux, even when running a 32-bit binary
> > in userspace.
> >
> > Ergo, it's a user visible ABI change, one which we don't know whether it
> > matters.  In all probability, it doesn't because (hopefully) no one ever
> > does unaligned LDMs/STMs - I think it would require hand-crafted assembly,
> > at which point you're talking about optimising something, and you'd be
> > silly to do it as it would invoke the alignment fault handling which
> > would be slow.
> >
> 
> Well, if something like this
> 
> struct bar {
>     long l[4];
> };
> 
> void foo(struct bar *dst, struct bar const *src)
> {
>     *dst = *src;
> }
> 
> produces this:
> 
> foo:
> @ args = 0, pretend = 0, frame = 0
> @ frame_needed = 0, uses_anonymous_args = 0
> @ link register save eliminated.
>     mov ip, r0
>     ldmia r1, {r0, r1, r2, r3}
>     stmia ip, {r0, r1, r2, r3}
>     bx lr
> 
> won't it take just a single cast from some unaligned char* to struct
> bar* to trigger this?

Is this even allowed by the C ABI? The compiler generates the LDMs
because function foo() gets a struct pointer which is guaranteed to be
aligned.

-- 
Catalin

  reply	other threads:[~2014-07-04  8:24 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 23:06 Android and compatibility with deprecated armv7 instructions Colin Cross
2014-07-01 23:42 ` Olof Johansson
2014-07-01 23:48   ` Mark Brown
2014-07-02 10:01     ` Will Deacon
2014-07-02 15:48       ` Colin Cross
2014-07-02 16:16         ` Will Deacon
2014-07-02 18:03           ` Christopher Covington
2014-07-02 18:25             ` Will Deacon
2014-07-02 19:47               ` Mark Brown
2014-07-05 21:26           ` Rob Herring
2014-07-02 16:39       ` Mark Brown
2014-07-02 17:01         ` Will Deacon
2014-07-02 17:33           ` Mark Brown
2014-07-02 22:14           ` Grant Likely
2014-07-03 10:41             ` Catalin Marinas
2014-07-03 14:28               ` Arnd Bergmann
2014-07-03 15:00                 ` Russell King - ARM Linux
2014-07-03 15:40                   ` Grant Likely
2014-07-03 17:13                   ` Catalin Marinas
2014-07-03 17:48                     ` Russell King - ARM Linux
2014-07-03 18:15                     ` Arnd Bergmann
2014-07-03 18:30                       ` Russell King - ARM Linux
2014-07-03 18:37                         ` Will Deacon
2014-07-03 18:52                           ` Russell King - ARM Linux
2014-07-03 19:00                             ` Will Deacon
2014-07-04  8:57                         ` Catalin Marinas
2014-07-04  9:25                           ` Russell King - ARM Linux
2014-07-04 10:12                             ` Arnd Bergmann
2014-07-04 14:09                               ` Dr. David Alan Gilbert
2014-07-04 12:56                             ` Grant Likely
2014-07-04 13:31                               ` Russell King - ARM Linux
2014-07-03 18:46                       ` Will Deacon
2014-07-03 18:53                         ` Arnd Bergmann
2014-07-03 19:07                           ` Russell King - ARM Linux
2014-07-03 19:40                             ` Arnd Bergmann
2014-07-04 13:25                     ` Grant Likely
2014-07-03 16:22               ` Grant Likely
2014-07-03 17:05                 ` Russell King - ARM Linux
2014-07-03 17:32                   ` Will Deacon
2014-07-03 18:23                     ` Arnd Bergmann
2014-07-03 18:38                       ` Peter Maydell
2014-07-03 18:40                       ` Will Deacon
2014-07-03 18:32                     ` Mark Brown
2014-07-03 22:16                     ` Måns Rullgård
2014-07-03 22:47                       ` Russell King - ARM Linux
2014-07-04  7:08                         ` Ard Biesheuvel
2014-07-04  8:24                           ` Catalin Marinas [this message]
2014-07-04  8:33                             ` Ard Biesheuvel
2014-07-04  9:21                               ` Måns Rullgård
2014-07-04  9:34                                 ` Russell King - ARM Linux
2014-07-04 10:21                                   ` Måns Rullgård
2014-07-04 10:33                                     ` Russell King - ARM Linux
2014-07-04 11:00                                       ` Ard Biesheuvel
2014-07-04 17:28                                         ` Nicolas Pitre
2014-07-03 17:43                 ` Catalin Marinas
2014-07-04 13:22                   ` Grant Likely
2014-07-04 19:24                     ` Mark Brown
2014-07-04 19:33                       ` Arnd Bergmann
2014-07-04 22:06                         ` Måns Rullgård
2014-07-04 22:08                         ` Mark Brown
2014-07-05 11:14                     ` Catalin Marinas
2014-07-05 11:25                       ` Russell King - ARM Linux
2014-07-05 16:43                       ` Mark Brown
2014-07-05 17:06                         ` Catalin Marinas
2014-07-05 18:43                           ` Arnd Bergmann
2014-07-05 21:19                             ` Catalin Marinas
2014-07-06 15:39                               ` Arnd Bergmann
2014-07-07 13:59                                 ` Janne Grunau
2014-07-07 14:52                                   ` Catalin Marinas
2014-07-07 17:52                                     ` Janne Grunau
2014-07-07 15:43                                   ` Peter Maydell
2014-07-08  5:28                                   ` Måns Rullgård
2014-07-07 14:35                                 ` Catalin Marinas
2014-07-07 21:26                                   ` Arnd Bergmann
2014-07-07 12:28                       ` Grant Likely
2014-07-07 18:35                         ` Colin Cross

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=20140704082437.GA16404@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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).