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 77DC9278E5E for ; Fri, 11 Apr 2025 12:00:53 +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=1744372853; cv=none; b=X1d/FlclNyx8xq65Co6a8t6V2rya0cgpWrbjRADeIStOIisTvQQZUdAaf18B5Fw+bvCHBKnPO1QQNFda9Mv48BVbBZGbszfPj52UqRpC/UvoEnQ5kQqOZWiLk0E+8iuLVOXH+QZ8WirZShoVTlxFD03ohh6p0cueSSZp9bBFbxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744372853; c=relaxed/simple; bh=3euX4DlHAJTsluPzite/+5LrBYmEck4I41EL+dvmm5A=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=oCXK+EA8zZ2jqFKbOXE1FDagMFoVRda4LKCrKTIRlP7IqVMyxaCqO6IGgAokvBpALY2T+wgnKEMbqyrC9q3mFI6z8yKl+YtGE1NXQzdMqYPWE1hg7jHnN7JOMFX38tNYRNOROLdDWKWfF/WVP7Fcn0/xIAdocWZwTCtiWJVtG5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=daV7/Y03; 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="daV7/Y03" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00A35C4CEE2; Fri, 11 Apr 2025 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744372853; bh=3euX4DlHAJTsluPzite/+5LrBYmEck4I41EL+dvmm5A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=daV7/Y03ZcQr5lsv+iqnKU7Ck7kPGQevKiyNyPfZD7oElm6tLD/91cmENy+VqiIQm VmVHV2/GUBoTRJV25fDW6hmRCZ/WIUnrcDbP2zEX9GondGR8CqMPK33t1bU0kSPzC9 ZgzqwVpfkxcgYgStLAJHEm06VFnf0mZAKA0qi3Ctqj1WuDdZ8JzlpFjTJJbnHxBZwf SAjzLu7ywZaCqHljh7IgTdK+WaqwIZXTlYbuaGS+yMTpfZnAtJJZr1PbGdm0l8HMq7 FneqnLgSERNq6/bSEo173pfCRZXe3IoheClwrz/UBFOsdX1MHbSLHF8l9sdbuOPio2 zDsCF7dCFAHCg== 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 1u3D3y-004YOL-J3; Fri, 11 Apr 2025 13:00:50 +0100 Date: Fri, 11 Apr 2025 13:00:50 +0100 Message-ID: <86cydilxfx.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Joey Gouly , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH v2 0/6] KVM: arm64: EL2 PMU handling fixes In-Reply-To: References: <20250409160106.6445-1-maz@kernel.org> 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: kvmarm@lists.linux.dev 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, linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 09 Apr 2025 21:31:31 +0100, Oliver Upton wrote: > > On Wed, Apr 09, 2025 at 05:01:00PM +0100, Marc Zyngier wrote: > > Joey reports that some of his PMU tests do not behave quite as > > expected: > > > > - MDCR_EL2.HPMN is set to 0 out of reset > > > > - PMCR_EL0.P should reset all the counters when written from EL2 > > > > Oliver points out that setting PMCR_EL0.N from userspace by writing to > > the register is silly with NV, and that we need a new PMU attribute > > instead. > > > > On top of that, I figured out that we had a number of little gotchas: > > > > - It is possible for a guest to write an HPMN value that is out of > > bound, and it seems valuable to limit it > > > > - PMCR_EL0.N should be the maximum number of counters when read from > > EL2, and MDCR_EL2.HPMN when read from EL0/EL1 > > > > - Prevent userspace from updating PMCR_EL0.N when EL2 is available > > > > I haven't added any Cc stable, as NV is not functional upstream yet. > > Similarly, I don't see a compelling reason for this to go in as a fix > for 6.15, especially since you're adding new UAPI. Do you mind grabbing > it for the next merge window? > > With the comments addressed: > > Reviewed-by: Oliver Upton Thanks. I'll repost the whole thing next week and queue it for 6.16. M. -- Without deviation from the norm, progress is not possible.