Lines Matching +full:adp +full:- +full:disable

1 // SPDX-License-Identifier: GPL-2.0-only
32 * Hypervisor reports ADI capabilities of platform in "hwcap-list" property
33 * for "cpu" node. If the platform supports ADI, "hwcap-list" property
34 * contains the keyword "adp". If the platform supports ADI, "platform"
35 * node will contain "adp-blksz", "adp-nbits" and "ue-on-adp" properties
52 prop = mdesc_get_property(hp, pn, "hwcap-list", &len); in mdesc_adi_init()
57 * Look for "adp" keyword in hwcap-list which would indicate in mdesc_adi_init()
64 if (!strcmp(prop, "adp")) { in mdesc_adi_init()
71 len -= plen; in mdesc_adi_init()
85 val = (u64 *) mdesc_get_property(hp, pn, "adp-blksz", &len); in mdesc_adi_init()
90 val = (u64 *) mdesc_get_property(hp, pn, "adp-nbits", &len); in mdesc_adi_init()
95 val = (u64 *) mdesc_get_property(hp, pn, "ue-on-adp", &len); in mdesc_adi_init()
104 * disable ADI support so we do not get unpredictable results in mdesc_adi_init()
135 if (mm->context.tag_store) { in find_tag_store()
136 tag_desc = mm->context.tag_store; in find_tag_store()
137 spin_lock_irqsave(&mm->context.tag_lock, flags); in find_tag_store()
139 if ((addr >= tag_desc->start) && in find_tag_store()
140 ((addr + PAGE_SIZE - 1) <= tag_desc->end)) in find_tag_store()
144 spin_unlock_irqrestore(&mm->context.tag_lock, flags); in find_tag_store()
169 end_addr = addr + PAGE_SIZE - 1; in alloc_tag_store()
174 spin_lock_irqsave(&mm->context.tag_lock, flags); in alloc_tag_store()
175 if (mm->context.tag_store) { in alloc_tag_store()
176 tag_desc = mm->context.tag_store; in alloc_tag_store()
184 if (tag_desc->tag_users == 0) { in alloc_tag_store()
188 if ((addr >= tag_desc->start) && in alloc_tag_store()
189 (tag_desc->end >= (addr + PAGE_SIZE - 1))) { in alloc_tag_store()
190 tag_desc->tag_users++; in alloc_tag_store()
194 if ((tag_desc->start > end_addr) && in alloc_tag_store()
195 (tag_desc->start < hole_end)) in alloc_tag_store()
196 hole_end = tag_desc->start; in alloc_tag_store()
197 if ((tag_desc->end < addr) && in alloc_tag_store()
198 (tag_desc->end > hole_start)) in alloc_tag_store()
199 hole_start = tag_desc->end; in alloc_tag_store()
205 mm->context.tag_store = kzalloc(size, GFP_NOWAIT|__GFP_NOWARN); in alloc_tag_store()
206 if (mm->context.tag_store == NULL) { in alloc_tag_store()
210 tag_desc = mm->context.tag_store; in alloc_tag_store()
212 tag_desc->tag_users = 0; in alloc_tag_store()
213 open_desc = mm->context.tag_store; in alloc_tag_store()
225 tag_desc->tag_users = 1; in alloc_tag_store()
239 end_addr = addr + (size*2*adi_blksize()) - 1; in alloc_tag_store()
243 end_addr = addr + (size*2*adi_blksize()) - 1; in alloc_tag_store()
258 end_addr = hole_end - 1; in alloc_tag_store()
259 tmp_addr = end_addr - (size*2*adi_blksize()) + 1; in alloc_tag_store()
265 tmp_addr = end_addr - (size*2*adi_blksize()) - 1; in alloc_tag_store()
280 size = (end_addr + 1 - addr)/(2*adi_blksize()); in alloc_tag_store()
281 size = (size + (PAGE_SIZE-adi_blksize()))/PAGE_SIZE; in alloc_tag_store()
286 tag_desc->tag_users = 0; in alloc_tag_store()
290 tag_desc->start = addr; in alloc_tag_store()
291 tag_desc->tags = tags; in alloc_tag_store()
292 tag_desc->end = end_addr; in alloc_tag_store()
295 spin_unlock_irqrestore(&mm->context.tag_lock, flags); in alloc_tag_store()
304 spin_lock_irqsave(&mm->context.tag_lock, flags); in del_tag_store()
305 tag_desc->tag_users--; in del_tag_store()
306 if (tag_desc->tag_users == 0) { in del_tag_store()
307 tag_desc->start = tag_desc->end = 0; in del_tag_store()
312 if (tag_desc != mm->context.tag_store) { in del_tag_store()
313 tags = tag_desc->tags; in del_tag_store()
314 tag_desc->tags = NULL; in del_tag_store()
317 spin_unlock_irqrestore(&mm->context.tag_lock, flags); in del_tag_store()
322 ((tag_desc)->tags + ((addr - (tag_desc)->start)/(2*adi_blksize())))
379 return -1; in adi_save_tags()