linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Jiaqi Yan <jiaqiyan@google.com>
Cc: oliver.upton@linux.dev, joey.gouly@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com,
	catalin.marinas@arm.com, will@kernel.org, pbonzini@redhat.com,
	corbet@lwn.net, shuah@kernel.org, kvm@vger.kernel.org,
	kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org, duenwen@google.com,
	rananta@google.com, jthoughton@google.com
Subject: Re: [PATCH v1 2/6] KVM: arm64: Set FnV for VCPU when FAR_EL2 is invalid
Date: Fri, 16 May 2025 16:33:10 +0100	[thread overview]
Message-ID: <86zffcefk9.wl-maz@kernel.org> (raw)
In-Reply-To: <20250505161412.1926643-3-jiaqiyan@google.com>

On Mon, 05 May 2025 17:14:08 +0100,
Jiaqi Yan <jiaqiyan@google.com> wrote:
> 
> Certain microarchitectures (e.g. Neoverse V2) do not keep track of
> the faulting address for a memory load that consumes poisoned data
> and results in a synchronous external abort (SEA). This means the
> faulting guest physical address is unavailable when KVM handles such
> SEA in EL2, and FAR_EL2 just holds a garbage value.

I don't understand. FAR_ELx holds a *virtual* address, and never a
physical address (that'd be PFAR_ELx).

> 
> In case VMM later asks KVM to synchronously inject a SEA into the
> guest, KVM should set FnV bit
> - in VCPU's ESR_EL1 to let guest kernel know that FAR_EL1 is invalid
>   and holds garbage value
> - in VCPU's ESR_EL2 to let nested virtualization know that FAR_EL2
>   is invalid and holds garbage value
>
> Signed-off-by: Jiaqi Yan <jiaqiyan@google.com>
> ---
>  arch/arm64/kvm/inject_fault.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/kvm/inject_fault.c b/arch/arm64/kvm/inject_fault.c
> index a640e839848e6..b4f9a09952ead 100644
> --- a/arch/arm64/kvm/inject_fault.c
> +++ b/arch/arm64/kvm/inject_fault.c
> @@ -81,6 +81,9 @@ static void inject_abt64(struct kvm_vcpu *vcpu, bool is_iabt, unsigned long addr
>  	if (!is_iabt)
>  		esr |= ESR_ELx_EC_DABT_LOW << ESR_ELx_EC_SHIFT;
>  
> +	if (!kvm_vcpu_sea_far_valid(vcpu))
> +		esr |= ESR_ELx_FnV;
> +

I don't understand what this has anything to do with the uarch details
you talk about in the commit message. If the VMM inject an exception,
surely it has populated the exception context itself. I don't even see
how we'd end-up here (__kvm_arm_vcpu_set_events? seems unlikely).

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2025-05-16 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05 16:14 [PATCH v1 0/6] VMM can handle guest SEA via KVM_EXIT_ARM_SEA Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 1/6] KVM: arm64: VM exit to userspace to handle SEA Jiaqi Yan
2025-05-16 15:20   ` Marc Zyngier
2025-05-30 17:29     ` Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 2/6] KVM: arm64: Set FnV for VCPU when FAR_EL2 is invalid Jiaqi Yan
2025-05-16 15:33   ` Marc Zyngier [this message]
2025-05-20 23:39     ` Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 3/6] KVM: arm64: Allow userspace to inject external instruction aborts Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 4/6] KVM: selftests: Test for KVM_EXIT_ARM_SEA and KVM_CAP_ARM_SEA_TO_USER Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 5/6] KVM: selftests: Test for KVM_CAP_INJECT_EXT_IABT Jiaqi Yan
2025-05-05 16:14 ` [PATCH v1 6/6] Documentation: kvm: new uAPI for handling SEA Jiaqi Yan
2025-05-07 19:24   ` ALOK TIWARI
2025-05-14 21:29     ` Jiaqi Yan

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=86zffcefk9.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=duenwen@google.com \
    --cc=jiaqiyan@google.com \
    --cc=joey.gouly@arm.com \
    --cc=jthoughton@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=rananta@google.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).