linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] ARM: mtd-xip: work around clang/llvm bug
Date: Tue, 9 Jul 2019 11:11:37 -0700	[thread overview]
Message-ID: <CAKwvOdnbVFQZNFaZs7Yh4C=OnR8k3CyrRc=NQEQqFvPL=Qo9Vg@mail.gmail.com> (raw)
In-Reply-To: <20190709122550.nau44z32valjd5ir@shell.armlinux.org.uk>

On Tue, Jul 9, 2019 at 5:26 AM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> On Tue, Jul 09, 2019 at 02:17:58PM +0200, Linus Walleij wrote:
> > On Mon, Jul 8, 2019 at 10:31 PM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > > -#define xip_iprefetch()        do { asm volatile (".rep 8; nop; .endr"); } while (0)
> > > +#define xip_iprefetch()        do {                                            \
> > > +        asm volatile ("nop; nop; nop; nop; nop; nop; nop; nop;");      \
> > > +} while (0)                                                            \
> >
> > This is certainly an OK fix since we use a row of inline nop at
> > other places.
> >
> > However after Russell explained the other nops I didn't understand I located
> > these in boot/compressed/head.S as this in __start:
> >
> >                 .rept   7
> >                 __nop
> >                 .endr
> > #ifndef CONFIG_THUMB2_KERNEL
> >                 mov     r0, r0
> > #else
> >
> > And certainly this gets compiled, right?
> >
> > So does .rept/.endr work better than .rep/.endr, is it simply mis-spelled?
> >
> > I.e. s/.rep/.rept/g
> > ?
> >
> > In that case we should explain in the commit that .rep doesn't work
> > but .rept does.
>
> According to the info pages for gas:
>
> 7.96 `.rept COUNT'
> ==================
>
> Repeat the sequence of lines between the `.rept' directive and the next
> `.endr' directive COUNT times.
>
> So yes, ".rep" is mis-spelled, and it brings up the obvious question:
> why isn't gas issuing an error for ".rep"?  There is no mention of
> ".rep" in the manual.

I swear I had looked this up somewhere and found that GNU as and
clang's integrated assembler supported alternative spellings for
assembly directives.  Just checked the manual
https://ftp.gnu.org/old-gnu/Manuals/gas-2.9.1/html_chapter/as_7.html#SEC116
and indeed no mention of the alternatives...must have been looking at
the source...
-- 
Thanks,
~Nick Desaulniers

      reply	other threads:[~2019-07-09 18:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 20:30 [PATCH] ARM: mtd-xip: work around clang/llvm bug Arnd Bergmann
2019-07-08 20:54 ` Nick Desaulniers
2019-07-09  8:41 ` Linus Walleij
2019-07-09  9:17   ` Russell King - ARM Linux admin
2019-07-09 11:48     ` Linus Walleij
2019-07-09 18:07   ` Nick Desaulniers
2019-07-09 18:40     ` Arnd Bergmann
2019-07-09 22:25       ` Russell King - ARM Linux admin
2019-07-10  8:33         ` Arnd Bergmann
2019-07-10  8:58           ` Russell King - ARM Linux admin
2019-07-09 12:17 ` Linus Walleij
2019-07-09 12:25   ` Russell King - ARM Linux admin
2019-07-09 18:11     ` Nick Desaulniers [this message]

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='CAKwvOdnbVFQZNFaZs7Yh4C=OnR8k3CyrRc=NQEQqFvPL=Qo9Vg@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /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).