Re: crosstool: x86 kernel compiled with GCC 14.1 fails to boot

From: Arnd Bergmann
Date: Tue Jul 09 2024 - 01:45:03 EST


On Tue, Jul 9, 2024, at 05:55, Jeff Johnson wrote:
> On 7/8/2024 6:57 PM, Jeff Johnson wrote:
>> We tend to enable a lot of debug config options, so I'm wondering if one of
>> them is contributing to the issue? Guess I'll turn off a bunch of those
>> options and try again.
>
> OK, with a bunch of debug turned off my image boots.
>
> Now to find the culprit.
>
> Current diff between original config and working config:

Nice! I've tried the reverse now, turning on the options
you have turned off on top of my defconfig. This version
still works for me, booting with a plain
'qemu-system-x86_64 -kernel arch/x86_64/boot/bzImage'
and building with my arm64-to-x86 cross compiler.

I have turned off most drivers here to get faster builds,
but it's enough to get console output.
See https://pastebin.com/p2GFjAc3 for the full .config

Arnd

19a20
> CONFIG_CONSTRUCTORS=y
290a292
> CONFIG_GENERIC_CSUM=y
298a301
> CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
394a398
> # CONFIG_ARCH_MEMORY_PROBE is not set
441c445
< CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0x0
---
> CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0xa
537a542
> # CONFIG_ACPI_HOTPLUG_MEMORY is not set
748d752
< CONFIG_HAVE_RELIABLE_STACKTRACE=y
903a908,909
> CONFIG_NUMA_KEEP_MEMINFO=y
> CONFIG_MEMORY_ISOLATION=y
906c912,916
< # CONFIG_MEMORY_HOTPLUG is not set
---
> CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
> CONFIG_MEMORY_HOTPLUG=y
> # CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
> # CONFIG_MEMORY_HOTREMOVE is not set
> CONFIG_MHP_MEMMAP_ON_MEMORY=y
914a925
> CONFIG_CONTIG_ALLOC=y
1238a1250,1251
> # CONFIG_MOUSE_APPLETOUCH is not set
> # CONFIG_MOUSE_BCM5974 is not set
1242a1256
> # CONFIG_MOUSE_SYNAPTICS_USB is not set
1264a1279,1280
> # CONFIG_JOYSTICK_XPAD is not set
> # CONFIG_JOYSTICK_PXRC is not set
1269a1286,1290
> # CONFIG_TABLET_USB_ACECAD is not set
> # CONFIG_TABLET_USB_AIPTEK is not set
> # CONFIG_TABLET_USB_HANWANG is not set
> # CONFIG_TABLET_USB_KBTAB is not set
> # CONFIG_TABLET_USB_PEGASUS is not set
1313a1335
> # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
1336a1359,1360
> # CONFIG_INPUT_ATI_REMOTE2 is not set
> # CONFIG_INPUT_KEYSPAN_REMOTE is not set
1337a1362,1364
> # CONFIG_INPUT_POWERMATE is not set
> # CONFIG_INPUT_YEALINK is not set
> # CONFIG_INPUT_CM109 is not set
1922c1949,1970
< # CONFIG_USB_SUPPORT is not set
---
> CONFIG_USB_SUPPORT=y
> # CONFIG_USB_ULPI_BUS is not set
> CONFIG_USB_ARCH_HAS_HCD=y
> # CONFIG_USB is not set
>
> #
> # USB dual-mode controller drivers
> #
>
> #
> # USB port drivers
> #
>
> #
> # USB Physical Layer drivers
> #
> # CONFIG_NOP_USB_XCEIV is not set
> # end of USB Physical Layer drivers
>
> # CONFIG_USB_GADGET is not set
> # CONFIG_TYPEC is not set
> # CONFIG_USB_ROLE_SWITCH is not set
2243a2292
> # CONFIG_USB_LGM_PHY is not set
2829a2879
> CONFIG_STACKDEPOT_ALWAYS_INIT=y
2873a2924,2925
> CONFIG_ARCH_WANT_FRAME_POINTERS=y
> CONFIG_FRAME_POINTER=y
2874a2927
> # CONFIG_STACK_VALIDATION is not set
2896d2948
< # CONFIG_KCSAN is not set
2922c2974,2977
< # CONFIG_DEBUG_KMEMLEAK is not set
---
> CONFIG_DEBUG_KMEMLEAK=y
> CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000
> # CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set
> CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y
2924c2979,2986
< # CONFIG_DEBUG_OBJECTS is not set
---
> CONFIG_DEBUG_OBJECTS=y
> # CONFIG_DEBUG_OBJECTS_SELFTEST is not set
> # CONFIG_DEBUG_OBJECTS_FREE is not set
> CONFIG_DEBUG_OBJECTS_TIMERS=y
> CONFIG_DEBUG_OBJECTS_WORK=y
> CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
> CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
> CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
2927c2989
< # CONFIG_SCHED_STACK_END_CHECK is not set
---
> CONFIG_SCHED_STACK_END_CHECK=y
2933a2996
> # CONFIG_MEMORY_NOTIFIER_ERROR_INJECT is not set
2943c3006,3014
< # CONFIG_KASAN is not set
---
> CONFIG_KASAN=y
> CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX=y
> CONFIG_KASAN_GENERIC=y
> # CONFIG_KASAN_OUTLINE is not set
> CONFIG_KASAN_INLINE=y
> CONFIG_KASAN_STACK=y
> CONFIG_KASAN_VMALLOC=y
> # CONFIG_KASAN_MODULE_TEST is not set
> # CONFIG_KASAN_EXTRA_INFO is not set
2945c3016,3020
< # CONFIG_KFENCE is not set
---
> CONFIG_KFENCE=y
> CONFIG_KFENCE_SAMPLE_INTERVAL=0
> CONFIG_KFENCE_NUM_OBJECTS=255
> # CONFIG_KFENCE_DEFERRABLE is not set
> CONFIG_KFENCE_STRESS_TEST_FAULTS=0
2957c3032,3034
< # CONFIG_SOFTLOCKUP_DETECTOR is not set
---
> CONFIG_LOCKUP_DETECTOR=y
> CONFIG_SOFTLOCKUP_DETECTOR=y
> # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
2959c3036,3041
< # CONFIG_HARDLOCKUP_DETECTOR is not set
---
> CONFIG_HARDLOCKUP_DETECTOR=y
> # CONFIG_HARDLOCKUP_DETECTOR_PREFER_BUDDY is not set
> CONFIG_HARDLOCKUP_DETECTOR_PERF=y
> # CONFIG_HARDLOCKUP_DETECTOR_BUDDY is not set
> # CONFIG_HARDLOCKUP_DETECTOR_ARCH is not set
> CONFIG_HARDLOCKUP_DETECTOR_COUNTS_HRTIMER=y
2961c3043,3046
< # CONFIG_DETECT_HUNG_TASK is not set
---
> # CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
> CONFIG_DETECT_HUNG_TASK=y
> CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
> # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
2970c3055
< # CONFIG_SCHED_DEBUG is not set
---
> CONFIG_SCHED_DEBUG=y
2982c3067,3068
< # CONFIG_PROVE_LOCKING is not set
---
> CONFIG_PROVE_LOCKING=y
> # CONFIG_PROVE_RAW_LOCK_NESTING is not set
2984,2989c3070,3082
< # CONFIG_DEBUG_RT_MUTEXES is not set
< # CONFIG_DEBUG_SPINLOCK is not set
< # CONFIG_DEBUG_MUTEXES is not set
< # CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
< # CONFIG_DEBUG_RWSEMS is not set
< # CONFIG_DEBUG_LOCK_ALLOC is not set
---
> CONFIG_DEBUG_RT_MUTEXES=y
> CONFIG_DEBUG_SPINLOCK=y
> CONFIG_DEBUG_MUTEXES=y
> CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
> CONFIG_DEBUG_RWSEMS=y
> CONFIG_DEBUG_LOCK_ALLOC=y
> CONFIG_LOCKDEP=y
> CONFIG_LOCKDEP_BITS=15
> CONFIG_LOCKDEP_CHAINS_BITS=16
> CONFIG_LOCKDEP_STACK_TRACE_BITS=19
> CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
> CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
> # CONFIG_DEBUG_LOCKDEP is not set
2997a3091,3092
> CONFIG_TRACE_IRQFLAGS=y
> CONFIG_TRACE_IRQFLAGS_NMI=y
3002a3098
> # CONFIG_DEBUG_KOBJECT_RELEASE is not set
3016a3113
> CONFIG_PROVE_RCU=y
3051a3149
> CONFIG_PREEMPTIRQ_TRACEPOINTS=y
3104,3105c3202,3203
< CONFIG_IO_DELAY_0X80=y
< # CONFIG_IO_DELAY_0XED is not set
---
> # CONFIG_IO_DELAY_0X80 is not set
> CONFIG_IO_DELAY_0XED=y
3113,3114c3211,3212
< CONFIG_UNWINDER_ORC=y
< # CONFIG_UNWINDER_FRAME_POINTER is not set
---
> # CONFIG_UNWINDER_ORC is not set
> CONFIG_UNWINDER_FRAME_POINTER=y
3121c3219,3220
< # CONFIG_NOTIFIER_ERROR_INJECTION is not set
---
> CONFIG_NOTIFIER_ERROR_INJECTION=m
> CONFIG_PM_NOTIFIER_ERROR_INJECT=m