From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932817AbcEKOIx (ORCPT ); Wed, 11 May 2016 10:08:53 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:46525 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932613AbcEKOIw (ORCPT ); Wed, 11 May 2016 10:08:52 -0400 Date: Wed, 11 May 2016 16:08:43 +0200 From: Peter Zijlstra To: Andrey Ryabinin Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Jim Cromie , Imre Palik , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf/x86: fix undefined shift on 32-bit kernels Message-ID: <20160511140843.GG3192@twins.programming.kicks-ass.net> References: <1462974711-10037-1-git-send-email-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462974711-10037-1-git-send-email-aryabinin@virtuozzo.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Andrey Ryabinin Thanks!