Commit dfa29d07 authored by Quentin Perret's avatar Quentin Perret Committed by Vincent Donnefort
Browse files

ANDROID: KVM: arm64: Fix hyp_pool::free_pages



We currently update the hyp_pool's free_pages member after having
attached the page on the put_page() path. However, whenever a page gets
coallesced as a tail page with its buddy, its order is set to
HYP_NO_ORDER  -- only the head page has the order member set to the true
value -- hence leading to a buggy accounting of the free pages.

Do the free_page calculation prior to attaching the page to fix this.
While at it, make sure to use ULL consistently when working with
free_pages as it is defined as a u64.

Bug: 357781595
Change-Id: Id29dbfe3b7132b1259b1a7d1e115fb6e1cb4af12
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
(cherry picked from commit b548789a)
parent 9381f5d6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment