From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: kvmarm@lists.linux.dev, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Subject: Re: [PATCH v2 09/12] KVM: arm64: nv: Advertise support for FEAT_HPMN0
Date: Tue, 27 Aug 2024 17:40:33 +0100 [thread overview]
Message-ID: <86jzg1x6ke.wl-maz@kernel.org> (raw)
In-Reply-To: <20240827002235.1753237-10-oliver.upton@linux.dev>
On Tue, 27 Aug 2024 01:22:32 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
>
> Everything is in place now for KVM to actually handle MDCR_EL2.HPMN. Not
> only that, the emulation is capable of doing FEAT_HPMN0. Advertise
> support for the feature in the VM's ID registers.
>
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> arch/arm64/kvm/nested.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index de789e0f1ae9..206aff3d88f7 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -910,12 +910,13 @@ static void limit_nv_id_regs(struct kvm *kvm)
> ID_AA64MMFR4_EL1_E2H0_NI_NV1);
> kvm_set_vm_id_reg(kvm, SYS_ID_AA64MMFR4_EL1, val);
>
> - /* Only limited support for PMU, Debug, BPs and WPs */
> + /* Only limited support for PMU, Debug, BPs, WPs, and HPMN0 */
> val = kvm_read_vm_id_reg(kvm, SYS_ID_AA64DFR0_EL1);
> val &= (NV_FTR(DFR0, PMUVer) |
> NV_FTR(DFR0, WRPs) |
> NV_FTR(DFR0, BRPs) |
> - NV_FTR(DFR0, DebugVer));
> + NV_FTR(DFR0, DebugVer) |
> + NV_FTR(DFR0, HPMN0));
I don't think it does what you say it does! ;-)
What you probably want is something like
val |= FIELD_PREP(NV_FTR(DFR0, HPMN0),
ID_AA64DFR0_EL1_HPMN0_DEF);
instead.
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-08-27 16:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 0:22 [PATCH v2 00/12] KVM: arm64: nv: More complete support for FEAT_PMUv3 Oliver Upton
2024-08-27 0:22 ` [PATCH v2 01/12] KVM: arm64: Rename kvm_pmu_valid_counter_mask() Oliver Upton
2024-08-27 0:22 ` [PATCH v2 02/12] KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN Oliver Upton
2024-08-27 0:22 ` [PATCH v2 03/12] KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY Oliver Upton
2024-08-27 0:22 ` [PATCH v2 04/12] KVM: arm64: nv: Add support for describing traps that affect Host EL0 Oliver Upton
2024-08-27 16:24 ` Marc Zyngier
2024-08-27 0:22 ` [PATCH v2 05/12] KVM: arm64: nv: Reinject traps that take effect in " Oliver Upton
2024-08-27 0:22 ` [PATCH v2 06/12] KVM: arm64: nv: Honor MDCR_EL2.{TPM, TPMCR} " Oliver Upton
2024-08-27 0:22 ` [PATCH v2 07/12] KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps Oliver Upton
2024-08-27 0:22 ` [PATCH v2 08/12] KVM: arm64: nv: Describe trap behaviour of MDCR_EL2.HPMN Oliver Upton
2024-08-27 0:22 ` [PATCH v2 09/12] KVM: arm64: nv: Advertise support for FEAT_HPMN0 Oliver Upton
2024-08-27 16:40 ` Marc Zyngier [this message]
2024-08-27 0:22 ` [PATCH v2 10/12] KVM: arm64: Add helpers to determine if PMC counts at a given EL Oliver Upton
2024-08-27 0:22 ` [PATCH v2 11/12] KVM: arm64: nv: Honor NSH filter when in hyp context Oliver Upton
2024-08-27 0:22 ` [PATCH v2 12/12] KVM: arm64: nv: Reprogram PMU events affected by nested transition Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86jzg1x6ke.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=gankulkarni@os.amperecomputing.com \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.