OrangePi_CM5/arch/powerpc/kernel
Michael Ellerman 4234c5f34e powerpc/64s: Disable stack variable initialisation for prom_init
[ Upstream commit be640317a1d0b9cf42fedb2debc2887a7cfa38de ]

With GCC 12 allmodconfig prom_init fails to build:

  Error: External symbol 'memset' referenced from prom_init.c
  make[2]: *** [arch/powerpc/kernel/Makefile:204: arch/powerpc/kernel/prom_init_check] Error 1

The allmodconfig build enables KASAN, so all calls to memset in
prom_init should be converted to __memset by the #ifdefs in
asm/string.h, because prom_init must use the non-KASAN instrumented
versions.

The build failure happens because there's a call to memset that hasn't
been caught by the pre-processor and converted to __memset. Typically
that's because it's a memset generated by the compiler itself, and that
is the case here.

With GCC 12, allmodconfig enables CONFIG_INIT_STACK_ALL_PATTERN, which
causes the compiler to emit memset calls to initialise on-stack
variables with a pattern.

Because prom_init is non-user-facing boot-time only code, as a
workaround just disable stack variable initialisation to unbreak the
build.

Reported-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220718134418.354114-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-21 15:15:31 +02:00
..
ptrace powerpc/32: Fix overread/overwrite of thread_struct via ptrace 2022-06-14 18:32:46 +02:00
syscalls mm/madvise: introduce process_madvise() syscall: an external memory hinting API 2020-10-18 09:27:10 -07:00
trace powerpc/ftrace: Remove ftrace init tramp once kernel init is complete 2022-07-02 16:39:25 +02:00
vdso32 Kbuild updates for v5.10 2020-10-22 13:13:57 -07:00
vdso64 powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64() semantics 2021-02-13 13:55:02 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile powerpc/64s: Disable stack variable initialisation for prom_init 2022-08-21 15:15:31 +02:00
align.c powerpc: Use fallthrough pseudo-keyword 2020-07-29 21:09:37 +10:00
asm-offsets.c powerpc/64: Fix stack trace not displaying final frame 2021-03-17 17:06:24 +01:00
audit.c
…
btext.c powerpc/btext: add missing of_node_put 2022-01-27 10:54:21 +01:00
cacheinfo.c powerpc/cacheinfo: Warn if cache object chain becomes unordered 2020-07-30 22:53:48 +10:00
cacheinfo.h powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild 2019-06-15 16:52:06 +10:00
compat_audit.c
…
cpu_setup_6xx.S powerpc/32: Blacklist functions running with MMU disabled for kprobe 2020-06-02 20:59:11 +10:00
cpu_setup_44x.S
…
cpu_setup_fsl_booke.S powerpc/booke: Spelling s/date/data/ 2019-11-17 01:56:31 -06:00
cpu_setup_pa6t.S
…
cpu_setup_power.c powerpc/perf: MMCR0 control for PMU registers under PMCC=00 2022-01-27 10:54:05 +01:00
cpu_setup_ppc970.S
…
cputable.c powerpc/64s: Convert some cpu_setup() and cpu_restore() functions to C 2022-01-27 10:54:05 +01:00
crash_dump.c powerpc: Add prefixed instructions to instruction data type 2020-05-19 00:10:39 +10:00
dawr.c powerpc/watchpoint: Guest support for 2nd DAWR hcall 2020-07-26 23:34:19 +10:00
dbell.c powerpc: Inline doorbell sending functions 2020-07-29 21:02:09 +10:00
dma-iommu.c powerpc/iommu: Report the correct most efficient DMA mask for PCI devices 2021-10-13 10:04:29 +02:00
dma-mask.c
…
dma-swiotlb.c
…
dt_cpu_ftrs.c powerpc/perf: MMCR0 control for PMU registers under PMCC=00 2022-01-27 10:54:05 +01:00
early_32.c powerpc/fsl_booke/32: implement KASLR infrastructure 2019-11-13 19:27:40 +11:00
eeh.c powerpc/eeh: Fix EEH handling for hugepages in ioremap space. 2021-05-11 14:47:35 +02:00
eeh_cache.c powerpc/eeh_cache: Fix a possible debugfs deadlock 2020-11-02 12:54:20 +11:00
eeh_driver.c pci-v5.9-changes 2020-08-07 18:48:15 -07:00
eeh_event.c powerpc/eeh: Fix build with STACKTRACE=n 2019-09-14 00:01:14 +10:00
eeh_pe.c powerpc/eeh: Delete eeh_pe->config_addr 2020-10-07 22:34:47 +11:00
eeh_sysfs.c powerpc/eeh: Pass eeh_dev to eeh_ops->resume_notify() 2020-07-26 23:34:20 +10:00
entry_32.S powerpc/32s: Add missing call to kuep_lock on syscall entry 2021-03-04 11:38:40 +01:00
entry_64.S powerpc/64s: fix scv entry fallback flush vs interrupt 2021-01-27 11:55:12 +01:00
epapr_hcalls.S
…
epapr_paravirt.c powerpc: Use a datatype for instructions 2020-05-19 00:10:37 +10:00
exceptions-64e.S powerpc/64e: remove 64s specific interrupt soft-mask code 2020-10-06 23:22:23 +11:00
exceptions-64s.S powerpc/64s: fix program check interrupt emergency stack path 2021-10-13 10:04:30 +02:00
fadump.c powerpc/fadump: fix PT_LOAD segment for boot memory area 2022-06-09 10:21:15 +02:00
firmware.c powerpc: fix unbalanced node refcount in check_kvm_guest() 2021-11-18 14:04:17 +01:00
fpu.S powerpc: Drop SYNC_601() ISYNC_601() and SYNC() 2020-10-08 21:17:13 +11:00
fsl_booke_entry_mapping.S powerpc/fsl_booke/32: implement KASLR infrastructure 2019-11-13 19:27:40 +11:00
head_8xx.S powerpc/8xx: Fix pinned TLBs with CONFIG_STRICT_KERNEL_RWX 2021-11-26 10:39:19 +01:00
head_32.h powerpc/32: Fix hardlockup on vmap stack overflow 2021-12-01 09:19:01 +01:00
head_40x.S powerpc/40x: Map 32Mbytes of memory at startup 2022-01-27 10:54:22 +01:00
head_44x.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
head_64.S powerpc/64: Fix an EMIT_BUG_ENTRY in head_64.S 2020-12-30 11:53:32 +01:00
head_book3s_32.S powerpc/603: Fix protection of user pages mapped with PROT_NONE 2021-03-17 17:06:13 +01:00
head_booke.h powerpc: Remove SYNC on non 6xx 2020-10-08 21:17:12 +11:00
head_fsl_booke.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hw_breakpoint.c powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c 2020-09-15 22:13:19 +10:00
hw_breakpoint_constraints.c powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c 2020-09-15 22:13:19 +10:00
idle.c powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
idle_6xx.S powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
idle_book3e.S
…
idle_book3s.S powerpc/idle: Don't corrupt back chain when going idle 2021-10-27 09:56:53 +02:00
idle_e500.S powerpc/32: Blacklist functions running with MMU disabled for kprobe 2020-06-02 20:59:11 +10:00
ima_arch.c powerpc/ima: Fix secure boot rules in ima arch policy 2020-05-07 17:25:54 +10:00
io-workarounds.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
io.c
…
iomap.c iomap: constify ioreadX() iomem argument (as in generic implementation) 2020-08-14 19:56:57 -07:00
iommu.c powerpc/iommu: Annotate nested lock for lockdep 2021-05-19 10:12:58 +02:00
irq.c powerpc/kuap: Restore AMR after replaying soft interrupts 2021-03-04 11:38:06 +01:00
isa-bridge.c powerpc: remove __ioremap_at and __iounmap_at 2020-06-02 10:59:10 -07:00
jump_label.c powerpc: Use a datatype for instructions 2020-05-19 00:10:37 +10:00
kgdb.c maccess: make get_kernel_nofault() check for minimal type compatibility 2020-06-18 12:10:37 -07:00
kprobes-ftrace.c
…
kprobes.c powerpc/kprobes: Fix kprobe Oops happens in booke 2021-08-18 08:59:14 +02:00
kvm.c powerpc/kvm: Fix kvm_use_magic_page 2022-04-08 14:39:54 +02:00
kvm_emul.S powerpc/kvm: Add ifdefs around template code 2019-09-14 00:04:40 +10:00
l2cr_6xx.S powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
legacy_serial.c tty/serial: Migrate 8250_fsl to use has_sysrq 2019-12-18 15:04:42 +01:00
mce.c powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash 2020-10-16 20:13:55 +11:00
mce_power.c powerpc/powernv: Fix machine check reporting of async store errors 2021-07-14 16:56:48 +02:00
misc.S powerpc/32: Blacklist functions running with MMU disabled for kprobe 2020-06-02 20:59:11 +10:00
misc_32.S powerpc: Rewrite FSL_BOOKE flush_cache_instruction() in C 2020-09-02 11:00:21 +10:00
misc_64.S powerpc: Remove SYNC on non 6xx 2020-10-08 21:17:12 +11:00
module.c powerpc: Use MODULES_VADDR if defined 2020-07-27 00:01:30 +10:00
module_32.c powerpc: module_[32|64].c: replace swap function with built-in one 2020-05-11 23:15:14 +10:00
module_64.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
msi.c
…
note.S powerpc: Add PowerPC Capabilities ELF note 2019-08-30 09:40:15 +10:00
nvram_64.c powerpc updates for 5.8 2020-06-05 12:39:30 -07:00
of_platform.c powerpc/eeh: Remove eeh_dev_phb_init_dynamic() 2020-07-26 23:34:19 +10:00
optprobes.c powerpc: Add ppc_inst_as_u64() 2020-05-26 23:36:57 +10:00
optprobes_head.S powerpc: Add prefixed instructions to instruction data type 2020-05-19 00:10:39 +10:00
paca.c powerpc: Avoid broken GCC __attribute__((optimize)) 2020-12-30 11:53:15 +01:00
pci-common.c powerpc/pci: Add ppc_md.discover_phbs() 2021-03-17 17:06:23 +01:00
pci-hotplug.c powerpc/eeh: Release EEH device state synchronously 2020-05-18 21:58:44 +10:00
pci_32.c powerpc/64: Adjust order in pcibios_init() 2019-08-22 23:11:48 +10:00
pci_64.c powerpc updates for 5.8 2020-06-05 12:39:30 -07:00
pci_dn.c powerpc/eeh: Rename eeh_{add_to|remove_from}_parent_pe() 2020-07-26 23:34:21 +10:00
pci_of_scan.c powerpc/pci: Remove pcibios_setup_bus_devices() 2020-01-06 16:25:29 +11:00
pmc.c
…
ppc32.h
…
ppc_save_regs.S powerpc: Improve ppc_save_regs() 2020-04-04 21:40:57 +11:00
proc_powerpc.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
process.c powerpc: Enable execve syscall exit tracepoint 2022-06-29 08:59:53 +02:00
prom.c powerpc/prom: Mark identical_pvr_fixup as __init 2021-05-14 09:50:30 +02:00
prom_init.c powerpc/prom_init: Fix improper check of prom_getprop() 2022-01-27 10:54:05 +01:00
prom_init_check.sh powerpc/prom_init: Fix kernel config grep 2022-07-07 17:52:15 +02:00
prom_parse.c
…
reloc_32.S
…
reloc_64.S
…
rtas-proc.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
rtas-rtc.c
…
rtas.c powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address 2022-06-29 08:59:53 +02:00
rtas_flash.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
rtas_pci.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
rtasd.c powerpc/rtasd: simplify handle_rtas_event(), emit message on events 2020-07-16 13:12:38 +10:00
secure_boot.c powerpc/pseries: Detect secure and trusted boot state of the system. 2020-07-16 14:49:53 +10:00
security.c powerpc/security: Add a helper to query stf_barrier type 2021-11-18 14:04:30 +01:00
secvar-ops.c powerpc/powernv: Add OPAL API interface to access secure variable 2019-11-13 00:33:22 +11:00
secvar-sysfs.c powerpc/secvar: fix refcount leak in format_show() 2022-04-13 21:00:59 +02:00
setup-common.c powerpc/64: Set up a kernel stack for secondaries before cpu_restore() 2020-12-30 11:53:01 +01:00
setup.h powerpc: Avoid broken GCC __attribute__((optimize)) 2020-12-30 11:53:15 +01:00
setup_32.c powerpc/32: Statically initialise first emergency context 2021-05-19 10:12:54 +02:00
setup_64.c powerpc: Fix early setup to make early_ioremap() work 2021-05-26 12:06:50 +02:00
signal.c arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
signal.h powerpc/64/sycall: Implement syscall entry/exit logic in C 2020-04-01 13:42:13 +11:00
signal_32.c powerpc/signal_32: Simplify loop in PPC64 save_general_regs() 2020-07-15 12:04:40 +10:00
signal_64.c powerpc/signal64: Don't opencode page prefaulting 2020-07-15 12:04:40 +10:00
smp-tbsync.c
…
smp.c powerpc/fadump: Fix inaccurate CPU state info in vmcore generated with panic 2022-01-27 10:54:23 +01:00
stacktrace.c powerpc/stacktrace: Include linux/delay.h 2021-09-18 13:40:12 +02:00
suspend.c
…
swsusp.c
…
swsusp_32.S powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
swsusp_64.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505 2019-06-19 17:11:22 +02:00
swsusp_asm64.S powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:32:46 +02:00
swsusp_booke.S
…
sys_ppc32.c
…
syscall_64.c powerpc: Only include kup-radix.h for 64-bit Book3S 2020-11-19 23:47:20 +11:00
syscalls.c y2038: syscalls: change remaining timeval to __kernel_old_timeval 2019-11-15 14:38:29 +01:00
sysfs.c powerpc/smp: Fix OOPS in topology_init() 2021-08-18 08:59:17 +02:00
systbl.S powerpc/64/sycall: Implement syscall entry/exit logic in C 2020-04-01 13:42:13 +11:00
systbl_chk.sh
…
tau_6xx.c powerpc/tau: Disable TAU between measurements 2020-09-15 22:13:30 +10:00
time.c powerpc/time: Enable sched clock for irqtime 2021-03-04 11:38:01 +01:00
tm.S powerpc/tm: Save and restore AMR on treclaim and trechkpt 2020-10-06 23:22:25 +11:00
traps.c powerpc/perf: move perf irq/nmi handling details into traps.c 2022-01-27 10:54:05 +01:00
ucall.S powerpc/kernel: Add ucall_norets() ultravisor call handler 2019-08-30 09:40:15 +10:00
udbg.c powerpc/udbg: Make it safe to call udbg_printf() always 2019-10-11 19:33:25 +11:00
udbg_16550.c
…
uprobes.c powerpc: Add ppc_inst_next() 2020-05-26 23:36:51 +10:00
vdso.c powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64() semantics 2021-02-13 13:55:02 +01:00
vecemu.c powerpc: Define and use get_user_instr() et. al. 2020-05-19 00:10:37 +10:00
vector.S powerpc: re-initialise lazy FPU/VEC counters on every fault 2020-07-16 13:00:24 +10:00
vmlinux.lds.S powerpc/64s: fix scv entry fallback flush vs interrupt 2021-01-27 11:55:12 +01:00
watchdog.c powerpc/watchdog: Fix missed watchdog reset due to memory ordering race 2022-01-27 10:54:21 +01:00