mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, arm@kernel.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH] ARM: makefile: pass -march=armv4 to assembler even on CPU32v3
Date: Mon, 1 Oct 2018 18:56:22 +0100	[thread overview]
Message-ID: <20181001175622.GT30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20180930024904.14240-1-Jason@zx2c4.com>

On Sun, Sep 30, 2018 at 04:49:04AM +0200, Jason A. Donenfeld wrote:
> Per the discussion about half-way down in [1], the kernel doesn't
> actually support the ARMv3 ISA, but selects it for some ARMv4 ISA
> hardware that benefits from ARMv3 code generation.

The issue is to do with the half-word stores in the ARMv4 ISA, which
need to be avoided on StrongARM RiscPC - the bus from the processor
card (which was designed for ARM610 and ARM710) does not support
anything except 8-bit and 32-bit accesses, so the 16-bit load/store
instructions don't work correctly.

Obviously, the reason for having the compiler use ARMv3 is to avoid
those instructions which we have no other way to prevent - however,
the use of ARMv3 with the assembler ensures that ldrh/strh are not
accidentally used.

We could argue that the ARMv3 assembly files are now stable, so the
chances of ldrh/strh being introduced is low, which would make this
change tolerable, but the commit message needs to spell out that
we lose this protection.

> Such a consideration,
> then, only applies to the compiler but not to the assembler. This commit
> passes -march=armv4 to the assembler in those cases, so that code
> written for ARMv4 will continue to compile and run fine, without needing
> module-specific asflags-y overrides.

Note that "code written for ARMv4" will not be usable on this platform
if it makes use of ldrh/strh, so depending on which instructions the
assembler is complaining about, it could very well be a real "you're
doing something wrong" case.

The side effect of this patch is that such cases will now be hidden
rather than evaluated on a case-by-case basis.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 14.8Mbps down 650kbps up
According to speedtest.net: 13Mbps down 490kbps up

  parent reply	other threads:[~2018-10-01 17:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-30  2:49 Jason A. Donenfeld
2018-10-01 15:13 ` Arnd Bergmann
2018-10-02  3:53   ` Jason A. Donenfeld
2018-10-02  5:39     ` Ard Biesheuvel
2018-10-02  7:51     ` Arnd Bergmann
2018-10-02  9:16       ` Ard Biesheuvel
2018-10-02 12:30       ` Jason A. Donenfeld
2018-10-02 13:10         ` Ard Biesheuvel
2018-10-02 13:12           ` Jason A. Donenfeld
2018-10-02 13:20           ` [PATCH] ARM: makefile: use ARMv3M mode for RiscPC Jason A. Donenfeld
2018-10-02 13:28             ` Ard Biesheuvel
2018-10-02 13:53               ` Arnd Bergmann
2018-10-02 14:02                 ` Jason A. Donenfeld
2018-10-01 17:56 ` Russell King - ARM Linux [this message]
2018-10-01 18:10   ` [PATCH] ARM: makefile: pass -march=armv4 to assembler even on CPU32v3 Ard Biesheuvel
2018-10-01 18:13     ` Russell King - ARM Linux
2018-10-02  3:56     ` Jason A. Donenfeld
2018-10-02  4:08     ` Jason A. Donenfeld

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=20181001175622.GT30658@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Jason@zx2c4.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arm@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®