Skip to content

Commit 7615c2a

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: Report corrupted refcount at EL2
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 <[email protected]> Suggested-by: Will Deacon <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1d58a17 commit 7615c2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/kvm/hyp/nvhe/page_alloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static inline void hyp_page_ref_inc(struct hyp_page *p)
152152

153153
static inline int hyp_page_ref_dec_and_test(struct hyp_page *p)
154154
{
155+
BUG_ON(!p->refcount);
155156
p->refcount--;
156157
return (p->refcount == 0);
157158
}

0 commit comments

Comments
 (0)