hw: prevent alignment faults in bootstrap

Either enable strict-alignment or disable FPU code generation by gcc
regarding bootstrap code, which cannot handle alignment faults during
initialization properly.

Ref genodelabs/genode#4827
This commit is contained in:
Stefan Kalkowski 2023-05-10 22:00:21 +02:00 committed by Christian Helmuth
parent 37d1855907
commit 5e0a9052d2
11 changed files with 32 additions and 47 deletions

View File

@ -1,11 +1,7 @@
REP_INC_DIR += src/bootstrap/board/imx53_qsb
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/spec/arm/cortex_a8_mmu.cc
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/imx_tzic.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -1,12 +1,8 @@
REP_INC_DIR += src/bootstrap/board/imx6q_sabrelite
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/spec/arm/imx6_platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -3,14 +3,11 @@ REP_INC_DIR += src/bootstrap/board/imx7d_sabre
SRC_CC += bootstrap/spec/arm/cortex_a15_cpu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/board/imx7d_sabre/platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
SRC_S += bootstrap/spec/arm/crt0.s
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)
#
# we need more specific compiler hints for some 'special' assembly code
# override -march=armv7-a because it conflicts with -mcpu=cortex-a7
#
CC_MARCH = -mcpu=cortex-a7 -mfpu=vfpv3 -mfloat-abi=softfp
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
CC_MARCH = -mcpu=cortex-a7+nofp -mfpu=vfpv3

View File

@ -1,12 +1,8 @@
REP_INC_DIR += src/bootstrap/board/nit6_solox
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/spec/arm/imx6_platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -1,12 +1,8 @@
REP_INC_DIR += src/bootstrap/board/pbxa9
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/board/pbxa9/platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -1,12 +1,8 @@
REP_INC_DIR += src/bootstrap/board/usb_armory
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/board/usb_armory/platform.cc
SRC_CC += bootstrap/spec/arm/cortex_a8_mmu.cc
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/imx_tzic.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -1,12 +1,9 @@
REP_INC_DIR += src/bootstrap/board/virt_qemu_arm_v7a
SRC_CC += bootstrap/board/virt_qemu_arm_v7a/platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a15_cpu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += hw/spec/32bit/memory_map.cc
SRC_S += bootstrap/spec/arm/crt0.s
CC_MARCH = -march=armv7ve -mtune=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
CC_MARCH = -march=armv7ve+nofp -mtune=cortex-a15 -mfpu=vfpv3

View File

@ -1,12 +1,8 @@
REP_INC_DIR += src/bootstrap/board/wand_quad
SRC_S += bootstrap/spec/arm/crt0.s
SRC_CC += bootstrap/spec/arm/cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a9_mmu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc
SRC_CC += bootstrap/spec/arm/imx6_platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v7/bootstrap-hw.inc)

View File

@ -0,0 +1,11 @@
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += hw/spec/32bit/memory_map.cc
SRC_S += bootstrap/spec/arm/crt0.s
#
# Disable FPU instructions generated by GCC until MMU is enabled
# and alignment restrictions are relaxed
#
CC_MARCH = -march=armv7-a+nofp -mfpu=vfpv3
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)

View File

@ -3,10 +3,5 @@ REP_INC_DIR += src/bootstrap/board/virt_qemu_arm_v8a
SRC_CC += bootstrap/spec/arm/gicv3.cc
SRC_CC += bootstrap/spec/arm_64/cortex_a53_mmu.cc
SRC_CC += bootstrap/board/virt_qemu_arm_v8a/platform.cc
SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)
include $(call select_from_repositories,lib/mk/spec/arm_v8/bootstrap-hw.inc)

View File

@ -0,0 +1,9 @@
CC_MARCH = -march=armv8-a -mstrict-align
SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s
vpath spec/64bit/memory_map.cc $(call select_from_repositories,src/lib/hw)
include $(call select_from_repositories,lib/mk/bootstrap-hw.inc)