From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BA171215044; Wed, 19 Feb 2025 18:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739989024; cv=none; b=OkyLoCjALbeDThRA1I7I/lkzJKxYnNX15XZ1jCdN5BM/SZ1LKmquXjlXeb9iQgiwwTEduB6qWyXG1JNBHQuEbIetEJ0MlCUaJBVdGoz4J1+Ni4E23s/qiE6W9/HmInGzUNu/8g3DXotQ9EeH1wHWuWJHaPEjhMWGG7QDMYqQEiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739989024; c=relaxed/simple; bh=DsGGofnDzKUQbDmEHUxv9uMf75t8hgC8FbDUK8smE60=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Q+ZNui8Ob8cCJcgpwxA6aHmw+QFEPLOzvxk0XiuNn0XZFm8RMIZFKQfuHvFQx10xaZ0kW6jyedxlZLZ740dlKj8yd2zvdnsGr4OvdQ13tmoW8mAOHFL+7TJ9n74liD+cK3DBvajmI9iUB+qWxkkGMScUzVMPBOS9UA/55Edle4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SIaHwZEi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SIaHwZEi" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.