From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5DD6C2BD09 for ; Wed, 3 Jul 2024 07:24:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PNR21walsmmPlKx+EEnlCN9q2DuGCXQodYRLsZHa6hg=; b=uHyN0qFKa8fkVD7micyjd+3/52 EG1vfUp5Cifunxv8umYLtapeHwAknYfgtuz7/YXzscO/Luv96/chjO/q2FlscYgUjlD836ZtRNMB2 yg47on9i0KtNTlU3Qm8HbcY8FYf48gW+zvxqqafS76ax7bs6FGqwACf+hRDtdL/mOgvdtQJXOu08R GIHS6Ci7zniNXaZ0XvzAvJETLyUW5hwGnhLDYHzUlx6JIPrFdBh9crBepzQnL6GoRNirmes7oC2WD LBrQFEzlvLGX7VDOKH2P0AW//dx2kEIIN/lHv4enSN5zulcCNmUmbObDBOav3Fpyn4b02weGfzYWJ DDQGG6Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOuLK-00000009K0K-2VO5; Wed, 03 Jul 2024 07:23:54 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOuL8-00000009Jy2-0a9D for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 07:23:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3E24CCE1FB7; Wed, 3 Jul 2024 07:23:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78E01C2BD10; Wed, 3 Jul 2024 07:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719991419; bh=bU/2YsOmK16v0fOdsJ38br5N/4af3GRgBNGqmZiO8vI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nmY77SKan33oVV7BCDgh9UdHHeEJg95y4e4aq46WP/By1OUdh7ymaLPuAOzwyeFcI Azyn1U4InRUI9MjEX5g/LTA0xXPJkqXiVDiOpGz8dHwi/xbKzJnx4gIle3yrlH93Kt jiyWwpSA3KLs0M7+Gwkh7zGQhSD8KRVVp4LMbjhjJF9VgZR5TYA3x+nSZC8Ri41siP Rdp3GQGCbzd1d0/ZM8Hw0WjEIcO60VqN7IJySppYsew1BFzWGKCP67U5plxEY/RfRw ZBpiFTblyfea6k0wvlxGPNNMkOSSCu+rWQXSuwSmJZsDHaB4z+R5rceCeJQO1ZRER5 QI+MaDADhNu8A== Received: from disco-boy.misterjones.org ([217.182.43.188] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sOuL3-009LsO-75; Wed, 03 Jul 2024 08:23:37 +0100 MIME-Version: 1.0 Date: Wed, 03 Jul 2024 08:23:37 +0100 From: Marc Zyngier To: Zenghui Yu Cc: =?UTF-8?Q?Alex_Benn=C3=A9e?= , pbonzini@redhat.com, thuth@redhat.com, kvm@vger.kernel.org, qemu-arm@nongnu.org, linux-arm-kernel@lists.infradead.org, christoffer.dall@arm.com, Anders Roxell , Andrew Jones , Alexandru Elisei , Eric Auger , "open list:ARM" Subject: Re: [kvm-unit-tests PATCH v1 1/2] arm/pmu: skip the PMU introspection test if missing In-Reply-To: <8c11996c-b36d-e560-cdeb-e543ee478a54@huawei.com> References: <20240702163515.1964784-1-alex.bennee@linaro.org> <20240702163515.1964784-2-alex.bennee@linaro.org> <8c11996c-b36d-e560-cdeb-e543ee478a54@huawei.com> User-Agent: Roundcube Webmail/1.4.15 Message-ID: <74e184afbc4b58fba984b91964915a9e@kernel.org> X-Sender: maz@kernel.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 217.182.43.188 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, alex.bennee@linaro.org, pbonzini@redhat.com, thuth@redhat.com, kvm@vger.kernel.org, qemu-arm@nongnu.org, linux-arm-kernel@lists.infradead.org, christoffer.dall@arm.com, anders.roxell@linaro.org, andrew.jones@linux.dev, alexandru.elisei@arm.com, eric.auger@redhat.com, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_002342_556189_B8244FB9 X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024-07-03 08:09, Zenghui Yu wrote: > On 2024/7/3 0:35, Alex Bennée wrote: >> The test for number of events is not a substitute for properly >> checking the feature register. Fix the define and skip if PMUv3 is not >> available on the system. This includes emulator such as QEMU which >> don't implement PMU counters as a matter of policy. >> >> Signed-off-by: Alex Bennée >> Cc: Anders Roxell >> --- >> arm/pmu.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/arm/pmu.c b/arm/pmu.c >> index 9ff7a301..66163a40 100644 >> --- a/arm/pmu.c >> +++ b/arm/pmu.c >> @@ -200,7 +200,7 @@ static void test_overflow_interrupt(bool >> overflow_at_64bits) {} >> #define ID_AA64DFR0_PERFMON_MASK 0xf >> #define ID_DFR0_PMU_NOTIMPL 0b0000 >> -#define ID_DFR0_PMU_V3 0b0001 >> +#define ID_DFR0_PMU_V3 0b0011 > > Why? This is a macro used for AArch64 and DDI0487J.a (D19.2.59, the > description of the PMUVer field) says that > > "0b0001 Performance Monitors Extension, PMUv3 implemented." > > while 0b0011 is a reserved value. I think this is a mix of 32bit and 64bit views (ID_DFR0_EL1.PerfMon instead of ID_AA64DFR0_EL1.PMUVer), and the whole thing is a mess (ID_AA64DFR0_PERFMON_MASK is clearly confused...). I haven't looked at how this patch fits in the rest of the code though. M. -- Jazz is not dead. It just smells funny...