From: sashiko-bot@kernel.org
To: "Oliver Upton" <oupton@kernel.org>, kvmarm@lists.linux.dev
Cc: "Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v2 6/8] KVM: arm64: Add sys_reg_descs for remaining MTE CMO instructions
Date: Fri, 06 Nov 2026 18:45:39 +0000 [thread overview]
Message-ID: <sashiko-outbox-202094@kernel.org> (raw)
In-Reply-To: <20261106183154.3590825-7-oupton@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: arm64: possible missing MTE_CMO_INSN entries for DC GVA and
DC GZVA
--
commit c80fdbddf913183cac8f63dfc60ce6f48445eafa
Author: Oliver Upton <oupton@kernel.org>
KVM: arm64: Add sys_reg_descs for remaining MTE CMO instructions
This commit adds MTE_CMO_INSN descriptors with mte_visibility to
sys_insn_descs[] for MTE cache maintenance instructions trapped by
HCR_EL2.TPCP so that they inject an UNDEFINED exception when MTE is not
enabled for the VM.
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index b456354713443..7f7a197a9ad6b 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
[ ... ]
> @@ -4394,6 +4403,15 @@ static struct sys_reg_desc sys_insn_descs[] = {
> SYS_INSN(TLBI_VALE1NXS, handle_tlbi_el1),
> SYS_INSN(TLBI_VAALE1NXS, handle_tlbi_el1),
>
> + MTE_CMO_INSN(DC_CGVAC, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CGDVAC, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CGVAP, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CGDVAP, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CGVADP, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CGDVADP, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CIGVAC, bad_cmo_trap),
> + MTE_CMO_INSN(DC_CIGDVAC, bad_cmo_trap),
[Severity: Low]
This question rests on an architecture detail that could not be confirmed
from the kernel source: can SYS_DC_GVA and SYS_DC_GZVA trap to EL2 via
HCR_EL2.TDZ or HFGITR_EL2.DCZVA when MTE is not enabled for the VM?
If so, encoding_to_cgt[] maps both instructions to CGT_HCR_TDZ and
encoding_to_fgt[] maps them to HFGITR_EL2.DCZVA, which is marked NEVER_FGU
in config.c because the trap bit is shared with SYS_DC_ZVA. Without
MTE_CMO_INSN entries for SYS_DC_GVA and SYS_DC_GZVA in sys_insn_descs[],
triage_sysreg_trap() has neither an FGU bit nor a visibility() callback to
filter them, and will forward traps from a nested guest to L1 when L1 sets
HCR_EL2.TDZ or HFGITR_EL2.DCZVA instead of injecting an UNDEFINED
exception.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106183154.3590825-1-oupton@kernel.org?part=6
next prev parent reply other threads:[~2026-11-06 18:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 18:31 [PATCH v2 0/8] KVM: arm64: Prefix of fixes from HAFDBS series (for 7.4) Oliver Upton
2026-11-06 18:31 ` [PATCH v2 1/8] KVM: arm64: nv: Disallow KVM_CAP_ARM_MTE + FEAT_EL2 Oliver Upton
2026-11-08 5:30 ` Wei-Lin Chang
2026-11-06 18:31 ` [PATCH v2 2/8] KVM: arm64: nv: Add CGT description for FEAT_PoPS instructions Oliver Upton
2026-11-06 18:31 ` [PATCH v2 3/8] KVM: arm64: Separate user / guest visibility flags Oliver Upton
2026-11-06 18:31 ` [PATCH v2 4/8] KVM: arm64: nv: Treat the VNCR GICv3 registers as hidden from user Oliver Upton
2026-11-06 18:31 ` [PATCH v2 5/8] KVM: arm64: Use ->visibility() to filter MTE CMO instructions Oliver Upton
2026-11-06 18:31 ` [PATCH v2 6/8] KVM: arm64: Add sys_reg_descs for remaining " Oliver Upton
2026-11-06 18:45 ` sashiko-bot [this message]
2026-11-06 21:30 ` Oliver Upton
2026-11-06 18:31 ` [PATCH v2 7/8] KVM: arm64: nv: Enforce sysreg visibility before evaulating guest traps Oliver Upton
2026-11-06 18:31 ` [PATCH v2 8/8] KVM: arm64: Stop leaning on __kvm_inject_sea() for abort injection Oliver Upton
2026-11-06 18:47 ` sashiko-bot
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=sashiko-outbox-202094@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.