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:
Quentin Perret <qperret@google.com>
Loading