ANDROID: KVM: arm64: Fix accounting of pinned THPs with pKVM
When faulting in a THP, we proactively account the entire huge page
against RLIMIT_MEMLOCK before trying to map it. However, if we happen to
find an already mapped page in the THP range after that, we retry to
fault at page granularity instead and fixup the accounting
accordingly.
Unfortunately the fixing of the accounting is done incorrectly -- we
only substract PAGE_SIZE instead of the full HP size. Fix that.
Bug: 278749606
Bug: 278011447
Change-Id: I20498c42fcba6efa2c80cb63057bbada6ad8fa87
Signed-off-by:
Quentin Perret <qperret@google.com>
Loading
Please sign in to comment