Received: by 10.213.65.68 with SMTP id h4csp899089imn; Tue, 27 Mar 2018 10:49:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iqxTgmYIpkc20/HHbGgJIdmhKErIfGOIeDb8+qL9xDdd4GQVrsMIwqkzjiALAI8nxJLGE X-Received: by 10.99.149.83 with SMTP id t19mr161514pgn.433.1522172954755; Tue, 27 Mar 2018 10:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172954; cv=none; d=google.com; s=arc-20160816; b=xI+F19UeYKC2AYNg1093H7KpDQ5wMWR9lM1uF04Z7qymvo511bA1E7d3uyu2xDEPOc eAwuMbOINa5FX4ZSUCMqWfQ/+HIV7iX87KT8iVXoPB33BF+sL4ScEe6rJd5snHe4ODDr mqcoC8sY5Sp2Eu7Se+ApgbqWbaiB4Egz6KnWgDIuBe6W6MBl/2iBVoOoAh72vnAqcNCH Sv0uUNivA98YJOfz2E779Nc50xUOHYz5sLo/XnEv4Y7nbtQdzyfKXiMEfENs3fki2SmG 6s+r8bUQSzZ23TFAOCy7WFG8Ca38bzyfv7XR43xRdTojWO6sZmrgXJPH/2dkIxMOXvLk cWKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5naTZX3/eTQULEh3huvgwRd8M2ngfmS3MAA/1OqGWRA=; b=L+24nZARJAaDAuthmKOsZVB55jti0iEfNpibkcesldKD6BSRYcFrpIFvpBjKgOSqvS sLZAyaUmwTM4w1DbOZCZgppTwmJGcH3IjPCXma+sMIgtypjxycvELn9gDhhPYZ13emCH ysqdvb8Baf/WbQx+6K0RxBcZCFyypL2Sl3orxOI1XMA2HwOLds73lRvXSL0wZTto+0KJ TyjVYwh+y3ciFwpUDKVWGaYvc1A/bjv355FUJo0mZEaJSFBIwUzQN4xaNLLeKfXwAY55 Kk2w6OoyfqDkTz1XH6NbBJAsMBWXqRxZ0Ke8CzI5aM/l458POPsremHhuDt5hcXFqIWl c64Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t190si1102393pgd.101.2018.03.27.10.49.00; Tue, 27 Mar 2018 10:49:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753814AbeC0Qcy (ORCPT + 99 others); Tue, 27 Mar 2018 12:32:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43570 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753766AbeC0Qcv (ORCPT ); Tue, 27 Mar 2018 12:32:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8952310CB; Tue, 27 Mar 2018 16:32:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "Peter Zijlstra (Intel)" , Alexander Shishkin , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Jiri Olsa , Kan Liang , Linus Torvalds , Sebastian Andrzej Siewior , Stephane Eranian , Thomas Gleixner , Vince Weaver , Ingo Molnar Subject: [PATCH 4.9 56/67] perf/x86/intel: Dont accidentally clear high bits in bdw_limit_period() Date: Tue, 27 Mar 2018 18:27:48 +0200 Message-Id: <20180327162730.680263014@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit e5ea9b54a055619160bbfe527ebb7d7191823d66 upstream. We intended to clear the lowest 6 bits but because of a type bug we clear the high 32 bits as well. Andi says that periods are rarely more than U32_MAX so this bug probably doesn't have a huge runtime impact. Signed-off-by: Dan Carpenter Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: H. Peter Anvin Cc: Jiri Olsa Cc: Kan Liang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Fixes: 294fe0f52a44 ("perf/x86/intel: Add INST_RETIRED.ALL workarounds") Link: http://lkml.kernel.org/r/20180317115216.GB4035@mwanda Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3025,7 +3025,7 @@ static unsigned bdw_limit_period(struct X86_CONFIG(.event=0xc0, .umask=0x01)) { if (left < 128) left = 128; - left &= ~0x3fu; + left &= ~0x3fULL; } return left; }