mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
UPSTREAM: 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 <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
(cherry picked from commit 7615c2a514)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 198418208
Change-Id: I68831927545cd1050900096be319f5b0dcb96576
This commit is contained in:
committed by
Will Deacon
parent
9b049759c8
commit
ea1c63bab1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user