Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4188953pxb; Mon, 8 Feb 2021 09:59:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzn7FgNxi/Yie0UXvsIe6tpMSglFY6ty9R+JjNvJ80mNmqxuszfEp96N5Ophuc8rFnvh9pn X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr9043201ejc.419.1612807188427; Mon, 08 Feb 2021 09:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612807188; cv=none; d=google.com; s=arc-20160816; b=p09rgAGWt+c4HtOHp64OV8SjXiuDAKMMkDHQ0tP4ZY/keosNIuOI0AD+LJOVBJpFkP PP7y0SfhOiY64wNW1XMrofX3qFhO0UQwgC5V39piJbvACfvaAfOfQ46ybMyuXaDpcOP6 Td6nkcd8pXTlZNVmg7p84STcqkHqhaDn3gd1GUZun1/hKesRDWsRI7l35E2sxEePcvrN 7wLs7yASFLTa+/kISp3gjUxIPYjVWabRGPoGS4/o+mxVxmLNrIp7tv4try+tR/obbFH8 VxYGciv+HveymKyNiwgkPQzI4Z0qclVSTMMgBxmZvBatAaNvHfa/YFSom8ARCBMxR7up 5/qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=5hLC6rBKavVxf42n1Br/hz6Rbp5q0HYhwJpYFSZaiwI=; b=w2gGJuMbF7gGEJfY5cZgmu5c1McczPd9FiJjBIJY5qvasGq0idK5+6Sb4Ro8RLyefa qsTeY4eDWxFgB+MVC75EK/fpDr2JXOtjtKYY/ok5umLcQujJVK0J9gfpjUGj7kkeHPd8 aEmdsF7G16ncSVIjWXwV/2vHIGgkx8SDFSfQe2VGToBwacZbBRvNb6bV2/m40IxniCtQ Gl0MbfOPetxJFHIGJkd/TL0n6ucwq7SJVaFXGBQ/W22o1MX5mtgcS7eyGTgjTFXKjeMm jI/rDBfgHKsqnVjXXBefK6UGutfyUo1YYxbHOyPWC0aDtYT5a2WM5tL6Tfk8wEUxpl6k i25Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si11516894ejx.19.2021.02.08.09.59.25; Mon, 08 Feb 2021 09:59:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234383AbhBHR6n (ORCPT + 99 others); Mon, 8 Feb 2021 12:58:43 -0500 Received: from mga14.intel.com ([192.55.52.115]:62780 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233954AbhBHPfK (ORCPT ); Mon, 8 Feb 2021 10:35:10 -0500 IronPort-SDR: WZFArjgOFuLw1mgb/cEaIDwnmBj/miZTKPrSC3s/c368lHXQguGlf7+7Ja4X3nup+PBnM+BlRm itjQgsQ4hM/g== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="180951909" X-IronPort-AV: E=Sophos;i="5.81,162,1610438400"; d="scan'208";a="180951909" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 07:30:04 -0800 IronPort-SDR: M0glvaKOjAT7iu+uQKwqZ8I9BjUrFnZPGWLoe+mZTiPAXC9gCAg5T4bBtPIvKKIpTQKexk/j/s oe9bzWJULnfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,162,1610438400"; d="scan'208";a="358820555" Received: from otc-lr-04.jf.intel.com ([10.54.39.41]) by orsmga003.jf.intel.com with ESMTP; 08 Feb 2021 07:30:03 -0800 From: kan.liang@linux.intel.com To: peterz@infradead.org, acme@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, bp@alien8.de, namhyung@kernel.org, jolsa@redhat.com, ak@linux.intel.com, yao.jin@linux.intel.com, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, Kan Liang Subject: [PATCH 06/49] perf/x86: Hybrid PMU support for unconstrained Date: Mon, 8 Feb 2021 07:25:03 -0800 Message-Id: <1612797946-18784-7-git-send-email-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612797946-18784-1-git-send-email-kan.liang@linux.intel.com> References: <1612797946-18784-1-git-send-email-kan.liang@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang The unconstrained value depends on the number of GP and fixed counters. Each hybrid PMU should use its own unconstrained. Reviewed-by: Andi Kleen Signed-off-by: Kan Liang --- arch/x86/events/intel/core.c | 5 ++++- arch/x86/events/perf_event.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 3b8d728..9baa6b6 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3147,7 +3147,10 @@ x86_get_event_constraints(struct cpu_hw_events *cpuc, int idx, } } - return &unconstrained; + if (!HAS_VALID_HYBRID_PMU_IN_CPUC(cpuc)) + return &unconstrained; + + return &x86_pmu.hybrid_pmu[cpuc->hybrid_pmu_idx].unconstrained; } static struct event_constraint * diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index bda4bdc..f11dbc4 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -651,6 +651,7 @@ struct x86_hybrid_pmu { int max_pebs_events; int num_counters; int num_counters_fixed; + struct event_constraint unconstrained; }; #define IS_X86_HYBRID cpu_feature_enabled(X86_FEATURE_HYBRID_CPU) -- 2.7.4