All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Change back kvm fault condition to translation
@ 2024-03-18 10:02 Wujie Duan
  2024-03-18 10:17 ` Marc Zyngier
  2024-03-26 13:48 ` (subset) " Oliver Upton
  0 siblings, 2 replies; 6+ messages in thread
From: Wujie Duan @ 2024-03-18 10:02 UTC (permalink / raw)
  To: maz
  Cc: oliver.upton, james.morse, suzuki.poulose, yuzenghui, kvmarm, Wujie Duan

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);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Change back kvm fault condition to translation
  2024-03-18 10:02 [PATCH] KVM: arm64: Change back kvm fault condition to translation Wujie Duan
@ 2024-03-18 10:17 ` Marc Zyngier
  2024-03-18 10:31   ` Zenghui Yu
  2024-03-18 17:22   ` Oliver Upton
  2024-03-26 13:48 ` (subset) " Oliver Upton
  1 sibling, 2 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-03-18 10:17 UTC (permalink / raw)
  To: Wujie Duan; +Cc: oliver.upton, james.morse, suzuki.poulose, yuzenghui, kvmarm

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.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Change back kvm fault condition to translation
  2024-03-18 10:17 ` Marc Zyngier
@ 2024-03-18 10:31   ` Zenghui Yu
  2024-03-18 17:22   ` Oliver Upton
  1 sibling, 0 replies; 6+ messages in thread
From: Zenghui Yu @ 2024-03-18 10:31 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Wujie Duan, oliver.upton, james.morse, suzuki.poulose, kvmarm

On 2024/3/18 18:17, Marc Zyngier wrote:
> 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

Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Change back kvm fault condition to translation
  2024-03-18 10:17 ` Marc Zyngier
  2024-03-18 10:31   ` Zenghui Yu
@ 2024-03-18 17:22   ` Oliver Upton
  2024-03-18 17:43     ` Marc Zyngier
  1 sibling, 1 reply; 6+ messages in thread
From: Oliver Upton @ 2024-03-18 17:22 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Wujie Duan, james.morse, suzuki.poulose, yuzenghui, kvmarm

Hey,

On Mon, Mar 18, 2024 at 10:17:47AM +0000, Marc Zyngier wrote:

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

Hopefully I'm looking at the right thread!

> - 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?

Yup, I'll queue it up but I only plan on sending the first set of fixes
after -rc1 as I'll be AFK for a few days this week. I'll get a respin of
the vPMU + nVHE stuff out too.

-- 
Thanks,
Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Change back kvm fault condition to translation
  2024-03-18 17:22   ` Oliver Upton
@ 2024-03-18 17:43     ` Marc Zyngier
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2024-03-18 17:43 UTC (permalink / raw)
  To: Oliver Upton; +Cc: Wujie Duan, james.morse, suzuki.poulose, yuzenghui, kvmarm

On Mon, 18 Mar 2024 17:22:20 +0000,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> Hey,
> 
> On Mon, Mar 18, 2024 at 10:17:47AM +0000, Marc Zyngier wrote:
> 
> > I think 7 tries are enough ;-). Here's what I was expecting:
> 
> Hopefully I'm looking at the right thread!

You are!

> 
> > - 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?
> 
> Yup, I'll queue it up but I only plan on sending the first set of fixes
> after -rc1 as I'll be AFK for a few days this week. I'll get a respin of
> the vPMU + nVHE stuff out too.

Sounds good. This is only a corner case anyway, which is why it didn't
show up in my testing, and -rc1 is the right spot for it.

Thanks,

	M.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (subset) [PATCH] KVM: arm64: Change back kvm fault condition to translation
  2024-03-18 10:02 [PATCH] KVM: arm64: Change back kvm fault condition to translation Wujie Duan
  2024-03-18 10:17 ` Marc Zyngier
@ 2024-03-26 13:48 ` Oliver Upton
  1 sibling, 0 replies; 6+ messages in thread
From: Oliver Upton @ 2024-03-26 13:48 UTC (permalink / raw)
  To: maz, Wujie Duan
  Cc: Oliver Upton, james.morse, suzuki.poulose, yuzenghui, kvmarm


On Mon, 18 Mar 2024 18:02:49 +0800, Wujie Duan 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.
> 
> [...]

Applied to kvmarm/fixes, thanks!

[1/1] KVM: arm64: Change back kvm fault condition to translation
	f5fe0adeed6019df495497a64cb57d563ead2296

-- 
Best,
Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-26 13:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 10:02 [PATCH] KVM: arm64: Change back kvm fault condition to translation Wujie Duan
2024-03-18 10:17 ` Marc Zyngier
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

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.