Skip to content

Commit

Permalink
KVM: arm64: Report corrupted refcount at EL2
Browse files Browse the repository at this point in the history
Some of the refcount manipulation helpers used at EL2 are instrumented
to catch a corrupted state, but not all of them are treated equally. Let's
make things more consistent by instrumenting hyp_page_ref_dec_and_test()
as well.

Acked-by: Will Deacon <will@kernel.org>
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005090155.734578-6-qperret@google.com
  • Loading branch information
Quentin Perret authored and Marc Zyngier committed Oct 5, 2021
1 parent 1d58a17 commit 7615c2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm64/kvm/hyp/nvhe/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static inline void hyp_page_ref_inc(struct hyp_page *p)

static inline int hyp_page_ref_dec_and_test(struct hyp_page *p)
{
BUG_ON(!p->refcount);
p->refcount--;
return (p->refcount == 0);
}
Expand Down

0 comments on commit 7615c2a

Please sign in to comment.