* [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
@ 2022-03-01 12:49 Like Xu
2022-03-01 15:47 ` Sean Christopherson
2022-03-01 20:16 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Like Xu @ 2022-03-01 12:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Sean Christopherson, kvm, Wanpeng Li, Jim Mattson,
Vitaly Kuznetsov, Joerg Roedel, linux-kernel
From: Like Xu <likexu@tencent.com>
Just like on the optional mmu_alloc_direct_roots() path, once shadow
path reaches "r = -EIO" somewhere, the caller needs to know the actual
state in order to enter error handling and avoid something worse.
Fixes: 4a38162ee9f1 ("KVM: MMU: load PDPTRs outside mmu_lock")
Signed-off-by: Like Xu <likexu@tencent.com>
---
arch/x86/kvm/mmu/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index b2c1c4eb6007..304bfdc50fea 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -3533,7 +3533,7 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu)
out_unlock:
write_unlock(&vcpu->kvm->mmu_lock);
- return 0;
+ return r;
}
static int mmu_alloc_special_roots(struct kvm_vcpu *vcpu)
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
2022-03-01 12:49 [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() Like Xu
@ 2022-03-01 15:47 ` Sean Christopherson
2022-03-01 20:16 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2022-03-01 15:47 UTC (permalink / raw)
To: Like Xu
Cc: Paolo Bonzini, kvm, Wanpeng Li, Jim Mattson, Vitaly Kuznetsov,
Joerg Roedel, linux-kernel
On Tue, Mar 01, 2022, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> Just like on the optional mmu_alloc_direct_roots() path, once shadow
> path reaches "r = -EIO" somewhere, the caller needs to know the actual
> state in order to enter error handling and avoid something worse.
Well that's emabarrassing.
> Fixes: 4a38162ee9f1 ("KVM: MMU: load PDPTRs outside mmu_lock")
Cc: stable@vger.kernel.org
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
2022-03-01 12:49 [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() Like Xu
2022-03-01 15:47 ` Sean Christopherson
@ 2022-03-01 20:16 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-03-01 20:16 UTC (permalink / raw)
To: Like Xu
Cc: Sean Christopherson, kvm, Wanpeng Li, Jim Mattson,
Vitaly Kuznetsov, Joerg Roedel, linux-kernel
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-01 20:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 12:49 [PATCH] KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() Like Xu
2022-03-01 15:47 ` Sean Christopherson
2022-03-01 20:16 ` Paolo Bonzini
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.