diff options
author | Quentin Perret <qperret@google.com> | 2021-06-08 11:45:16 +0000 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2021-06-11 13:24:11 +0100 |
commit | d978b9cfe6fe8008467f8c5d51677f52e7815b39 (patch) | |
tree | 5ef2b50354961ec30dcd9d8c72be350d760550ac /arch/arm64/kvm/hyp/nvhe/page_alloc.c | |
parent | 7c350ea39e53ade33ca7be00b0947f2b9f53dda0 (diff) | |
download | linux-stable-d978b9cfe6fe8008467f8c5d51677f52e7815b39.tar.gz linux-stable-d978b9cfe6fe8008467f8c5d51677f52e7815b39.tar.bz2 linux-stable-d978b9cfe6fe8008467f8c5d51677f52e7815b39.zip |
KVM: arm64: Remove hyp_pool pointer from struct hyp_page
Each struct hyp_page currently contains a pointer to a hyp_pool struct
where the page should be freed if its refcount reaches 0. However, this
information can always be inferred from the context in the EL2 code, so
drop the pointer to save a few bytes in the vmemmap.
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210608114518.748712-6-qperret@google.com
Diffstat (limited to 'arch/arm64/kvm/hyp/nvhe/page_alloc.c')
-rw-r--r-- | arch/arm64/kvm/hyp/nvhe/page_alloc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/page_alloc.c b/arch/arm64/kvm/hyp/nvhe/page_alloc.c index 34f0eb026dd2..e3689def7033 100644 --- a/arch/arm64/kvm/hyp/nvhe/page_alloc.c +++ b/arch/arm64/kvm/hyp/nvhe/page_alloc.c @@ -174,20 +174,18 @@ static void __hyp_put_page(struct hyp_pool *pool, struct hyp_page *p) * section to guarantee transient states (e.g. a page with null refcount but * not yet attached to a free list) can't be observed by well-behaved readers. */ -void hyp_put_page(void *addr) +void hyp_put_page(struct hyp_pool *pool, void *addr) { struct hyp_page *p = hyp_virt_to_page(addr); - struct hyp_pool *pool = hyp_page_to_pool(p); hyp_spin_lock(&pool->lock); __hyp_put_page(pool, p); hyp_spin_unlock(&pool->lock); } -void hyp_get_page(void *addr) +void hyp_get_page(struct hyp_pool *pool, void *addr) { struct hyp_page *p = hyp_virt_to_page(addr); - struct hyp_pool *pool = hyp_page_to_pool(p); hyp_spin_lock(&pool->lock); hyp_page_ref_inc(p); @@ -236,7 +234,6 @@ int hyp_pool_init(struct hyp_pool *pool, u64 pfn, unsigned int nr_pages, /* Init the vmemmap portion */ p = hyp_phys_to_page(phys); for (i = 0; i < nr_pages; i++) { - p[i].pool = pool; p[i].order = 0; hyp_set_page_refcounted(&p[i]); } |