On Tue, Nov 01, 2022 at 10:28:28AM +0800, Gaosheng Cui wrote: > Shifting signed 32-bit value by 31 bits is undefined, so we fix it > with the BIT() macro, at the same time, we change the input to > unsigned, and replace "/ 32" with ">> 5". > > The UBSAN warning calltrace like below: > > UBSAN: shift-out-of-bounds in arch/x86/kvm/reverse_cpuid.h:101:11 > left shift of 1 by 31 places cannot be represented in type 'int' Again; please go fix your toolchain and don't quote broken crap like this to change the code. I'm fine with the changes, but there is no UB here, don't pretend there is.