All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Wujie Duan <wjduan@linx-info.com>
Cc: oliver.upton@linux.dev, james.morse@arm.com,
	suzuki.poulose@arm.com, yuzenghui@huawei.com,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH] KVM: arm64: Change back kvm fault condition to translation
Date: Mon, 18 Mar 2024 10:17:47 +0000	[thread overview]
Message-ID: <864jd3269g.wl-maz@kernel.org> (raw)
In-Reply-To: <20240318100249.220897-1-wjduan@linx-info.com>

On Mon, 18 Mar 2024 10:02:49 +0000,
Wujie Duan <wjduan@linx-info.com> wrote:
> 
> KVM: arm64: Condition should be esr_fsc_is_translation_fault
> 
> In commit '11e5ea5242e3 ("KVM: arm64: Use helpers to
>         classify exception types reported via ESR")'
> the KVM code was optimized, but the code logic was incorrectly modified.
> Therefore, it is being corrected.
> 
> Signed-off-by: Wujie Duan <wjduan@linx-info.com>
> ---
>  arch/arm64/kvm/mmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 18680771cdb0..dc04bc767865 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -1637,7 +1637,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
>  	fault_ipa = kvm_vcpu_get_fault_ipa(vcpu);
>  	is_iabt = kvm_vcpu_trap_is_iabt(vcpu);
>  
> -	if (esr_fsc_is_permission_fault(esr)) {
> +	if (esr_fsc_is_translation_fault(esr)) {
>  		/* Beyond sanitised PARange (which is the IPA limit) */
>  		if (fault_ipa >= BIT_ULL(get_kvm_ipa_limit())) {
>  			kvm_inject_size_fault(vcpu);

I think 7 tries are enough ;-). Here's what I was expecting:

- a subject indicating the nature of the issue as a one-liner
- a commit message describing the exact situation
- a Fixes: tag indicating the commit being fixed
- a Cc: stable tag to indicate this needs backporting
- Ard's Ack, as he's been kind enough to look into it

See below for the full patch and my own RB tag. In the future, please
try to follow these guidelines.

Oliver, can you please pick this ASAP?

Thanks,

	M.

From 10febd177a551e1f9bfb708a0b3865ca642f9a85 Mon Sep 17 00:00:00 2001
From: Wujie Duan <wjduan@linx-info.com>
Date: Mon, 18 Mar 2024 17:47:35 +0800
Subject: [PATCH] KVM: arm64: Fix out-of-IPA space translation fault handling

Commit 11e5ea5242e3 ("KVM: arm64: Use helpers to classify exception
types reported via ESR") tried to abstract the translation fault
check when handling an out-of IPA space condition, but incorrectly
replaced it with a permission fault check.

Restore the previous translation fault check.

Fixes: 11e5ea5242e3 ("KVM: arm64: Use helpers to classify exception types reported via ESR")
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Wujie Duan <wjduan@linx-info.com>
Cc: stable@vger.kernel.org
---
 arch/arm64/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 2902f3ffca3c..df90ebc039dc 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -1637,7 +1637,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
 	fault_ipa = kvm_vcpu_get_fault_ipa(vcpu);
 	is_iabt = kvm_vcpu_trap_is_iabt(vcpu);
 
-	if (esr_fsc_is_permission_fault(esr)) {
+	if (esr_fsc_is_translation_fault(esr)) {
 		/* Beyond sanitised PARange (which is the IPA limit) */
 		if (fault_ipa >= BIT_ULL(get_kvm_ipa_limit())) {
 			kvm_inject_size_fault(vcpu);
-- 
2.39.2


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

  reply	other threads:[~2024-03-18 10:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 10:02 [PATCH] KVM: arm64: Change back kvm fault condition to translation Wujie Duan
2024-03-18 10:17 ` Marc Zyngier [this message]
2024-03-18 10:31   ` Zenghui Yu
2024-03-18 17:22   ` Oliver Upton
2024-03-18 17:43     ` Marc Zyngier
2024-03-26 13:48 ` (subset) " 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=864jd3269g.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=wjduan@linx-info.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.