Re: [PATCH] perf/x86: fix undefined shift on 32-bit kernels

From: Peter Zijlstra
Date: Wed May 11 2016 - 10:08:55 EST


On Wed, May 11, 2016 at 04:51:51PM +0300, Andrey Ryabinin wrote:
> Jim reported:
> UBSAN: Undefined behaviour in arch/x86/events/intel/core.c:3708:12
> shift exponent 35 is too large for 32-bit type 'long unsigned int'
>
> The use of 'unsigned long' type obviously is not correct here, make it
> 'unsigned long long' instead.
>
> Fixes: 2c33645d366d ("perf/x86: Honor the architectural performance monitoring version")
> Reported-by: Jim Cromie <jim.cromie@xxxxxxxxx>
> Signed-off-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>

Thanks!