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 724AF303A04; Tue, 21 Apr 2026 16:46:01 +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=1776789961; cv=none; b=jBR0KeumST2Ik0KHrVj66WZKNEk2ZXvcV3gYOKyFgJdJyf2z5LnaRS4fKIwoVhgawRF+urkbTLt0VuAh2w/DrbSgqRMSSPnZMgauW2nYav9IdhKcYrjgjC4fwmsu7+oS8BphCkFRmNaaj9fFAPcWxQBNGq8r35LgA16+iFozYL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776789961; c=relaxed/simple; bh=xVFyy3In7iyaJKA5KQrp6T21C59AcxNsHdrAWxPWRro=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=kUiCBU7GZfWzUnR1IbmY73VLcl5ysNktuGGpgxHanhuHcn8piLOYLufJlOI+Rk13TX//0xNZ8Zt4KW2pfaWy80j5fzKqYQR4Rjq35j/yCVQD1Fcl3uOFWT0FrM5qAmhid1NLvBjZ0WDGylnEJdGaq114aS/a3TwPhlw/j1lydy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V2tW2gK1; 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="V2tW2gK1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E345EC2BCB0; Tue, 21 Apr 2026 16:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776789960; bh=xVFyy3In7iyaJKA5KQrp6T21C59AcxNsHdrAWxPWRro=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V2tW2gK1iv2iIepeWIcM1uVxRBY1gllfjq3VaaO73nT466WuQRT3PgKAcTiUQJBdS rX7H2QXRXlxTa6Pb8oKMkS1PfGOnFdlHSMOVVbm6Hamn29BZ/9tnXBYTDI0KlXXTDO 73D3fSNMFSLGNzsraAgrjvkhJQu8xkULzVipb4I676I948TWH3yi2Acngdoq0Lks4O 2f9TVQmWTeedE6anja10x1riWgvrZErvYxZbOg5xAq8gnoRykFMDnR5tGgoaB+eIxq Es1iP9PK3gMkpjPjuF/V6wT+41VmeS1WevEhFur0/Dtwdyc2FAB+nqgTan7GYjEuO/ +ikNrF8a50y4g== 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.98.2) (envelope-from ) id 1wFEEY-0000000DUc9-1vVG; Tue, 21 Apr 2026 16:45:58 +0000 Date: Tue, 21 Apr 2026 17:45:58 +0100 Message-ID: <86h5p41cu1.wl-maz@kernel.org> From: Marc Zyngier To: Jing Zhang Cc: KVM , KVMARM , ARMLinux , Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini Subject: Re: [PATCH] KVM: arm64: Treat ID_AA64DFR0_EL1.PMUVer as an unsigned field In-Reply-To: <20260421164112.2448553-1-jingzhangos@google.com> References: <20260421164112.2448553-1-jingzhangos@google.com> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@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: jingzhangos@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, pbonzini@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 21 Apr 2026 17:41:12 +0100, Jing Zhang wrote: > > ID_AA64DFR0_EL1.PMUVer is an unsigned 4-bit field, but was historically > marked as signed in the cpufeature table. This led > kvm_init_host_debug_data() to fail detection of PMUv3 implementation on > systems with PMUv3p8 or newer, as the signed extraction of the field > (e.g., 0b1000 for PMUv3p8) would result in a negative value. > > Fix this by marking the field as unsigned in the ftr_id_aa64dfr0 table > and updating the KVM initialization code to use unsigned extraction. > While at it, ensure that both the 'Not Implemented' (0b0000) and > 'Implementation Defined' (0b1111) values are correctly handled as > indicating the absence of a standard PMUv3. > > Signed-off-by: Jing Zhang https://lore.kernel.org/all/20260305-james-kvm-pmuver-sign-v2-0-ee80a125af9b@linaro.org/ M. -- Without deviation from the norm, progress is not possible.