Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9085468pxu; Mon, 28 Dec 2020 06:16:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfsv8RbFOS2LLl0bQIwZIzjrO5ebXIcMy0beOh4R/itBcM7WVTdmAejHtVfHUpe5C2PUbQ X-Received: by 2002:a17:906:4146:: with SMTP id l6mr42286838ejk.341.1609165011023; Mon, 28 Dec 2020 06:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165011; cv=none; d=google.com; s=arc-20160816; b=J1/UZJaioRTdtWeDctBNYI2PIAYUb+XZ3zowPjmx3uile2r7hPsI290NadRSKDWXMj X+LQIS25YZZmjg/tITU8mvZiuVmSLLGsr0ke/e1qyHScsur5qoQwUDe84VLqBaPoM5Uy BI30ZspV+cIiEOg9dQh/tvFQImIYkrrKk2A99stkkrMKFJ4RiQLZo2jv2hZuzv2J4Rgr SmyHiysbyCppNhi7LWX9IE0H7pXI4lE+Jf7LsBF1A9HKcr+KfTxlljAF52CKiZ13Wvt1 tA8RefbUWhNQKQaLMBt1x1s20zog5ztD6yPIvSQ4FC1zJJVD1x+/av1naNfBS+YJS4KJ v+6Q== 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=DkNIzowgzIWClW7UIajX8xU5mV+NyC8KiQ6m3KDksss=; b=WJUovNevpElgFJevCZzYh396kPydSG4CWxwHrkvjUiTn8uZimFzjYl86bRmwbeGKKx 8lCyugiYgIpLY66d6YTVq+j+EF5h9N91azkYJ6NEe/oDYwen8tHYSYwrN290/UJdyhvY S8WHShux7zfQqLjbK7+A+gz06n/QdnTEM0tKuXPMZd0ZYvjQk981fIDR4lCTJiR0jte/ W6vU1DbbQf2QEwW5IyMcMSGSpL26ax3/OfGSfCTREg4xRj46iXX8P1rWl4RN08i8UwKK GBABZLf5VZtaohT2A/bZ7qH2sMSzs39Hpb96WLTI21U7UTQtqvLVXskPFwsCZNJxrCnd M8WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tz8pN6Zv; 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 v1si11269196ejd.298.2020.12.28.06.16.28; Mon, 28 Dec 2020 06:16:51 -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=Tz8pN6Zv; 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 S2440447AbgL1OOg (ORCPT + 99 others); Mon, 28 Dec 2020 09:14:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:49410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440427AbgL1OOb (ORCPT ); Mon, 28 Dec 2020 09:14:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D794C206D4; Mon, 28 Dec 2020 14:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164830; bh=i5fxNS88Br1qWl9mj5hwz5L42n4TG47eRxy5ri6kkbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tz8pN6Zv471CU0/nSjn7F/XT1yuJcbeovQIaIvvaITuqvtgxt9ntoZrMjMgsrpiib kYQ+1y5vxvENFgyeIUxoPuMgiMIaXHL8cCgLHPz5N4FCSK5mFmgjN6uvrehFoVYn8H rziDLk8P9gW9RovmEiqV5gk1qc+QR9e0kbPaOoik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Athira Rajeev , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 283/717] powerpc/perf: Update the PMU group constraints for l2l3 events in power10 Date: Mon, 28 Dec 2020 13:44:41 +0100 Message-Id: <20201228125034.586963923@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: Athira Rajeev [ Upstream commit e924be7b0b0d1f37d0509c854a92c7a71e3cdfe7 ] In Power9, L2/L3 bus events are always available as a "bank" of 4 events. To obtain the counts for any of the l2/l3 bus events in a given bank, the user will have to program PMC4 with corresponding l2/l3 bus event for that bank. Commit 59029136d750 ("powerpc/perf: Add constraints for power9 l2/l3 bus events") enforced this rule in Power9. But this is not valid for Power10, since in Power10 Monitor Mode Control Register2 (MMCR2) has bits to configure l2/l3 event bits. Hence remove this PMC4 constraint check from power10. Since the l2/l3 bits in MMCR2 are not per-pmc, patch handles group constrints checks for l2/l3 bits in MMCR2. Fixes: a64e697cef23 ("powerpc/perf: power10 Performance Monitoring support") Signed-off-by: Athira Rajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1606409684-1589-3-git-send-email-atrajeev@linux.vnet.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/perf/isa207-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c index f57f54f92c10f..38ed450c78557 100644 --- a/arch/powerpc/perf/isa207-common.c +++ b/arch/powerpc/perf/isa207-common.c @@ -311,9 +311,11 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp) } if (unit >= 6 && unit <= 9) { - if (cpu_has_feature(CPU_FTR_ARCH_31) && (unit == 6)) { - mask |= CNST_L2L3_GROUP_MASK; - value |= CNST_L2L3_GROUP_VAL(event >> p10_L2L3_EVENT_SHIFT); + if (cpu_has_feature(CPU_FTR_ARCH_31)) { + if (unit == 6) { + mask |= CNST_L2L3_GROUP_MASK; + value |= CNST_L2L3_GROUP_VAL(event >> p10_L2L3_EVENT_SHIFT); + } } else if (cpu_has_feature(CPU_FTR_ARCH_300)) { mask |= CNST_CACHE_GROUP_MASK; value |= CNST_CACHE_GROUP_VAL(event & 0xff); -- 2.27.0