Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>
Cc: kvmarm@lists.linux.dev, Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>
Subject: Re: [PATCH 1/4] KVM: arm64: nv: Respect exception routing rules for SEAs
Date: Sat, 31 May 2025 10:51:08 -0700	[thread overview]
Message-ID: <aDtBjCyHdGPW6nJv@linux.dev> (raw)
In-Reply-To: <87r004eokv.wl-maz@kernel.org>

Hey,

On Sat, May 31, 2025 at 05:23:44PM +0100, Marc Zyngier wrote:
> > +int kvm_inject_nested_sea(struct kvm_vcpu *vcpu, bool iabt, u64 addr)
> > +{
> > +	u64 esr;
> > +
> > +	/*
> > +	 * The destination EL is in the same translation regime as the origin;
> > +	 * directly inject the SEA.
> > +	 */
> > +	if (is_hyp_ctxt(vcpu) || !(__vcpu_sys_reg(vcpu, HCR_EL2) & HCR_TEA)) {
> > +		__kvm_inject_sea(vcpu, iabt, addr);
> > +		return 1;
> > +	}
> 
> I find this a bit confusing.
> 
> Here, we end-up *not* injecting a nested exception, but instead
> delivering it in context. I think it would be clearer to move this
> condition in kvm_inject_sea(), and then make __kvm_inject_sea()
> static.

So I went about it this way because I didn't like having NV-specific
triage outside of the nested code, though I agree the meaning of this
helper is a bit muddied. The routing is simple now but...

> Other than my rambling above, this looks rather good. But there is a
> bit more, "thanks" to FEAT_DoubleFault2:
> 
> - HCRX_EL2.TMEA also affects this patch, both on the SEA and SError
>   paths (both can be routed to EL2 when masked).
> 
> - SCTLR2_EL{1,2}2.EASE also influence the delivery of the SEA,
>   upgrading it to a SError (yes, this is the routing from hell and
>   ties directly into the following patches).

This is gonna be an ugly pile to deal with later on. Anyway, I'll pull
apart the routing / emulated exception entry to keep in-context
injection out of NV coed.

> I was expecting to see FEAT_RAS being enabled at some point, but
> that's not the case yet. Are you planning to do so?

Yup, still planning on it. Just wanted to flush out bug fixes on list.

Thanks,
Oliver

  reply	other threads:[~2025-05-31 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30 23:06 [PATCH 0/4] KVM: arm64: nv: Fixes for external abort exception routing Oliver Upton
2025-05-30 23:06 ` [PATCH 1/4] KVM: arm64: nv: Respect exception routing rules for SEAs Oliver Upton
2025-05-31 16:23   ` Marc Zyngier
2025-05-31 17:51     ` Oliver Upton [this message]
2025-05-30 23:06 ` [PATCH 2/4] KVM: arm64: nv: Ensure Address size faults affect correct ESR Oliver Upton
2025-05-30 23:06 ` [PATCH 3/4] KVM: arm64: nv: Honor SError exception routing / masking Oliver Upton
2025-05-30 23:06 ` [PATCH 4/4] KVM: arm64: Treat vCPU with pending SError as runnable 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=aDtBjCyHdGPW6nJv@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox