All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	linux-hardening@vger.kernel.org,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: Re: mainline build failure of powerpc allmodconfig for prom_init_check
Date: Tue, 19 Jul 2022 23:35:33 +1000	[thread overview]
Message-ID: <871quhdy3e.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAHk-=wgJCTaY5FeNpcw6U-c1Z6c-A2WWQfCVa=1WW3Hdf9_eww@mail.gmail.com>

Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Sun, Jul 17, 2022 at 9:41 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> >         li 4,254                 #,
>>
>> Here we load 254 into r4, which is the 2nd parameter to memset (c).
>
> I love how even powerpc people know that "4" is bogus, and have to
> make it clear that it means "r4".

I wouldn't say it's bogus, I was just translating from asm to English :)

But I agree it's preferable to use a proper register name rather than a
bare integer. I never write asm using bare integers, I always use r4 or
%r4, because as you say it's too easy to get mixed up otherwise.

When looking at generated code I usually use objdump -d output, which
uses the "r4" syntax.

> It's not even an IBM thing. S390 uses perfectly sane register syntax,
> and calls things '%r4" etc.

as accepts that syntax if you tell it to.

We use that syntax in some of our newer inline asm blocks.

> The human-written asm files have those #define's in headers just to
> make things slightly more legible, because apparently the assembler
> doesn't even *accept* the sane names.

I would like to switch to using %rX everywhere and get rid of those
defines, but it's never seemed like it's worth the churn. We have ~48K
lines of asm in arch/powerpc.

cheers

WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Kees Cook <keescook@chromium.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-hardening@vger.kernel.org
Subject: Re: mainline build failure of powerpc allmodconfig for prom_init_check
Date: Tue, 19 Jul 2022 23:35:33 +1000	[thread overview]
Message-ID: <871quhdy3e.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CAHk-=wgJCTaY5FeNpcw6U-c1Z6c-A2WWQfCVa=1WW3Hdf9_eww@mail.gmail.com>

Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Sun, Jul 17, 2022 at 9:41 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> >         li 4,254                 #,
>>
>> Here we load 254 into r4, which is the 2nd parameter to memset (c).
>
> I love how even powerpc people know that "4" is bogus, and have to
> make it clear that it means "r4".

I wouldn't say it's bogus, I was just translating from asm to English :)

But I agree it's preferable to use a proper register name rather than a
bare integer. I never write asm using bare integers, I always use r4 or
%r4, because as you say it's too easy to get mixed up otherwise.

When looking at generated code I usually use objdump -d output, which
uses the "r4" syntax.

> It's not even an IBM thing. S390 uses perfectly sane register syntax,
> and calls things '%r4" etc.

as accepts that syntax if you tell it to.

We use that syntax in some of our newer inline asm blocks.

> The human-written asm files have those #define's in headers just to
> make things slightly more legible, because apparently the assembler
> doesn't even *accept* the sane names.

I would like to switch to using %rX everywhere and get rid of those
defines, but it's never seemed like it's worth the churn. We have ~48K
lines of asm in arch/powerpc.

cheers

  parent reply	other threads:[~2022-07-19 13:36 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14  8:55 mainline build failure of powerpc allmodconfig for prom_init_check Sudip Mukherjee (Codethink)
2022-07-14  8:55 ` Sudip Mukherjee (Codethink)
2022-07-17  9:12 ` Sudip Mukherjee
2022-07-17  9:12   ` Sudip Mukherjee
2022-07-17 14:44   ` Linus Torvalds
2022-07-17 14:44     ` Linus Torvalds
2022-07-17 19:54     ` Segher Boessenkool
2022-07-17 19:54       ` Segher Boessenkool
2022-07-18  3:52       ` Michael Ellerman
2022-07-18  3:52         ` Michael Ellerman
2022-07-18 14:56         ` Segher Boessenkool
2022-07-18 14:56           ` Segher Boessenkool
2022-07-17 20:25     ` Sudip Mukherjee
2022-07-17 20:25       ` Sudip Mukherjee
2022-07-17 20:29       ` Linus Torvalds
2022-07-17 20:29         ` Linus Torvalds
2022-07-17 20:38         ` Sudip Mukherjee
2022-07-17 20:38           ` Sudip Mukherjee
2022-07-17 20:56           ` Linus Torvalds
2022-07-17 20:56             ` Linus Torvalds
2022-07-17 20:56         ` Segher Boessenkool
2022-07-17 20:56           ` Segher Boessenkool
2022-07-17 21:11           ` Linus Torvalds
2022-07-17 21:11             ` Linus Torvalds
2022-07-17 21:45             ` Segher Boessenkool
2022-07-17 21:45               ` Segher Boessenkool
2022-07-18  1:38               ` Linus Torvalds
2022-07-18  1:38                 ` Linus Torvalds
2022-07-18  4:41   ` Michael Ellerman
2022-07-18  4:41     ` Michael Ellerman
2022-07-18  7:51     ` David Laight
2022-07-18  7:51       ` David Laight
2022-07-18 13:44     ` [PATCH] powerpc/64s: Disable stack variable initialisation for prom_init Michael Ellerman
2022-07-18 13:44       ` Michael Ellerman
2022-07-18 15:03       ` Sudip Mukherjee
2022-07-18 15:03         ` Sudip Mukherjee
2022-07-18 18:34       ` Linus Torvalds
2022-07-18 18:34         ` Linus Torvalds
2022-07-27 12:02       ` Michael Ellerman
2022-07-18 19:06     ` mainline build failure of powerpc allmodconfig for prom_init_check Linus Torvalds
2022-07-18 19:06       ` Linus Torvalds
2022-07-18 22:08       ` Segher Boessenkool
2022-07-18 22:08         ` Segher Boessenkool
2022-07-18 22:55         ` Linus Torvalds
2022-07-18 22:55           ` Linus Torvalds
2022-07-19 13:35       ` Michael Ellerman [this message]
2022-07-19 13:35         ` Michael Ellerman

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=871quhdy3e.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=torvalds@linux-foundation.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.