Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6623983rdb; Fri, 15 Dec 2023 04:10:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkNnSarrroT25C80zELH4SCJpH8zxfz3EU/Gby6vQdreAXfTQhIAgFxSLBFgPiJmxPXIeW X-Received: by 2002:a17:902:f2ca:b0:1d3:47c6:b8fb with SMTP id h10-20020a170902f2ca00b001d347c6b8fbmr5217435plc.23.1702642233269; Fri, 15 Dec 2023 04:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702642233; cv=none; d=google.com; s=arc-20160816; b=OG8pSSI7xiio/mNnmnZ4ITLbqWlzU2VQUFuE5NRzguZbddYKAmZG6FVsWOmyyV3Uvp eoepGIX7+PH/IuGD6R3lEdkaEd2jronVpZTF8EGQ9UHukxlNwP2RSJbf7n9f02cBrU3v XaD79Fa2BW7Ok31uCrUiLSutuHP1xe2iyKebc4oV1h9ETYCi87/n0oOaLKjIeVf8rkKz CDdoUFlJx2DzoaeTMTsTmQJvMn+uVDLxe2TJEOUK4sjyNW1m7QgW5ySLGGw/vPRz/r8l 4FW26IyzNmTdAIWqqJz6rZR2cp3Op4kIz6aOm0uFTRLgidX4jGoMQuzAoy0lZhZDA87Q zuMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=nKbXFhdhYypvnwjBDp9Skq1XoTXeL4M/BVFji5Yhgd0=; fh=4HevWhpAA32L/cHz7/syPo4dfQ2YVYNY4wPirxtHpIk=; b=AVTzIsD5YVOucZ4VQcsVED0eTvQQlDPN9Sb/HPKU9AxwRInujiEQ5gRuy80xQjS+Dw t9AUmJL20tndl/ubbCs3Vr6sVxVQCr2BWpjJTvR8pLQiuUvQSj2TDJSHearyljpmIyFE QO1E5iX0uqMarq2iH5BAsUUTxiQvVW2V8FxlKTuhaTkpqRVg+BLR7SGc1u9rzOegze8g yv4Dq/qGOMm1b7qxpgjZD9jYMvhMbocm56Xn7YG1MZacRC+y8FVKKWw776yPcQvu2DLb tMxLACry8DTrl+I6aWGKqaXlIVe0COUENMwLjajvjvEVZ9VPgmcoYfsTqB5Isb2A53vj G0/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-898-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jb22-20020a170903259600b001d34cb55b86si4607881plb.549.2023.12.15.04.10.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 04:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-898-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-898-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 63A82B22345 for ; Fri, 15 Dec 2023 12:10:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE4FB28E23; Fri, 15 Dec 2023 12:10:05 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBE2919469 for ; Fri, 15 Dec 2023 12:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rE6zO-0001Th-VU; Fri, 15 Dec 2023 13:08:22 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rE6zK-00G18H-0I; Fri, 15 Dec 2023 13:08:18 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rE6zJ-003Wy8-ML; Fri, 15 Dec 2023 13:08:17 +0100 Date: Fri, 15 Dec 2023 13:08:17 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: James Clark Cc: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, suzuki.poulose@arm.com, will@kernel.org, mark.rutland@arm.com, anshuman.khandual@arm.com, namhyung@gmail.com, Catalin Marinas , Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Russell King , Marc Zyngier , Oliver Upton , James Morse , Zenghui Yu , Paolo Bonzini , Shuah Khan , Zaid Al-Bassam , Raghavendra Rao Ananta , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v7 05/11] arm64: perf: Include threshold control fields in PMEVTYPER mask Message-ID: <20231215120817.h2f3akgv72zhrtqo@pengutronix.de> References: <20231211161331.1277825-1-james.clark@arm.com> <20231211161331.1277825-6-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ngsobzumwfjdiywd" Content-Disposition: inline In-Reply-To: <20231211161331.1277825-6-james.clark@arm.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --ngsobzumwfjdiywd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Mon, Dec 11, 2023 at 04:13:17PM +0000, 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 only include them for arm64. >=20 > It would be difficult to do this statically in the asm header files for > each platform without resulting in circular includes or #ifdefs inline > in the code. For that reason the ARMV8_PMU_EVTYPE_MASK definition has > been removed and the mask is constructed programmatically. >=20 > Reviewed-by: Suzuki K Poulose > Reviewed-by: Anshuman Khandual > Signed-off-by: James Clark This change is in today's next as commit 3115ee021bfb04efde2e96507bfcc1330261a6a1. this breaks allmodconfig building on ARCH=3Darm: In file included from include/linux/ratelimit_types.h:5, from include/linux/printk.h:9, from include/asm-generic/bug.h:22, from arch/arm/include/asm/bug.h:60, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/percpu.h:5, from include/asm-generic/irq_regs.h:11, from ./arch/arm/include/generated/asm/irq_regs.h:1, from drivers/perf/arm_pmuv3.c:11: drivers/perf/arm_pmuv3.c: In function =E2=80=98armv8pmu_write_evtype=E2=80= =99: include/linux/bits.h:34:29: error: left shift count >=3D width of type [-W= error=3Dshift-count-overflow] 34 | (((~UL(0)) - (UL(1) << (l)) + 1) & \ | ^~ include/linux/bits.h:37:38: note: in expansion of macro =E2=80=98__GENMASK= =E2=80=99 37 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) | ^~~~~~~~~ include/linux/perf/arm_pmuv3.h:238:33: note: in expansion of macro =E2=80= =98GENMASK=E2=80=99 238 | #define ARMV8_PMU_EVTYPE_TC GENMASK(63, 61) | ^~~~~~~ drivers/perf/arm_pmuv3.c:567:25: note: in expansion of macro =E2=80=98ARMV= 8_PMU_EVTYPE_TC=E2=80=99 567 | mask |=3D ARMV8_PMU_EVTYPE_TC | ARMV8_PMU_EVTYPE_T= H; | ^~~~~~~~~~~~~~~~~~~ include/linux/bits.h:35:18: error: right shift count is negative [-Werror= =3Dshift-count-negative] 35 | (~UL(0) >> (BITS_PER_LONG - 1 - (h)))) | ^~ include/linux/bits.h:37:38: note: in expansion of macro =E2=80=98__GENMASK= =E2=80=99 37 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) | ^~~~~~~~~ include/linux/perf/arm_pmuv3.h:238:33: note: in expansion of macro =E2=80= =98GENMASK=E2=80=99 238 | #define ARMV8_PMU_EVTYPE_TC GENMASK(63, 61) | ^~~~~~~ drivers/perf/arm_pmuv3.c:567:25: note: in expansion of macro =E2=80=98ARMV= 8_PMU_EVTYPE_TC=E2=80=99 567 | mask |=3D ARMV8_PMU_EVTYPE_TC | ARMV8_PMU_EVTYPE_T= H; | ^~~~~~~~~~~~~~~~~~~ include/linux/bits.h:34:29: error: left shift count >=3D width of type [-W= error=3Dshift-count-overflow] 34 | (((~UL(0)) - (UL(1) << (l)) + 1) & \ | ^~ include/linux/bits.h:37:38: note: in expansion of macro =E2=80=98__GENMASK= =E2=80=99 37 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) | ^~~~~~~~~ include/linux/perf/arm_pmuv3.h:237:33: note: in expansion of macro =E2=80= =98GENMASK=E2=80=99 237 | #define ARMV8_PMU_EVTYPE_TH GENMASK(43, 32) | ^~~~~~~ drivers/perf/arm_pmuv3.c:567:47: note: in expansion of macro =E2=80=98ARMV= 8_PMU_EVTYPE_TH=E2=80=99 567 | mask |=3D ARMV8_PMU_EVTYPE_TC | ARMV8_PMU_EVTYPE_T= H; | ^~~~~~~~~~~~~~~~~~~ include/linux/bits.h:35:18: error: right shift count is negative [-Werror= =3Dshift-count-negative] 35 | (~UL(0) >> (BITS_PER_LONG - 1 - (h)))) | ^~ include/linux/bits.h:37:38: note: in expansion of macro =E2=80=98__GENMASK= =E2=80=99 37 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l)) | ^~~~~~~~~ include/linux/perf/arm_pmuv3.h:237:33: note: in expansion of macro =E2=80= =98GENMASK=E2=80=99 237 | #define ARMV8_PMU_EVTYPE_TH GENMASK(43, 32) | ^~~~~~~ drivers/perf/arm_pmuv3.c:567:47: note: in expansion of macro =E2=80=98ARMV= 8_PMU_EVTYPE_TH=E2=80=99 567 | mask |=3D ARMV8_PMU_EVTYPE_TC | ARMV8_PMU_EVTYPE_T= H; | ^~~~~~~~~~~~~~~~~~~ I guess that's easy to fix but I didn't look into that. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=C3=B6nig = | Industrial Linux Solutions | https://www.pengutronix.de/ | --ngsobzumwfjdiywd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmV8QbAACgkQj4D7WH0S /k7AiQf+P2oUWv7SoB0VqSdzaQDZiVP5cLTAQNAUd2/KvKLHcynNocmMBs36c3pg o+x8tw5H8hmrOREyHLMq2dFVFQOzDjUpzVl/UtvewEwJ/wer59fr31E2+O4d3RzB HbLD/OuVTL88TWye1hyv+43iSoG4gfff9n9SBsr/423tBmEqnCkIv/A7CMzawZMi Nr4oV5P03hNhNXEFy4OxIVfuLmAVxIlK4EtUtMErE/+UHeJL6gs+nhOW38UwNR+c +9uau7zzuYGeBWLmiDYGPteZWs0/DB9/WO5xm+U4eA10oQSho6Tjd8DS4ls2katc cDqpu8z3U3vqJXktpE5/swkSxSAuWQ== =wXB9 -----END PGP SIGNATURE----- --ngsobzumwfjdiywd--