All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"lkp@intel.com" <lkp@intel.com>
Subject: Re: [PATCH] powerpc/security: Provide stubs for when PPC_BARRIER_NOSPEC isn't enabled
Date: Fri, 04 Mar 2022 00:01:19 +1100	[thread overview]
Message-ID: <87h78fnqao.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <a6751b0c-23ad-0f22-218a-cc808ad1e92c@csgroup.eu>

Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 10/01/2022 à 11:07, Naveen N. Rao a écrit :
>> kernel test robot reported the below build error with a randconfig:
>>    powerpc64-linux-ld: arch/powerpc/net/bpf_jit_comp64.o:(.toc+0x0):
>>    undefined reference to `powerpc_security_features'
>> 
>> This can happen if CONFIG_PPC_BARRIER_NOSPEC is not enabled. Address
>> this by providing stub functions for security_ftr_enabled() and related
>> helpers when the config option is not enabled.
>
> Looks like this can happen only when E500 is not selected.
>
> But what kind of CPU do we have if it's not a E500 ?
>
> AFAICS in cputable.c, if not a PPC32 and not a BOOK3S_64 is must be a 
> E500 otherwise there's just no CPU.

That's left over from when we still had support for "A2", the IBM Book3E
CPU that never shipped publicly.

See when it was removed in:
  fb5a515704d7 ("powerpc: Remove platforms/wsp and associated pieces")

> Should we make Kconfig stricter instead to avoid the Robot selecting a 
> crazy config ?

Yeah.

We have a bit of maze of symbols related to all that eg, PPC_BOOK3E_64,
PPC_BOOK3E, PPC_FSL_BOOK3E, FSL_BOOKE, E500.

Some of them are clearly required, but I think some could be
rationalised, now that 64-bit Book3E implies FSL Book3E. But that will
be a bunch of work I suspect.

For this immediate problem, I think the patch below might be sufficient.
It just ensures that PPC_FSL_BOOK3E is always enabled when we're
building 64-bit Book3E.

I'll run it through some build tests.

cheers


diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 87bc1929ee5a..e2e1fec91c6e 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -107,6 +107,7 @@ config PPC_BOOK3S_64
 
 config PPC_BOOK3E_64
 	bool "Embedded processors"
+	select PPC_FSL_BOOK3E
 	select PPC_FPU # Make it a choice ?
 	select PPC_SMP_MUXED_IPI
 	select PPC_DOORBELL
@@ -295,7 +296,7 @@ config FSL_BOOKE
 config PPC_FSL_BOOK3E
 	bool
 	select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
-	select FSL_EMB_PERFMON
+	imply FSL_EMB_PERFMON
 	select PPC_SMP_MUXED_IPI
 	select PPC_DOORBELL
 	select PPC_KUEP



      parent reply	other threads:[~2022-03-03 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 10:07 [PATCH] powerpc/security: Provide stubs for when PPC_BARRIER_NOSPEC isn't enabled Naveen N. Rao
2022-02-23 14:14 ` Christophe Leroy
2022-03-02 17:38   ` Naveen N. Rao
2022-03-03 13:01   ` Michael Ellerman [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=87h78fnqao.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=naveen.n.rao@linux.vnet.ibm.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 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.