Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9095486pxu; Mon, 28 Dec 2020 06:31:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXqZ31LLcNcDEXoLgpRwCG7Jly0JFQ8WEZaERWbO/+u7GUMo26ndanrNSsfT+sN8319AJ0 X-Received: by 2002:a50:f404:: with SMTP id r4mr42375397edm.62.1609165904309; Mon, 28 Dec 2020 06:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165904; cv=none; d=google.com; s=arc-20160816; b=B7shkL033zCreazLhRrdWLdB2Cdp7u91ijJSNLw6e2GAzlseSc5AFSULVKVKOZ0OKt lfxEMNKM+mnqKZnoZZ3kJoxdQzlud+iSs5gNiG7TYCX0CTYcDdM3npj4A0UTA6qh+YOP xMEtR/Ho//2gHNin56e+KzZrEF8gI+ycMvMqyhPUH3IU1036ekZEB8XIpa2Uhnpqjrn/ 9+3vUl2GnHEmdfKm1hzF1BMJA38NZSLXcbUy9qj2xDZGkItGnQg/xJK2K3Ho8bpV0Jbg 91egA4+2DQ2tLqwAVYtPET2yntVTNQXF3gxlG2OfdQKY3hB9s8k5fRYR5HgvVAUOz5wB 77EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eL1qTStuJR4dp0tqJoZ5f+k2gqVc4A6Si2wHxigK8dQ=; b=EJlZfxPaTPhzZqsTNvkV0S+Ij7qer+McnFOFZN2vQiY3eijn3rzx5j5A3YUwAZgYep c+w5fJ120UNOUqf2vPIviTxK+Y8eVMTMock5dqNycGBuvawWGJxvD+8/IYtuI/qYRsnq MJ3inI22HFsyFFsotsc+l+bP30EF0JVradwaohfgn7SqSvxaihALamOF3c7x/m1J8X7w fgkbS5qoE0K0GQVmpdpddMujWSxuBsGGuXFDwFiRhxkxvgEsaiIvSPQHiBhuZJjlY3KA oSHG4xlJi23dX1rHbV0wU4uhprjRvyGgciDhfZ14PDwRVnSB/Xxh0gK8r6cIyugMNQl4 aVlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EOka8U3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si17741485ejy.455.2020.12.28.06.31.21; Mon, 28 Dec 2020 06:31:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EOka8U3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502260AbgL1O1U (ORCPT + 99 others); Mon, 28 Dec 2020 09:27:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:33588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503377AbgL1OZ5 (ORCPT ); Mon, 28 Dec 2020 09:25:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B99C420731; Mon, 28 Dec 2020 14:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165542; bh=3XF4aZgmHdWRYFyRJHXvr/hC0GRTsv7IjCHdkyT1OWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EOka8U3u4sWo7EmVzyslWhq2Dm1DuG5bRp5eFXqaxo5dRO8IjIQtrNuC6KRp3LQ4z f8uRP5M/+I8ji2XOJ0eJn04zyOf1doUIwfsvYk15xvE+DREfsxtOu1SerLbCCNMVLy LCCmH5QRYiVtz3hEhpr/OCqx8rgJn5WL4uyC7p0s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephane Eranian , Kan Liang , "Peter Zijlstra (Intel)" Subject: [PATCH 5.10 568/717] perf/x86/intel/lbr: Fix the return type of get_lbr_cycles() Date: Mon, 28 Dec 2020 13:49:26 +0100 Message-Id: <20201228125048.119381827@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang commit f8129cd958b395575e5543ce25a8434874b04d3a upstream. The cycle count of a timed LBR is always 1 in perf record -D. The cycle count is stored in the first 16 bits of the IA32_LBR_x_INFO register, but the get_lbr_cycles() return Boolean type. Use u16 to replace the Boolean type. Fixes: 47125db27e47 ("perf/x86/intel/lbr: Support Architectural LBR") Reported-by: Stephane Eranian Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20201125213720.15692-2-kan.liang@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/events/intel/lbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -919,7 +919,7 @@ static __always_inline bool get_lbr_pred return !(info & LBR_INFO_MISPRED); } -static __always_inline bool get_lbr_cycles(u64 info) +static __always_inline u16 get_lbr_cycles(u64 info) { if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !(x86_pmu.lbr_timed_lbr && info & LBR_INFO_CYC_CNT_VALID))