Skip to content

Commit

Permalink
KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
Browse files Browse the repository at this point in the history
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: 4a38162 ("KVM: MMU: load PDPTRs outside mmu_lock")
Signed-off-by: Like Xu <likexu@tencent.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220301124941.48412-1-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Like Xu authored and Paolo Bonzini committed Mar 2, 2022
1 parent 9ee8363 commit c6c937d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/mmu/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3565,7 +3565,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)
Expand Down

0 comments on commit c6c937d

Please sign in to comment.