All of lore.kernel.org
 help / color / mirror / Atom feed
From: petrcvekcz@gmail.com (Petr Cvek)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM: pxa/corgi: armv5te kernel 4.12 fails to decompress compiled with gcc7
Date: Wed, 18 Oct 2017 13:12:18 +0200	[thread overview]
Message-ID: <d994b39f-32bc-e073-ac11-8189ab3d250f@gmail.com> (raw)
In-Reply-To: <20171018104432.GR20805@n2100.armlinux.org.uk>



Dne 18.10.2017 v 12:44 Russell King - ARM Linux napsal(a):
> On Wed, Oct 18, 2017 at 12:39:13PM +0200, Petr Cvek wrote:
>>
>>
>> Dne 17.10.2017 v 10:18 Andrea Adami napsal(a):
>>> On Tue, Oct 17, 2017 at 10:10 AM, Petr Cvek <petrcvekcz@gmail.com> wrote:
>>>> If it is a problem with gcc (as Russell said before), there is no way you
>>>> can fix it in the kernel. Only compiling it with an older gcc version can
>>>> help.
>>>>
>>
>> BTW you could add "alignment=2" (same as /proc/cpu/alignment) in your kernel
>> parameters and kernel should check it even before you boot userspace.
>>
>> But it will be *extra* slow as there will be many exceptions in the kernel
>> and an emulation of the unaligned instructions. It is not a real permanent
>> fix.
> 
> That's wrong.
> 
> Alignment exceptions are always fixed up in the kernel.  The parameter
> (and what you set by writing /proc/cpu/alignment) sets the behaviour of
> _userspace_ alignment exceptions.

Oh sorry I didn't realize the problem is in the kernel decompressor. I 
thought it fails later in the kernel (for me first code which freezed 
was init).

> 
>> It should be possible to use up to march=armv5t as I elaborated it in the
>> other mail.
> 
> If you're building for PXA, it's an ARMv5 architecture.  The kernel will
> use -march=armv5te for all ARMv5 architectures.  Moreover, because one
> of the PXA2* symbols should also be selected, CPU_XSCALE will also be
> enabled, which means we will pass -mtune=xscale to the compiler.
> 
> The exception is if CPU_FEROCEON is enabled, in which case we will pass
> -mtune=marvell-f to the kernel if supported by the compiler.
> 

Yeah I know that, but forcing an older arch version would help as the 
7.1.0 code for armv5t is probably faster than armv4 (and certainly 
faster than gcc 6.3.0). Moreover as I tested armv5te/xscale (in 7.1.0) 
doesn't even generate the STRD bug (but it is slower than armv5t).

BTW if you compile kernel with 6.x (my testcase), then if you compile 
the userspace with armv5t (7.x) it will be faster. If you compile the 
userspace with armv5te (7.x) you still need the kernel parameter, 
because an unaligned access may corrupt init (possibly my testcase).

Petr

  reply	other threads:[~2017-10-18 11:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 13:13 ARM: pxa/corgi: armv5te kernel 4.12 fails to decompress compiled with gcc7 Andrea Adami
2017-07-20  6:57 ` Robert Jarzmik
2017-09-02 21:50   ` Andrea Adami
2017-10-14 21:50     ` Aaro Koskinen
2017-10-14 21:57       ` Robert Jarzmik
2017-10-15 10:46         ` Aaro Koskinen
2017-10-15 13:01           ` Russell King - ARM Linux
2017-10-15 15:14             ` Aaro Koskinen
2017-10-16 11:55           ` Petr Cvek
2017-10-17  8:02             ` Andrea Adami
2017-10-17  8:10               ` Petr Cvek
2017-10-17  8:18                 ` Andrea Adami
2017-10-18 10:39                   ` Petr Cvek
2017-10-18 10:44                     ` Russell King - ARM Linux
2017-10-18 11:12                       ` Petr Cvek [this message]
2017-10-24  8:34                         ` Andrea Adami
2017-10-24  8:43                           ` Andrea Adami
2017-10-17 20:33             ` Aaro Koskinen
2017-10-18  9:57               ` Petr Cvek
2017-10-14 22:00       ` Petr Cvek

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=d994b39f-32bc-e073-ac11-8189ab3d250f@gmail.com \
    --to=petrcvekcz@gmail.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 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.