]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Use less bits for hyp_page refcount
authorQuentin Perret <qperret@google.com>
Tue, 8 Jun 2021 11:45:18 +0000 (11:45 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 11 Jun 2021 12:24:12 +0000 (13:24 +0100)
commit9059cf3337d2b865cd2aa9547d2bed2c2afd4a8f
tree285136df8a757c3ade2eaa347c1386c0a5fa9009
parentb58bcdcebb541fb282dd773619e04f073008c067
KVM: arm64: Use less bits for hyp_page refcount

The hyp_page refcount is currently encoded on 4 bytes even though we
never need to count that many objects in a page. Make it 2 bytes to save
some space in the vmemmap.

As overflows are more likely to happen as well, make sure to catch those
with a BUG in the increment function.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210608114518.748712-8-qperret@google.com
arch/arm64/kvm/hyp/include/nvhe/memory.h
arch/arm64/kvm/hyp/nvhe/page_alloc.c