lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Feb 2018 17:29:01 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Robin Murphy <robin.murphy@....com>
Cc:     Christoffer Dall <christoffer.dall@...aro.org>,
        Marc Zyngier <marc.zyngier@....com>,
        Russell King <linux@...linux.org.uk>,
        Andi Kleen <ak@...ux.intel.com>,
        Julien Thierry <julien.thierry@....com>,
        Nicolas Pitre <nico@...aro.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "# 3.4.x" <stable@...r.kernel.org>,
        Richard Earnshaw <rearnsha@....gnu.org>,
        Tamar Christina <tnfchris@....gnu.org>,
        kvmarm@...ts.cs.columbia.edu,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 1/2] ARM: kvm: fix building with gcc-8

On Fri, Feb 2, 2018 at 5:23 PM, Robin Murphy <robin.murphy@....com> wrote:
> On 02/02/18 15:55, Robin Murphy wrote:
>>
>> On 02/02/18 15:07, Arnd Bergmann wrote:
>>>
>>> In banked-sr.c, we use a top-level '__asm__(".arch_extension virt")'
>>> statement to allow compilation of a multi-CPU kernel for ARMv6
>>> and older ARMv7-A that don't normally support access to the banked
>>> registers.
>>>
>>> This is considered to be a programming error by the gcc developers
>>> and will no longer work in gcc-8, where we now get a build error:
>>>
>>> /tmp/cc4Qy7GR.s:34: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,SP_usr'
>>> /tmp/cc4Qy7GR.s:41: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,ELR_hyp'
>>> /tmp/cc4Qy7GR.s:55: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,SP_svc'
>>> /tmp/cc4Qy7GR.s:62: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,LR_svc'
>>> /tmp/cc4Qy7GR.s:69: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,SPSR_svc'
>>> /tmp/cc4Qy7GR.s:76: Error: Banked registers are not available with this
>>> architecture. -- `mrs r3,SP_abt'
>>>
>>> Passign the '-march-armv7ve' flag to gcc works, and is ok here, because
>>> we know the functions won't ever be called on pre-ARMv7VE machines.
>>> Unfortunately, older compiler versions (4.8 and earlier) do not
>>> understand
>>> that flag, so we still need to keep the asm around.
>>>
>>> Backporting to stable kernels (4.6+) is needed to allow those to be built
>>> with future compilers as well.
>>
>>
>> Is "-Wa,arch=armv7-a+virt" (as we appear to do for a couple of files
>> already) viable as a possibly cleaner alternative, or is GCC itself now
>> policing the contents of inline asms?
>
>
> In fact, looking at the binutils history, any version capable of assembling
> this file should understand that (modulo my typo), so hopefully it ought to
> be feasible to replace these global asms with assembler flags entirely.

No, this only works for .S files, not .c, since gcc starts the output with
an explicit .arch setting that overrides the command line. I think this
was done intentionally to prevent such a hack from working, and have
more reliable checks on the validity of the assembler instruction in
inline asm statements (which we try to circumvent here).

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ