Path: blob/master/arch/arm64/kvm/hyp/include/nvhe/gfp.h
26532 views
/* SPDX-License-Identifier: GPL-2.0-only */1#ifndef __KVM_HYP_GFP_H2#define __KVM_HYP_GFP_H34#include <linux/list.h>56#include <nvhe/memory.h>7#include <nvhe/spinlock.h>89#define HYP_NO_ORDER ((u8)(~0))1011struct hyp_pool {12/*13* Spinlock protecting concurrent changes to the memory pool as well as14* the struct hyp_page of the pool's pages until we have a proper atomic15* API at EL2.16*/17hyp_spinlock_t lock;18struct list_head free_area[NR_PAGE_ORDERS];19phys_addr_t range_start;20phys_addr_t range_end;21u8 max_order;22};2324/* Allocation */25void *hyp_alloc_pages(struct hyp_pool *pool, u8 order);26void hyp_split_page(struct hyp_page *page);27void hyp_get_page(struct hyp_pool *pool, void *addr);28void hyp_put_page(struct hyp_pool *pool, void *addr);2930/* Used pages cannot be freed */31int hyp_pool_init(struct hyp_pool *pool, u64 pfn, unsigned int nr_pages,32unsigned int reserved_pages);33#endif /* __KVM_HYP_GFP_H */343536