From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [ALTERNATIVE] ARM: fix copypage functions for clang
Date: Wed, 17 Oct 2018 10:35:08 +0100 [thread overview]
Message-ID: <20181017093508.GG30658@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20181017090417.833924-1-arnd@arndb.de>
On Wed, Oct 17, 2018 at 11:04:17AM +0200, Arnd Bergmann wrote:
> The constraints were originally added in commit 9a40ac86152c ("ARM:
> 6164/1: Add kto and kfrom to input operands list.") as a gcc-4.5
> workaround. Another workaround for the same problem was added in commit
> 9c695203a7dd ("compiler-gcc.h: gcc-4.5 needs noclone and noinline
> on __naked functions") and should have obsoleted the first one.
That is an incorrect statement - please read the discussion back then,
particularly Mikael Pettersson's reply:
"I've tested and verified that this bit enables a gcc-4.5 compiled kernel
to boot on TS-119 (Kirkwood) when combined with my fix for __naked.
With neither or only one of the patches applied, the kernel oopses hard
in copy_user_page() as it tries to start /sbin/init."
That is very clear that it is not "one or the other" patch, and it's
certainly not true that one patch obsoletes the other.
Mikael is also very clear in the effects that are going on - to re-quote
what I've already quoted (and clearly you missed):
"- the asm() bodies of these __naked functions have inadequate input
parameter constraints, in particular they fail to declare any
dependencies on the functions' formal parameters; gcc-4.5 sees this
and skips the parameter setup before calling these functions, causing
runtime crashes"
This description makes it clear that it's not the naked function that
is wrong, but the function that _calls_ the naked function - stating
that GCC fails to setup the parameters _for_ _the_ _called_ _naked_
_function_.
So, there are two issues here:
1. gcc-4.5 has been observed to clone and inline naked functions, which
you claim has been fixed.
2. gcc-4.5 fails to setup parameters for naked functions, which we have
no idea whether it's been fixed.
> I've used this on my randconfig build setup, and it makes all
> configurations build without warnings, but I have not done
> any runtime testing on it.
Since the problem has always been a runtime issue, a build-only test is
insufficient.
Sorry, but no, this is way too risky in its current form.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
next prev parent reply other threads:[~2018-10-17 9:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 22:16 [PATCH 1/2] ARM: copypage-fa: add kto and kfrom to input operands list Stefan Agner
2018-10-15 22:23 ` Russell King - ARM Linux
2018-10-15 22:39 ` Stefan Agner
2018-10-15 22:46 ` Russell King - ARM Linux
2018-10-15 22:52 ` Stefan Agner
2018-10-15 23:03 ` Russell King - ARM Linux
2018-10-16 8:00 ` Linus Walleij
2018-10-16 8:44 ` Russell King - ARM Linux
2018-10-16 11:35 ` Linus Walleij
2018-10-16 20:43 ` Nicolas Pitre
2018-10-16 21:59 ` Stefan Agner
2018-10-17 8:58 ` Arnd Bergmann
2018-10-17 9:04 ` [PATCH] [ALTERNATIVE] ARM: fix copypage functions for clang Arnd Bergmann
2018-10-17 9:35 ` Russell King - ARM Linux [this message]
2018-10-17 14:23 ` [PATCH 1/2] ARM: copypage-fa: add kto and kfrom to input operands list Nicolas Pitre
2018-11-05 23:00 ` Stefan Agner
2018-11-06 4:49 ` Nicolas Pitre
2018-11-06 13:16 ` Robin Murphy
2018-11-06 13:25 ` Nicolas Pitre
2018-11-07 16:27 ` Stefan Agner
2018-11-07 16:58 ` Nicolas Pitre
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=20181017093508.GG30658@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--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).