Commit b33149ee authored by Will Deacon's avatar Will Deacon Committed by Treehugger Robot
Browse files

ANDROID: KVM: arm64: Fix accounting when VM creation fails



When VM creation fails part-way through __pkvm_create_hyp_vm(), we end
up destroying the partial state by calling pkvm_destroy_hyp_vm()
before the memory accounting metadata has been updated. Consequently,
we underflow the 'protected_hyp_mem' counter and run into the following
warning:

 18446744073709518848B of donations to the nVHE hyp are missing

Rework the accounting updates so that the per-VM structures are
accounted immediately after initialising the VM, with the vCPU memory
being accounted one-by-one as they are initialised.

Bug: 373813803
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: If4ae9816df009ca2a74aff5964676465c25fe6dc
parent 21592c88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment