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 1D33053365 for ; Sun, 25 Aug 2024 08:16:37 +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=1724573798; cv=none; b=n8vofK1IW6425c9nOdlwPE1H6u7J+h1lyzuhvaZuPLtQdf/ToXx3lFgftIx+vA/hBip29kNrU01Uxs8gZgJsx/0NAVtOs8zy/6dsKfYlUnOErLMpeTEYpm0fl0H2p1yGHK3mm/61MKrtktH6waz09uNTXDQ0OEn/j0Zaesdonlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724573798; c=relaxed/simple; bh=Q5MM0Bk7QQETveLGxvwXY/Ap1w+V4XneBVdkR8i2ZeA=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=owapqjOfkYBR423sS2ewK9CsypVZOeZpNzBi1+OetkkvhP/pcc0LhC/LPgUrCR8cXvoJ/b80a6SrBjR4OoMAOJaFp0wvMxkl6Wica4p7BkBT8I1S0yh08uPwwRJwvSEgQSRsXXoaWMoUuhKuS4I/C4O13CTVeoNTXo3n+qyMseo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YVSylgOr; 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="YVSylgOr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B5EDC32782; Sun, 25 Aug 2024 08:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724573797; bh=Q5MM0Bk7QQETveLGxvwXY/Ap1w+V4XneBVdkR8i2ZeA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YVSylgOr/+ggqIlmEVQERzMNG5KvLLZGeh3Qi+BPPDxiC9xVgg/fmBFXIu/H9k02J ccxaVcPExeSvJuGUZ8+6szz1kt8VmT4YWx3K971GiAfcgS+6k3YyJPXmfaoa/GJqSF yuomdE2lnTiGq2NGliLIRgpbfRXgLuEjz82lvm+/ihRbyMNGP1/j0/c+Zmunt2K/aj rKsYJnDvZvcWWVoM32J6E0F4dagg71mrcoV/TG9FltJXE7rDdcslU+uUgZieIdns0K +/vBb7maheaNAqA6OnnsXPNOApKXKmkP7RLxkLbik8MxyVi1gt7QZVm2heGXO3ORMH qoZT2w5ZJ8ADA== 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 1si8QM-006dKA-SU; Sun, 25 Aug 2024 09:16:34 +0100 Date: Sun, 25 Aug 2024 09:16:33 +0100 Message-ID: <86v7zpvwym.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, James Morse , Suzuki K Poulose , Zenghui Yu , Ganapatrao Kulkarni Subject: Re: [PATCH 0/3] KVM: arm64: nv: Add EL2 PMU event filtering support In-Reply-To: <20240824001402.3909504-1-oliver.upton@linux.dev> References: <20240824001402.3909504-1-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: 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, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, gankulkarni@os.amperecomputing.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Sat, 24 Aug 2024 01:13:59 +0100, Oliver Upton wrote: > > We allow a nested VM to be configured with a vPMU, although it isn't > entirely functional. We do not currently respect the EL2 event filter > configuration from the guest hypervisor, which really needs to be > applied to EL1 when in a hyp context. > > Series to do just that. Tested on Neoverse-V2 which fortunately > implements PMUv3 and NV, unlike the fruity stuff I'm typically using... > > Oliver Upton (3): > KVM: arm64: Add helpers to determine if PMC counts at a given EL > KVM: arm64: nv: Honor NSH filter when in hyp context > KVM: arm64: nv: Reprogram PMU events affected by nested transition > > arch/arm64/kvm/emulate-nested.c | 4 ++ > arch/arm64/kvm/pmu-emul.c | 77 ++++++++++++++++++++++++++++----- > include/kvm/arm_pmu.h | 3 ++ > 3 files changed, 72 insertions(+), 12 deletions(-) > > > base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba I had a quick look, and definitely like the way it is shaping up (it does the job without fuss, and NV isn't about performance anyway). However, I think it needs a bit more work so that MDCR_EL2.HPMN is correctly handled. This shouldn't be hard to do, and if FEAT_FGT is supported in the guest, then we could even expose FEAT_HPMN0 (though I haven't worked out yet why FGT is a dependency). With that, I think we could take it in. Thanks, M. -- Without deviation from the norm, progress is not possible.