7 #include <asm/kvm_hyp.h>
39 addr ^= (PAGE_SIZE <<
order);
45 if (addr < pool->range_start || addr >= pool->
range_end)
76 __list_del_entry(node);
77 memset(node, 0,
sizeof(*node));
85 list_add_tail(node, head);
103 if (phys < pool->range_start || phys >= pool->
range_end)
132 unsigned short order)
190 for (i = 1; i < (1 <<
order); i++) {
200 unsigned short i =
order;
206 while (i <= pool->max_order && list_empty(&pool->
free_area[i]))
224 unsigned int reserved_pages)
232 get_order(nr_pages << PAGE_SHIFT));
236 pool->
range_end = phys + (nr_pages << PAGE_SHIFT);
240 for (i = 0; i < nr_pages; i++)
244 for (i = reserved_pages; i < nr_pages; i++)
static int hyp_page_ref_dec_and_test(struct hyp_page *p)
#define hyp_virt_to_page(virt)
#define hyp_phys_to_page(phys)
static void hyp_page_ref_inc(struct hyp_page *p)
#define hyp_page_to_phys(page)
#define hyp_page_to_virt(page)
#define hyp_pfn_to_phys(pfn)
static void hyp_set_page_refcounted(struct hyp_page *p)
static void page_add_to_list(struct hyp_page *p, struct list_head *head)
int hyp_pool_init(struct hyp_pool *pool, u64 pfn, unsigned int nr_pages, unsigned int reserved_pages)
void hyp_get_page(struct hyp_pool *pool, void *addr)
static void __hyp_put_page(struct hyp_pool *pool, struct hyp_page *p)
void * hyp_alloc_pages(struct hyp_pool *pool, unsigned short order)
static struct hyp_page * __hyp_extract_page(struct hyp_pool *pool, struct hyp_page *p, unsigned short order)
static struct hyp_page * node_to_page(struct list_head *node)
static void page_remove_from_list(struct hyp_page *p)
void hyp_split_page(struct hyp_page *p)
void hyp_put_page(struct hyp_pool *pool, void *addr)
static struct hyp_page * __find_buddy_avail(struct hyp_pool *pool, struct hyp_page *p, unsigned short order)
static struct hyp_page * __find_buddy_nocheck(struct hyp_pool *pool, struct hyp_page *p, unsigned short order)
static void __hyp_attach_page(struct hyp_pool *pool, struct hyp_page *p)
static void hyp_spin_unlock(hyp_spinlock_t *lock)
#define hyp_spin_lock_init(l)
static void hyp_spin_lock(hyp_spinlock_t *lock)
struct list_head free_area[NR_PAGE_ORDERS]