All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonardo Bras <leo.bras@arm.com>
To: Oliver Upton <oupton@kernel.org>
Cc: Leonardo Bras <leo.bras@arm.com>,
	kvmarm@lists.linux.dev, Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Wei-Lin Chang <weilin.chang@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Fuad Tabba <fuad.tabba@linux.dev>
Subject: Re: [PATCH 6/8] KVM: arm64: Add sys_reg_descs for remaining MTE CMO instructions
Date: Mon,  9 Nov 2026 17:55:03 +0000	[thread overview]
Message-ID: <avII94Pr7Cm0UPvF@LeoBrasDK> (raw)
In-Reply-To: <avIHZW07QmWnl4m9@kernel.org>

On Mon, Nov 09, 2026 at 09:48:21AM -0800, Oliver Upton wrote:
> On Mon, Nov 09, 2026 at 05:28:20PM +0000, Leonardo Bras wrote:
> > On Wed, Nov 04, 2026 at 11:21:22AM -0800, Oliver Upton wrote:
> > > Filtering unsupported cache maintenance instructions from a guest relies
> > > on either having a suitable FGU bit for the feature or a descriptor with
> > > a visibility() hook.
> > > 
> > > MTE CMO instructions can be trapped by HCR_EL2.TPCP and lack a suitable
> > > FGU. Add descriptors for the CMO instructions that UNDEF if MTE isn't
> > > implemented for the VM.
> > > 
> > 
> > I think I get the idea of using MTE_CMO_INSN(): having the visibility test 
> > for MTE defined in the previous patch, which makes sense with the above 
> > commit message: if !mte -> hidden, then on access it injects undefined.
> > 
> > Please help me understand the other way: if we have mte, then it calls the 
> > 'access' callback, which is bad_cmo_trap(), which also inject undefined. 
> > What is the goal here?
> 
> This is consistent with how we handle other unexpected traps, such as
> registers that redirect into the VNCR. If we take a trap for one of
> these instructions then either we UNDEF it early in triage or redirect
> the trap to the L1 hypervisor.
> 
> Under no circumstance do we expect to handle the trap locally, i.e.
> reach the ->access() function.
> 
> Thanks,
> Oliver
>  

Ah, I see your point there :)

FWIW:
Reviewed-by: Leonardo Bras <leo.bras@arm.com>

Thanks!
Leo

  reply	other threads:[~2026-11-09 17:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 19:21 [PATCH 0/8] KVM: arm64: Prefix of fixes from HAFDBS series (for 7.4) Oliver Upton
2026-11-04 19:21 ` [PATCH 1/8] KVM: arm64: nv: Disallow KVM_CAP_ARM_MTE + FEAT_EL2 Oliver Upton
2026-11-04 19:37   ` sashiko-bot
2026-11-04 20:17     ` Oliver Upton
2026-11-04 19:21 ` [PATCH 2/8] KVM: arm64: nv: Add CGT description for FEAT_PoPS instructions Oliver Upton
2026-11-05 18:12   ` Leonardo Bras
2026-11-04 19:21 ` [PATCH 3/8] KVM: arm64: Separate user / guest visibility flags Oliver Upton
2026-11-09 16:36   ` Leonardo Bras
2026-11-04 19:21 ` [PATCH 4/8] KVM: arm64: nv: Treat the VNCR GICv3 registers as hidden from user Oliver Upton
2026-11-09 16:49   ` Leonardo Bras
2026-11-04 19:21 ` [PATCH 5/8] KVM: arm64: Use ->visibility() to filter MTE CMO instructions Oliver Upton
2026-11-09 17:03   ` Leonardo Bras
2026-11-04 19:21 ` [PATCH 6/8] KVM: arm64: Add sys_reg_descs for remaining " Oliver Upton
2026-11-09 17:28   ` Leonardo Bras
2026-11-09 17:48     ` Oliver Upton
2026-11-09 17:55       ` Leonardo Bras [this message]
2026-11-04 19:21 ` [PATCH 7/8] KVM: arm64: nv: Enforce sysreg visibility before evaulating guest traps Oliver Upton
2026-11-11 12:16   ` Leonardo Bras
2026-11-04 19:21 ` [PATCH 8/8] KVM: arm64: Stop leaning on __kvm_inject_sea() for abort injection Oliver Upton
2026-11-12 15:12   ` Leonardo Bras
2026-11-12 22:22     ` 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=avII94Pr7Cm0UPvF@LeoBrasDK \
    --to=leo.bras@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=weilin.chang@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.