Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp111784rdg; Tue, 10 Oct 2023 05:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtq1sTw2BMCKQ15GJ1j5dQlxO5viOziEIKrFdpBNHjelrupvg2Y4vWyu6ZgtuqOCLpgAAU X-Received: by 2002:a17:903:32cb:b0:1c3:2ee6:3811 with SMTP id i11-20020a17090332cb00b001c32ee63811mr23566315plr.8.1696942420528; Tue, 10 Oct 2023 05:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696942420; cv=none; d=google.com; s=arc-20160816; b=EtjgFMw0R2XN7SFSWp7fceLlnqbu9DGZxiuU6K6zZD+dNhdwbV60LasEh+hG3Aorb/ 2ir0KYkjvNsyxPjwkc3hJx1bFzE3EuRCaQMLzdiNz7qVoBuvd2pxfUbo/lc3LoUUtUQ+ 8/x7uC+EC5WooVotxNrAKjOBXXV5qA101NAPxHT59niagWeUMxKCAAMHLnTz1MER4+bc 27hgnmofHy59UFJ/Qto6vqyaHKhYZphpp5o08dqf6EonxL4USCvBNNEPKdbh8PEXh5vN TBfSb1yauxqD1CbwUnOYMHm8aBFBXF/zskJO+3AbXD0MGqBhJ2J1jfbxq/XYgFpRxTSf +/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Dr+DOlOaDwcMsCH+aMCrFnUYYmh1UAHbZcE06QZ2DUM=; fh=Him/7TmVVyW+WMIVeI2PRiRnGRiAaF3dvwT+dbuaF4A=; b=Ev5GS+czM3vLrQAyF5/rdb/dBq98eFNHCLQqsSm3JFLOrbj+C/xe5a0SLG/NAXg7On PswJ26MmovJOllkRJ9Ytxsh2FJKmO+2K1SmHtzoSOKaVFfhfCjcTtXNJBRL8BLDbtBWb L87dYIMo4pzENzKG+jJ6Cwuc7UKrc126dP+Tf856tOBT8r4Iy7aZp7GJCgRqTg0GM9+F EDS59b3ExOwuOwZdF/+w+7cg1lTn1qHcW1mA+THX/5jEDtWSlwuh/9z1ldzdgr2ihG1L TQtJR5CAVzvxQ/z11IyFpGfOiFNvvY/7vCVy5QejaJgAmmb5jS/iayRCikSi8tsRRaBj 4BFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id jz6-20020a170903430600b001c5f15d24ffsi11183630plb.116.2023.10.10.05.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 07D6D801C91F; Tue, 10 Oct 2023 05:53:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231966AbjJJMx0 (ORCPT + 99 others); Tue, 10 Oct 2023 08:53:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbjJJMxZ (ORCPT ); Tue, 10 Oct 2023 08:53:25 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D26AEAF; Tue, 10 Oct 2023 05:53:23 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2FBDF1FB; Tue, 10 Oct 2023 05:54:04 -0700 (PDT) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 523E23F762; Tue, 10 Oct 2023 05:53:20 -0700 (PDT) Message-ID: <099dc48f-454a-40cc-aef1-f186643d2a02@arm.com> Date: Tue, 10 Oct 2023 13:53:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] arm: perf: Include threshold control fields valid in PMEVTYPER mask Content-Language: en-US To: James Clark , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Russell King , Marc Zyngier , Oliver Upton , James Morse , Zenghui Yu , Mark Rutland , Reiji Watanabe , Geert Uytterhoeven , Zaid Al-Bassam , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev References: <20231010104048.1923484-1-james.clark@arm.com> <20231010104048.1923484-2-james.clark@arm.com> From: Suzuki K Poulose In-Reply-To: <20231010104048.1923484-2-james.clark@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:53:38 -0700 (PDT) X-Spam-Level: ** On 10/10/2023 11:40, James Clark wrote: > FEAT_PMUv3_TH (Armv8.8) adds two new fields to PMEVTYPER, so include > them in the mask. These aren't writable on 32 bit kernels as they are in > the high part of the register, so split the mask definition to the asm > files for each platform. > > Now where the value is used in some parts of KVM, include the asm file. > > Despite not being used on aarch32, TH and TC macros are added to the > shared header file, because they are used in arm_pmuv3.c which is > compiled for both platforms. > > Signed-off-by: James Clark > --- > arch/arm/include/asm/arm_pmuv3.h | 3 +++ > arch/arm64/include/asm/arm_pmuv3.h | 4 ++++ > arch/arm64/kvm/pmu-emul.c | 1 + > arch/arm64/kvm/sys_regs.c | 1 + > include/linux/perf/arm_pmuv3.h | 3 ++- > 5 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/arm_pmuv3.h b/arch/arm/include/asm/arm_pmuv3.h > index 72529f5e2bed..491310133d09 100644 > --- a/arch/arm/include/asm/arm_pmuv3.h > +++ b/arch/arm/include/asm/arm_pmuv3.h > @@ -9,6 +9,9 @@ > #include > #include > > +/* Mask for writable bits */ > +#define ARMV8_PMU_EVTYPE_MASK 0xc800ffff > + > #define PMCCNTR __ACCESS_CP15_64(0, c9) > > #define PMCR __ACCESS_CP15(c9, 0, c12, 0) > diff --git a/arch/arm64/include/asm/arm_pmuv3.h b/arch/arm64/include/asm/arm_pmuv3.h > index 18dc2fb3d7b7..4faf4f7385a5 100644 > --- a/arch/arm64/include/asm/arm_pmuv3.h > +++ b/arch/arm64/include/asm/arm_pmuv3.h > @@ -11,6 +11,10 @@ > #include > #include > > +/* Mask for writable bits */ > +#define ARMV8_PMU_EVTYPE_MASK (0xc800ffffUL | ARMV8_PMU_EVTYPE_TH | \ > + ARMV8_PMU_EVTYPE_TC) > + > #define RETURN_READ_PMEVCNTRN(n) \ > return read_sysreg(pmevcntr##n##_el0) > static inline unsigned long read_pmevcntrn(int n) > diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c > index 6b066e04dc5d..0666212c0c15 100644 > --- a/arch/arm64/kvm/pmu-emul.c > +++ b/arch/arm64/kvm/pmu-emul.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include You may want to mention in the commit description that there is no impact on the KVM emulating the Guest PMU with this change, as it ignores the fields in the upper half for setting up the attributes for the backing event. Suzuki