Re: [PATCH] x86/cpu: replacing the open-coded shift with BIT(x)

From: Peter Zijlstra
Date: Tue Nov 01 2022 - 04:48:53 EST


On Tue, Nov 01, 2022 at 02:09:45PM +0800, Gaosheng Cui wrote:
> Replace the open-coded shift with BIT(x) for x86_power to make the
> code a bit more self-documenting, and we will get a UBSAN issue in
> arch/x86/kernel/cpu/proc.c, fix it.
>
> The UBSAN warning calltrace like below:
>
> UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/proc.c:138:25
> left shift of 1 by 31 places cannot be represented in type 'int'

Same as to the other case; UBSAN is broken garbage, stop quoting it.