From: Yury Norov <yury.norov@gmail.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
linux-kernel@vger.kernel.org, Alan Modra <amodra@au1.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
linuxppc-dev@lists.ozlabs.org, Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH] powerpc/64: don't refer nr_cpu_ids in asm code when it's undefined
Date: Tue, 20 Sep 2022 15:41:23 -0700 [thread overview]
Message-ID: <YypBk2gtlVCUBNXx@yury-laptop> (raw)
In-Reply-To: <20220921082006.2235b7d2@canb.auug.org.au>
On Wed, Sep 21, 2022 at 08:20:06AM +1000, Stephen Rothwell wrote:
> Hi Yury,
>
> On Tue, 20 Sep 2022 08:29:35 -0700 Yury Norov <yury.norov@gmail.com> wrote:
> >
>
> > diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> > index cf2c08902c05..7cb97881635e 100644
> > --- a/arch/powerpc/kernel/head_64.S
> > +++ b/arch/powerpc/kernel/head_64.S
> > @@ -400,7 +400,11 @@ generic_secondary_common_init:
> > #else
> > LOAD_REG_ADDR(r8, paca_ptrs) /* Load paca_ptrs pointe */
> > ld r8,0(r8) /* Get base vaddr of array */
> > +#if (NR_CPUS == 1) || defined(CONFIG_FORCE_NR_CPUS)
> > + LOAD_REG_IMMEDIATE(r7, NR_CPUS)
> > +#else
> > LOAD_REG_ADDR(r7, nr_cpu_ids) /* Load nr_cpu_ids address */
> > +#endif
> > lwz r7,0(r7) /* also the max paca allocated */
> > li r5,0 /* logical cpu id */
> > 1:
> > --
> > 2.34.1
> >
>
> I don't know PPC assembly very well, but should the #endif be one line
> lower so that the constant is not dereferenced in the non-#else case?
Looks like you're right. Thanks, I'll send a v2.
prev parent reply other threads:[~2022-09-20 22:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 15:29 [PATCH] powerpc/64: don't refer nr_cpu_ids in asm code when it's undefined Yury Norov
2022-09-20 22:20 ` Stephen Rothwell
2022-09-20 22:41 ` Yury Norov [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=YypBk2gtlVCUBNXx@yury-laptop \
--to=yury.norov@gmail.com \
--cc=aik@ozlabs.ru \
--cc=amodra@au1.ibm.com \
--cc=dja@axtens.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=sfr@canb.auug.org.au \
/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).