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 CCF06C021B0 for ; Wed, 19 Feb 2025 18:18:48 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8C9W46l3FPaFoN0sWtC7LB1yKPLIdRTD9liokW949Dc=; b=MjtlD51kK4HQpz466mPSNOeO+q 1hCWdys8Ly+oHH6ZHTdzYd9OZJScjndIZOKyYhXg6lx0bxJ/pQQBFtgTP4apton6py5ymKIGXhpQP cp0urM1Vv4di3y8uCmIl0G9DIBwF1nhSP2PqpUaTfM+o/tep50Y/YOoALEDi2dv37JCug7vFkxq24 xHd6TgAM1Nij0i1qh/QO3I1Fgyyk8Ct6BmCy3v+lG5x9JyG3u9zOoAIE/TQzZEs3/544NmeINcVAK 35i7Q16Ff4u4SnHVs4QUB1SDYghswkQlzLuT98CEwiyj0TnFQXkAY3vutBdapL6cigHr0QFjgz54d 9BwEJvdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkoeb-0000000EJAX-2UqR; Wed, 19 Feb 2025 18:18:37 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkod7-0000000EInM-0Ouw for linux-arm-kernel@lists.infradead.org; Wed, 19 Feb 2025 18:17:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 38F6E5C5BD2; Wed, 19 Feb 2025 18:16:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33978C4CED1; Wed, 19 Feb 2025 18:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739989024; bh=DsGGofnDzKUQbDmEHUxv9uMf75t8hgC8FbDUK8smE60=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SIaHwZEieT201WAL6Zk7NSYy7kj/ZnVkCqLA7vWQgDoXC/fx7GtDC6ohFzJatO4uj pz6eAx9/QPSV+jB+l87OzEnnG3nvlT8nR+spUptocIrUtqbcp0y431D3/KLkXWPn8c haE3dICihF53YjJ74YnU69bbFa+6jMRABfNzFGhcGblC/k2rAAw5jmYANWTVCK5e05 YVm1c7TCBkAp4tFCIPYDTm6kX4l0JWP45o1CbUAwcIBLJVFyjxbus61QMONd+Q9Rlm HkEkpc34O1/Od1PWYzI2knIwJVAnxxKXDQspcziUX7+4JLUI/iyRRbBboeY61fBQ8r u6Fn453tm7DxA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tkod4-005v6y-0h; Wed, 19 Feb 2025 18:17:02 +0000 Date: Wed, 19 Feb 2025 18:17:00 +0000 Message-ID: <861pvtsstf.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, Joey Gouly , Suzuki K Poulose , Zenghui Yu , Mingwei Zhang , Colton Lewis , Raghavendra Rao Ananta , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Janne Grunau Subject: Re: [PATCH v2 10/14] KVM: arm64: Move PMUVer filtering into KVM code In-Reply-To: <20250203183111.191519-11-oliver.upton@linux.dev> References: <20250203183111.191519-1-oliver.upton@linux.dev> <20250203183111.191519-11-oliver.upton@linux.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, mizhang@google.com, coltonlewis@google.com, rananta@google.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, j@jannau.net 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-20250219_101705_220907_DFCC20A2 X-CRM114-Status: GOOD ( 18.66 ) 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 Mon, 03 Feb 2025 18:31:07 +0000, Oliver Upton wrote: > > The supported guest PMU version on a particular platform is ultimately a > KVM decision. Move PMUVer filtering into KVM code. > > Tested-by: Janne Grunau > Signed-off-by: Oliver Upton > --- > arch/arm64/include/asm/cpufeature.h | 23 ----------------------- > arch/arm64/kvm/pmu-emul.c | 15 +++++++++------ > 2 files changed, 9 insertions(+), 29 deletions(-) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index 0eff048848b8..c4326f1cb917 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -525,29 +525,6 @@ cpuid_feature_extract_unsigned_field(u64 features, int field) > return cpuid_feature_extract_unsigned_field_width(features, field, 4); > } > > -/* > - * Fields that identify the version of the Performance Monitors Extension do > - * not follow the standard ID scheme. See ARM DDI 0487E.a page D13-2825, > - * "Alternative ID scheme used for the Performance Monitors Extension version". > - */ > -static inline u64 __attribute_const__ > -cpuid_feature_cap_perfmon_field(u64 features, int field, u64 cap) > -{ > - u64 val = cpuid_feature_extract_unsigned_field(features, field); I guess this is where this idiom is coming from. I think it'd be worth revisiting it here as well as in the last patch. Thanks, M. -- Without deviation from the norm, progress is not possible.