Bug 216367

Summary: Kernel 6.0-rc1 fails to build with GCC_PLUGIN_LATENT_ENTROPY=y (PowerMac G5 11,2)
Product: Platform Specific/Hardware Reporter: Erhard F. (erhard_f)
Component: PPC-64Assignee: platform_ppc-64
Status: RESOLVED CODE_FIX    
Severity: normal CC: ajd
Priority: P1    
Hardware: PPC-64   
OS: Linux   
Kernel Version: 6.0-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: kernel .config (kernel 6.0-rc1, PowerMac G5 11,2)

Description Erhard F. 2022-08-15 23:15:35 UTC
Created attachment 301575 [details]
kernel .config (kernel 6.0-rc1, PowerMac G5 11,2)

[...]
  LDS     arch/powerpc/kernel/vmlinux.lds
  AS      arch/powerpc/kernel/fpu.o
  AS      arch/powerpc/kernel/vector.o
  AS      arch/powerpc/kernel/entry_64.o
  CC      arch/powerpc/kernel/prom_init.o
In file included from ./include/linux/nodemask.h:97,
                 from ./include/linux/mmzone.h:17,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/xarray.h:15,
                 from ./include/linux/radix-tree.h:21,
                 from ./include/linux/idr.h:15,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/pci.h:35,
                 from arch/powerpc/kernel/prom_init.c:24:
./include/linux/random.h: In function 'add_latent_entropy':
./include/linux/random.h:25:46: error: 'latent_entropy' undeclared (first use in this function); did you mean 'add_latent_entropy'?
   25 |         add_device_randomness((const void *)&latent_entropy, sizeof(latent_entropy));
      |                                              ^~~~~~~~~~~~~~
      |                                              add_latent_entropy
./include/linux/random.h:25:46: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:249: arch/powerpc/kernel/prom_init.o] Fehler 1
make[1]: *** [scripts/Makefile.build:465: arch/powerpc/kernel] Fehler 2
make: *** [Makefile:1855: arch/powerpc] Error 2
Comment 1 Andrew Donnellan 2022-08-16 05:18:36 UTC
I've sent a patch: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220816051720.44108-1-ajd@linux.ibm.com/

Please let me know if it works for you.
Comment 2 Erhard F. 2022-08-16 10:14:47 UTC
(In reply to Andrew Donnellan from comment #1)
> I've sent a patch:
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220816051720.44108-
> 1-ajd@linux.ibm.com/
> 
> Please let me know if it works for you.
Applied it on top of v6.0-rc1 and it works fine. Many thanks!
Comment 3 Andrew Donnellan 2022-08-17 00:47:48 UTC
Patch has been taken via Kees Cook's hardening tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/hardening&id=012e8d2034f1bda8863435cd589636e618d6a659
Comment 4 Erhard F. 2022-08-23 10:40:21 UTC
Meanwhile the fix found it's way in v6.0-rc2. Everything ok now, thanks!