Lines Matching +full:charge +full:- +full:vol
4 * Permission is hereby granted, free of charge, to any person obtaining a
37 struct device *dev = vmm->mmu->subdev.device->dev; in gp100_vmm_pfn_unmap()
40 nvkm_kmap(pt->memory); in gp100_vmm_pfn_unmap()
41 while (ptes--) { in gp100_vmm_pfn_unmap()
42 u32 datalo = nvkm_ro32(pt->memory, pt->base + ptei * 8 + 0); in gp100_vmm_pfn_unmap()
43 u32 datahi = nvkm_ro32(pt->memory, pt->base + ptei * 8 + 4); in gp100_vmm_pfn_unmap()
51 nvkm_done(pt->memory); in gp100_vmm_pfn_unmap()
59 nvkm_kmap(pt->memory); in gp100_vmm_pfn_clear()
60 while (ptes--) { in gp100_vmm_pfn_clear()
61 u32 datalo = nvkm_ro32(pt->memory, pt->base + ptei * 8 + 0); in gp100_vmm_pfn_clear()
62 u32 datahi = nvkm_ro32(pt->memory, pt->base + ptei * 8 + 4); in gp100_vmm_pfn_clear()
70 nvkm_done(pt->memory); in gp100_vmm_pfn_clear()
78 struct device *dev = vmm->mmu->subdev.device->dev; in gp100_vmm_pgt_pfn()
81 nvkm_kmap(pt->memory); in gp100_vmm_pgt_pfn()
82 for (; ptes; ptes--, map->pfn++) { in gp100_vmm_pgt_pfn()
85 if (!(*map->pfn & NVKM_VMM_PFN_V)) in gp100_vmm_pgt_pfn()
88 if (!(*map->pfn & NVKM_VMM_PFN_W)) in gp100_vmm_pgt_pfn()
91 if (!(*map->pfn & NVKM_VMM_PFN_A)) in gp100_vmm_pgt_pfn()
94 if (!(*map->pfn & NVKM_VMM_PFN_VRAM)) { in gp100_vmm_pgt_pfn()
95 addr = *map->pfn >> NVKM_VMM_PFN_ADDR_SHIFT; in gp100_vmm_pgt_pfn()
101 data |= BIT_ULL(3); /* VOL. */ in gp100_vmm_pgt_pfn()
105 data |= (*map->pfn & NVKM_VMM_PFN_ADDR) >> 4; in gp100_vmm_pgt_pfn()
111 nvkm_done(pt->memory); in gp100_vmm_pgt_pfn()
118 u64 data = (addr >> 4) | map->type; in gp100_vmm_pgt_pte()
120 map->type += ptes * map->ctag; in gp100_vmm_pgt_pte()
122 while (ptes--) { in gp100_vmm_pgt_pte()
124 data += map->next; in gp100_vmm_pgt_pte()
139 if (map->page->shift == PAGE_SHIFT) { in gp100_vmm_pgt_dma()
141 nvkm_kmap(pt->memory); in gp100_vmm_pgt_dma()
142 while (ptes--) { in gp100_vmm_pgt_dma()
143 const u64 data = (*map->dma++ >> 4) | map->type; in gp100_vmm_pgt_dma()
145 map->type += map->ctag; in gp100_vmm_pgt_dma()
147 nvkm_done(pt->memory); in gp100_vmm_pgt_dma()
165 /* VALID_FALSE + VOL tells the MMU to treat the PTE as sparse. */ in gp100_vmm_pgt_sparse()
166 VMM_FO064(pt, vmm, ptei * 8, BIT_ULL(3) /* VOL. */, ptes); in gp100_vmm_pgt_sparse()
201 u64 data = (addr >> 4) | map->type; in gp100_vmm_pd0_pte()
203 map->type += ptes * map->ctag; in gp100_vmm_pd0_pte()
205 while (ptes--) { in gp100_vmm_pd0_pte()
207 data += map->next; in gp100_vmm_pd0_pte()
221 switch (nvkm_memory_target(pt->memory)) { in gp100_vmm_pde()
224 *data |= BIT_ULL(3); /* VOL. */ in gp100_vmm_pde()
231 *data |= pt->addr >> 4; in gp100_vmm_pde()
238 struct nvkm_vmm_pt *pgt = pgd->pde[pdei]; in gp100_vmm_pd0_pde()
239 struct nvkm_mmu_pt *pd = pgd->pt[0]; in gp100_vmm_pd0_pde()
242 if (pgt->pt[0] && !gp100_vmm_pde(pgt->pt[0], &data[0])) in gp100_vmm_pd0_pde()
244 if (pgt->pt[1] && !gp100_vmm_pde(pgt->pt[1], &data[1])) in gp100_vmm_pd0_pde()
247 nvkm_kmap(pd->memory); in gp100_vmm_pd0_pde()
249 nvkm_done(pd->memory); in gp100_vmm_pd0_pde()
271 struct device *dev = vmm->mmu->subdev.device->dev; in gp100_vmm_pd0_pfn_unmap()
274 nvkm_kmap(pt->memory); in gp100_vmm_pd0_pfn_unmap()
275 while (ptes--) { in gp100_vmm_pd0_pfn_unmap()
276 u32 datalo = nvkm_ro32(pt->memory, pt->base + ptei * 16 + 0); in gp100_vmm_pd0_pfn_unmap()
277 u32 datahi = nvkm_ro32(pt->memory, pt->base + ptei * 16 + 4); in gp100_vmm_pd0_pfn_unmap()
286 nvkm_done(pt->memory); in gp100_vmm_pd0_pfn_unmap()
295 nvkm_kmap(pt->memory); in gp100_vmm_pd0_pfn_clear()
296 while (ptes--) { in gp100_vmm_pd0_pfn_clear()
297 u32 datalo = nvkm_ro32(pt->memory, pt->base + ptei * 16 + 0); in gp100_vmm_pd0_pfn_clear()
298 u32 datahi = nvkm_ro32(pt->memory, pt->base + ptei * 16 + 4); in gp100_vmm_pd0_pfn_clear()
307 nvkm_done(pt->memory); in gp100_vmm_pd0_pfn_clear()
315 struct device *dev = vmm->mmu->subdev.device->dev; in gp100_vmm_pd0_pfn()
318 nvkm_kmap(pt->memory); in gp100_vmm_pd0_pfn()
319 for (; ptes; ptes--, map->pfn++) { in gp100_vmm_pd0_pfn()
322 if (!(*map->pfn & NVKM_VMM_PFN_V)) in gp100_vmm_pd0_pfn()
325 if (!(*map->pfn & NVKM_VMM_PFN_W)) in gp100_vmm_pd0_pfn()
328 if (!(*map->pfn & NVKM_VMM_PFN_A)) in gp100_vmm_pd0_pfn()
331 if (!(*map->pfn & NVKM_VMM_PFN_VRAM)) { in gp100_vmm_pd0_pfn()
332 addr = *map->pfn >> NVKM_VMM_PFN_ADDR_SHIFT; in gp100_vmm_pd0_pfn()
338 data |= BIT_ULL(3); /* VOL. */ in gp100_vmm_pd0_pfn()
342 data |= (*map->pfn & NVKM_VMM_PFN_ADDR) >> 4; in gp100_vmm_pd0_pfn()
348 nvkm_done(pt->memory); in gp100_vmm_pd0_pfn()
365 struct nvkm_vmm_pt *pgt = pgd->pde[pdei]; in gp100_vmm_pd1_pde()
366 struct nvkm_mmu_pt *pd = pgd->pt[0]; in gp100_vmm_pd1_pde()
369 if (!gp100_vmm_pde(pgt->pt[0], &data)) in gp100_vmm_pd1_pde()
372 nvkm_kmap(pd->memory); in gp100_vmm_pd1_pde()
374 nvkm_done(pd->memory); in gp100_vmm_pd1_pde()
408 const enum nvkm_memory_target target = nvkm_memory_target(map->memory); in gp100_vmm_valid()
409 const struct nvkm_vmm_page *page = map->page; in gp100_vmm_valid()
414 struct nvkm_device *device = vmm->mmu->subdev.device; in gp100_vmm_valid()
415 struct nvkm_memory *memory = map->memory; in gp100_vmm_valid()
416 u8 kind, kind_inv, priv, ro, vol; in gp100_vmm_valid() local
417 int kindn, aper, ret = -ENOSYS; in gp100_vmm_valid()
420 map->next = (1ULL << page->shift) >> 4; in gp100_vmm_valid()
421 map->type = 0; in gp100_vmm_valid()
423 if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) { in gp100_vmm_valid()
424 vol = !!args->v0.vol; in gp100_vmm_valid()
425 ro = !!args->v0.ro; in gp100_vmm_valid()
426 priv = !!args->v0.priv; in gp100_vmm_valid()
427 kind = args->v0.kind; in gp100_vmm_valid()
429 if (!(ret = nvif_unvers(ret, &argv, &argc, args->vn))) { in gp100_vmm_valid()
430 vol = target == NVKM_MEM_TARGET_HOST; in gp100_vmm_valid()
439 aper = vmm->func->aper(target); in gp100_vmm_valid()
443 kindm = vmm->mmu->func->kind(vmm->mmu, &kindn, &kind_inv); in gp100_vmm_valid()
446 return -EINVAL; in gp100_vmm_valid()
451 if (aper != 0 || !(page->type & NVKM_VMM_PAGE_COMP)) { in gp100_vmm_valid()
452 VMM_DEBUG(vmm, "comp %d %02x", aper, page->type); in gp100_vmm_valid()
453 return -EINVAL; in gp100_vmm_valid()
456 if (!map->no_comp) { in gp100_vmm_valid()
459 &map->tags); in gp100_vmm_valid()
466 if (!map->no_comp && map->tags->mn) { in gp100_vmm_valid()
467 tags = map->tags->mn->offset + (map->offset >> 16); in gp100_vmm_valid()
468 map->ctag |= ((1ULL << page->shift) >> 16) << 36; in gp100_vmm_valid()
469 map->type |= tags << 36; in gp100_vmm_valid()
470 map->next |= map->ctag; in gp100_vmm_valid()
476 map->type |= BIT(0); in gp100_vmm_valid()
477 map->type |= (u64)aper << 1; in gp100_vmm_valid()
478 map->type |= (u64) vol << 3; in gp100_vmm_valid()
479 map->type |= (u64)priv << 5; in gp100_vmm_valid()
480 map->type |= (u64) ro << 6; in gp100_vmm_valid()
481 map->type |= (u64)kind << 56; in gp100_vmm_valid()
488 struct nvkm_device *device = vmm->mmu->subdev.device; in gp100_vmm_fault_cancel()
492 int ret = -ENOSYS; in gp100_vmm_fault_cancel()
495 if ((ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) in gp100_vmm_fault_cancel()
501 aper = (args->v0.inst >> 8) & 3; in gp100_vmm_fault_cancel()
502 args->v0.inst >>= 12; in gp100_vmm_fault_cancel()
503 args->v0.inst |= aper << 28; in gp100_vmm_fault_cancel()
504 args->v0.inst |= 0x80000000; in gp100_vmm_fault_cancel()
507 if (nvkm_gr_ctxsw_inst(device) == args->v0.inst) { in gp100_vmm_fault_cancel()
510 (args->v0.hub << 20) | in gp100_vmm_fault_cancel()
511 (args->v0.gpc << 15) | in gp100_vmm_fault_cancel()
512 (args->v0.client << 9)); in gp100_vmm_fault_cancel()
526 int ret = -ENOSYS; in gp100_vmm_fault_replay()
528 if (!(ret = nvif_unvers(ret, &argv, &argc, args->vn))) { in gp100_vmm_fault_replay()
547 return -EINVAL; in gp100_vmm_mthd()
553 struct nvkm_device *device = vmm->mmu->subdev.device; in gp100_vmm_invalidate_pdb()
562 if (atomic_read(&vmm->engref[NVKM_SUBDEV_BAR])) in gp100_vmm_flush()
572 if (vmm->replay) { in gp100_vmm_join()
609 int ret = -ENOSYS; in gp100_vmm_new_()
612 if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) { in gp100_vmm_new_()
613 replay = args->v0.fault_replay != 0; in gp100_vmm_new_()
615 if (!(ret = nvif_unvers(ret, &argv, &argc, args->vn))) { in gp100_vmm_new_()
624 (*pvmm)->replay = replay; in gp100_vmm_new_()