From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Yury Norov <yury.norov@gmail.com>
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: Wed, 21 Sep 2022 08:20:06 +1000 [thread overview]
Message-ID: <20220921082006.2235b7d2@canb.auug.org.au> (raw)
In-Reply-To: <20220920152935.1569605-1-yury.norov@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
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?
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-09-20 22:21 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 [this message]
2022-09-20 22:41 ` Yury Norov
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=20220921082006.2235b7d2@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--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=yury.norov@gmail.com \
/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).