summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hyp/include
diff options
context:
space:
mode:
authorQuentin Perret <qperret@google.com>2021-06-08 14:45:18 +0300
committerMarc Zyngier <maz@kernel.org>2021-06-11 15:24:12 +0300
commit6929586d8eddad184f43526efe7bf0a8be4f18b2 (patch)
tree285136df8a757c3ade2eaa347c1386c0a5fa9009 /arch/arm64/kvm/hyp/include
parent87ec0606733e1aa9568f54ddb41f03aa6b5687f2 (diff)
downloadlinux-6929586d8eddad184f43526efe7bf0a8be4f18b2.tar.xz
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
Diffstat (limited to 'arch/arm64/kvm/hyp/include')
-rw-r--r--arch/arm64/kvm/hyp/include/nvhe/memory.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hyp/include/nvhe/memory.h b/arch/arm64/kvm/hyp/include/nvhe/memory.h
index 3fe34fa30ea4..592b7edb3edb 100644
--- a/arch/arm64/kvm/hyp/include/nvhe/memory.h
+++ b/arch/arm64/kvm/hyp/include/nvhe/memory.h
@@ -8,7 +8,7 @@
#include <linux/types.h>
struct hyp_page {
- unsigned int refcount;
+ unsigned short refcount;
unsigned short order;
};