On 6/26/23 14:42, Sebastian Sumpf wrote: > >>> Therefore, these registers will not be restored >>> upon function return by the compiler. This leads to varying >>> exceptions/bad behavior caused by the thus corrupted registers later >>> on. >> >> How do I reproduce what you're observing so that I can take a look? > > This is hard to tell, I would disable the " X86_FEATURE_POPCNT" feature > and use the ' CONFIG_ARCH_HAS_FAST_MULTIPLIER' option in order to use > the multiplier implementation in '__sw_hweight64' in 'lib/hweight.c' At > least that is what triggered it here. Looks like you'd also have to be using UML: $ grep hweight lib/Makefile obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o $ grep -r GENERIC_HWEIGHT arch/x86 arch/x86/um/Kconfig:config GENERIC_HWEIGHT I'm not even sure that UML needs GENERIC_HWEIGHT. From a quick glance, it looks like x86 used to use GENERIC_HWEIGHT, but got arch-specific versions later. UML just never moved over to the arch-specific versions. I _think_ the attached patch might just fix the problems with the C version and bring the x86/UML implementation back in line with the rest of x86. Thoughts?