Home
last modified time | relevance | path

Searched refs:mem (Results 1 – 25 of 1556) sorted by relevance

12345678910>>...63

/linux-6.6.21/arch/powerpc/mm/book3s64/
Diommu_api.c60 struct mm_iommu_table_group_mem_t *mem, *mem2; in mm_iommu_do_alloc() local
73 mem = kzalloc(sizeof(*mem), GFP_KERNEL); in mm_iommu_do_alloc()
74 if (!mem) { in mm_iommu_do_alloc()
80 mem->pageshift = __ffs(dev_hpa | (entries << PAGE_SHIFT)); in mm_iommu_do_alloc()
81 mem->dev_hpa = dev_hpa; in mm_iommu_do_alloc()
84 mem->dev_hpa = MM_IOMMU_TABLE_INVALID_HPA; in mm_iommu_do_alloc()
91 mem->pageshift = __ffs(ua | (entries << PAGE_SHIFT)); in mm_iommu_do_alloc()
92 mem->hpas = vzalloc(array_size(entries, sizeof(mem->hpas[0]))); in mm_iommu_do_alloc()
93 if (!mem->hpas) { in mm_iommu_do_alloc()
94 kfree(mem); in mm_iommu_do_alloc()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
Dmem.c35 struct page **mem; member
57 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_addr() local
58 if (mem->pages == 1 && mem->mem) in nvkm_mem_addr()
59 return mem->dma[0]; in nvkm_mem_addr()
73 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_map_dma() local
75 .memory = &mem->memory, in nvkm_mem_map_dma()
77 .dma = mem->dma, in nvkm_mem_map_dma()
85 struct nvkm_mem *mem = nvkm_mem(memory); in nvkm_mem_dtor() local
86 if (mem->mem) { in nvkm_mem_dtor()
87 while (mem->pages--) { in nvkm_mem_dtor()
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/
Dintel_memory_region.c36 static int __iopagetest(struct intel_memory_region *mem, in __iopagetest() argument
51 dev_err(mem->i915->drm.dev, in __iopagetest()
53 &mem->region, &mem->io_start, &offset, caller, in __iopagetest()
61 static int iopagetest(struct intel_memory_region *mem, in iopagetest() argument
70 va = ioremap_wc(mem->io_start + offset, PAGE_SIZE); in iopagetest()
72 dev_err(mem->i915->drm.dev, in iopagetest()
74 &mem->io_start, &offset, caller); in iopagetest()
79 err = __iopagetest(mem, va, PAGE_SIZE, val[i], offset, caller); in iopagetest()
83 err = __iopagetest(mem, va, PAGE_SIZE, ~val[i], offset, caller); in iopagetest()
98 static int iomemtest(struct intel_memory_region *mem, in iomemtest() argument
[all …]
Dintel_region_ttm.c54 int intel_region_to_ttm_type(const struct intel_memory_region *mem) in intel_region_to_ttm_type() argument
58 GEM_BUG_ON(mem->type != INTEL_MEMORY_LOCAL && in intel_region_to_ttm_type()
59 mem->type != INTEL_MEMORY_MOCK && in intel_region_to_ttm_type()
60 mem->type != INTEL_MEMORY_SYSTEM); in intel_region_to_ttm_type()
62 if (mem->type == INTEL_MEMORY_SYSTEM) in intel_region_to_ttm_type()
65 type = mem->instance + TTM_PL_PRIV; in intel_region_to_ttm_type()
82 int intel_region_ttm_init(struct intel_memory_region *mem) in intel_region_ttm_init() argument
84 struct ttm_device *bdev = &mem->i915->bdev; in intel_region_ttm_init()
85 int mem_type = intel_region_to_ttm_type(mem); in intel_region_ttm_init()
89 resource_size(&mem->region), in intel_region_ttm_init()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/
Dnouveau_mem.c37 nouveau_mem_map(struct nouveau_mem *mem, in nouveau_mem_map() argument
53 args.nv50.kind = mem->kind; in nouveau_mem_map()
54 args.nv50.comp = mem->comp; in nouveau_mem_map()
61 if (mem->mem.type & NVIF_MEM_VRAM) in nouveau_mem_map()
67 args.gf100.kind = mem->kind; in nouveau_mem_map()
75 return nvif_vmm_map(vmm, vma->addr, mem->mem.size, &args, argc, &mem->mem, 0); in nouveau_mem_map()
79 nouveau_mem_fini(struct nouveau_mem *mem) in nouveau_mem_fini() argument
81 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[1]); in nouveau_mem_fini()
82 nvif_vmm_put(&mem->cli->drm->client.vmm.vmm, &mem->vma[0]); in nouveau_mem_fini()
83 mutex_lock(&mem->cli->drm->master.lock); in nouveau_mem_fini()
[all …]
/linux-6.6.21/drivers/staging/media/atomisp/pci/runtime/isp_param/src/
Disp_param.c27 enum ia_css_isp_memories mem, in ia_css_isp_param_set_mem_init() argument
30 mem_init->params[pclass][mem].address = address; in ia_css_isp_param_set_mem_init()
31 mem_init->params[pclass][mem].size = (uint32_t)size; in ia_css_isp_param_set_mem_init()
38 enum ia_css_isp_memories mem, in ia_css_isp_param_set_css_mem_init() argument
41 mem_init->params[pclass][mem].address = address; in ia_css_isp_param_set_css_mem_init()
42 mem_init->params[pclass][mem].size = (uint32_t)size; in ia_css_isp_param_set_css_mem_init()
49 enum ia_css_isp_memories mem, in ia_css_isp_param_set_isp_mem_init() argument
52 mem_init->params[pclass][mem].address = address; in ia_css_isp_param_set_isp_mem_init()
53 mem_init->params[pclass][mem].size = (uint32_t)size; in ia_css_isp_param_set_isp_mem_init()
61 enum ia_css_isp_memories mem) in ia_css_isp_param_get_mem_init() argument
[all …]
/linux-6.6.21/drivers/media/v4l2-core/
Dvideobuf-dma-contig.c38 struct videobuf_dma_contig_memory *mem, in __videobuf_dc_alloc() argument
41 mem->size = size; in __videobuf_dc_alloc()
42 mem->vaddr = dma_alloc_coherent(dev, mem->size, &mem->dma_handle, in __videobuf_dc_alloc()
44 if (!mem->vaddr) { in __videobuf_dc_alloc()
45 dev_err(dev, "memory alloc size %ld failed\n", mem->size); in __videobuf_dc_alloc()
49 dev_dbg(dev, "dma mapped data is at %p (%ld)\n", mem->vaddr, mem->size); in __videobuf_dc_alloc()
55 struct videobuf_dma_contig_memory *mem) in __videobuf_dc_free() argument
57 dma_free_coherent(dev, mem->size, mem->vaddr, mem->dma_handle); in __videobuf_dc_free()
59 mem->vaddr = NULL; in __videobuf_dc_free()
83 struct videobuf_dma_contig_memory *mem; in videobuf_vm_close() local
[all …]
Dvideobuf-vmalloc.c72 struct videobuf_vmalloc_memory *mem; in videobuf_vm_close() local
88 mem = q->bufs[i]->priv; in videobuf_vm_close()
89 if (mem) { in videobuf_vm_close()
96 MAGIC_CHECK(mem->magic, MAGIC_VMAL_MEM); in videobuf_vm_close()
102 __func__, i, mem->vaddr); in videobuf_vm_close()
104 vfree(mem->vaddr); in videobuf_vm_close()
105 mem->vaddr = NULL; in videobuf_vm_close()
137 struct videobuf_vmalloc_memory *mem; in __videobuf_alloc_vb() local
140 vb = kzalloc(size + sizeof(*mem), GFP_KERNEL); in __videobuf_alloc_vb()
144 mem = vb->priv = ((char *)vb) + size; in __videobuf_alloc_vb()
[all …]
/linux-6.6.21/drivers/pci/endpoint/
Dpci-epc-mem.c23 static int pci_epc_mem_get_order(struct pci_epc_mem *mem, size_t size) in pci_epc_mem_get_order() argument
26 unsigned int page_shift = ilog2(mem->window.page_size); in pci_epc_mem_get_order()
51 struct pci_epc_mem *mem = NULL; in pci_epc_multi_mem_init() local
77 mem = kzalloc(sizeof(*mem), GFP_KERNEL); in pci_epc_multi_mem_init()
78 if (!mem) { in pci_epc_multi_mem_init()
87 kfree(mem); in pci_epc_multi_mem_init()
92 mem->window.phys_base = windows[i].phys_base; in pci_epc_multi_mem_init()
93 mem->window.size = windows[i].size; in pci_epc_multi_mem_init()
94 mem->window.page_size = page_size; in pci_epc_multi_mem_init()
95 mem->bitmap = bitmap; in pci_epc_multi_mem_init()
[all …]
/linux-6.6.21/kernel/dma/
Dcoherent.c31 struct dma_coherent_mem * mem) in dma_get_device_base() argument
33 if (mem->use_dev_dma_pfn_offset) in dma_get_device_base()
34 return phys_to_dma(dev, PFN_PHYS(mem->pfn_base)); in dma_get_device_base()
35 return mem->device_base; in dma_get_device_base()
77 static void _dma_release_coherent_memory(struct dma_coherent_mem *mem) in _dma_release_coherent_memory() argument
79 if (!mem) in _dma_release_coherent_memory()
82 memunmap(mem->virt_base); in _dma_release_coherent_memory()
83 bitmap_free(mem->bitmap); in _dma_release_coherent_memory()
84 kfree(mem); in _dma_release_coherent_memory()
88 struct dma_coherent_mem *mem) in dma_assign_coherent_memory() argument
[all …]
Dswiotlb.c228 struct io_tlb_pool *mem = &io_tlb_default_mem.defpool; in swiotlb_print_info() local
230 if (!mem->nslabs) { in swiotlb_print_info()
235 pr_info("mapped [mem %pa-%pa] (%luMB)\n", &mem->start, &mem->end, in swiotlb_print_info()
236 (mem->nslabs << IO_TLB_SHIFT) >> 20); in swiotlb_print_info()
257 struct io_tlb_pool *mem = &io_tlb_default_mem.defpool; in swiotlb_update_mem_attributes() local
260 if (!mem->nslabs || mem->late_alloc) in swiotlb_update_mem_attributes()
262 bytes = PAGE_ALIGN(mem->nslabs << IO_TLB_SHIFT); in swiotlb_update_mem_attributes()
263 set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT); in swiotlb_update_mem_attributes()
266 static void swiotlb_init_io_tlb_pool(struct io_tlb_pool *mem, phys_addr_t start, in swiotlb_init_io_tlb_pool() argument
272 mem->nslabs = nslabs; in swiotlb_init_io_tlb_pool()
[all …]
/linux-6.6.21/drivers/base/
Dmemory.c107 struct memory_block *mem = to_memory_block(dev); in memory_block_release() local
109 WARN_ON(mem->altmap); in memory_block_release()
110 kfree(mem); in memory_block_release()
123 struct memory_block *mem = to_memory_block(dev); in phys_index_show() local
125 return sysfs_emit(buf, "%08lx\n", memory_block_id(mem->start_section_nr)); in phys_index_show()
144 struct memory_block *mem = to_memory_block(dev); in state_show() local
151 switch (mem->state) { in state_show()
163 return sysfs_emit(buf, "ERROR-UNKNOWN-%ld\n", mem->state); in state_show()
175 static unsigned long memblk_nr_poison(struct memory_block *mem);
177 static inline unsigned long memblk_nr_poison(struct memory_block *mem) in memblk_nr_poison() argument
[all …]
/linux-6.6.21/drivers/infiniband/sw/siw/
Dsiw_mem.c50 struct siw_mem *mem; in siw_mem_id2obj() local
53 mem = xa_load(&sdev->mem_xa, stag_index); in siw_mem_id2obj()
54 if (likely(mem && kref_get_unless_zero(&mem->ref))) { in siw_mem_id2obj()
56 return mem; in siw_mem_id2obj()
93 struct siw_mem *mem = kzalloc(sizeof(*mem), GFP_KERNEL); in siw_mr_add_mem() local
97 if (!mem) in siw_mr_add_mem()
100 mem->mem_obj = mem_obj; in siw_mr_add_mem()
101 mem->stag_valid = 0; in siw_mr_add_mem()
102 mem->sdev = sdev; in siw_mr_add_mem()
103 mem->va = start; in siw_mr_add_mem()
[all …]
/linux-6.6.21/tools/testing/selftests/mm/
Dmkdirty.c41 static void do_test_write_sigsegv(char *mem) in do_test_write_sigsegv() argument
43 char orig = *mem; in do_test_write_sigsegv()
53 *mem = orig + 1; in do_test_write_sigsegv()
58 ksft_test_result(ret == 1 && *mem == orig, in do_test_write_sigsegv()
65 char *mem, *mmap_mem; in mmap_thp_range() local
73 mem = (char *)(((uintptr_t)mmap_mem + thpsize) & ~(thpsize - 1)); in mmap_thp_range()
75 if (madvise(mem, thpsize, MADV_HUGEPAGE)) { in mmap_thp_range()
83 return mem; in mmap_thp_range()
89 char *mem; in test_ptrace_write() local
94 mem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); in test_ptrace_write()
[all …]
Dcow.c100 static int child_memcmp_fn(char *mem, size_t size, in child_memcmp_fn() argument
107 memcpy(old, mem, size); in child_memcmp_fn()
115 return memcmp(old, mem, size); in child_memcmp_fn()
118 static int child_vmsplice_memcmp_fn(char *mem, size_t size, in child_vmsplice_memcmp_fn() argument
122 .iov_base = mem, in child_vmsplice_memcmp_fn()
134 memcpy(old, mem, size); in child_vmsplice_memcmp_fn()
147 if (munmap(mem, size) < 0) in child_vmsplice_memcmp_fn()
165 typedef int (*child_fn)(char *mem, size_t size, struct comm_pipes *comm_pipes);
167 static void do_test_cow_in_parent(char *mem, size_t size, bool do_mprotect, in do_test_cow_in_parent() argument
185 exit(fn(mem, size, &comm_pipes)); in do_test_cow_in_parent()
[all …]
/linux-6.6.21/drivers/gpu/drm/amd/amdgpu/
Damdgpu_amdkfd_gpuvm.c77 struct kgd_mem *mem) in kfd_mem_is_attached() argument
81 list_for_each_entry(entry, &mem->attachments, list) in kfd_mem_is_attached()
114 uint64_t mem; in amdgpu_amdkfd_gpuvm_init_mem_limits() local
120 mem = si.freeram - si.freehigh; in amdgpu_amdkfd_gpuvm_init_mem_limits()
121 mem *= si.mem_unit; in amdgpu_amdkfd_gpuvm_init_mem_limits()
124 kfd_mem_limit.max_system_mem_limit = mem - (mem >> 4); in amdgpu_amdkfd_gpuvm_init_mem_limits()
307 struct kgd_mem *mem, struct amdgpu_bo **bo_out) in create_dmamap_sg_bo() argument
313 ret = amdgpu_bo_reserve(mem->bo, false); in create_dmamap_sg_bo()
317 if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) in create_dmamap_sg_bo()
318 flags |= mem->bo->flags & (AMDGPU_GEM_CREATE_COHERENT | in create_dmamap_sg_bo()
[all …]
/linux-6.6.21/tools/perf/
Dbuiltin-mem.c45 struct perf_mem *mem = *(struct perf_mem **)opt->value; in parse_record_events() local
54 mem->operation = 0; in parse_record_events()
66 static int __cmd_record(int argc, const char **argv, struct perf_mem *mem) in __cmd_record() argument
76 OPT_CALLBACK('e', "event", &mem, "event", in __cmd_record()
98 if (mem->cpu_list) in __cmd_record()
123 (mem->operation & MEM_OPERATION_LOAD) && in __cmd_record()
124 (mem->operation & MEM_OPERATION_STORE)) { in __cmd_record()
128 if (mem->operation & MEM_OPERATION_LOAD) { in __cmd_record()
133 if (mem->operation & MEM_OPERATION_STORE) { in __cmd_record()
145 if (mem->phys_addr) in __cmd_record()
[all …]
/linux-6.6.21/drivers/gpu/drm/ttm/
Dttm_agp_backend.c46 struct agp_memory *mem; member
54 struct agp_memory *mem; in ttm_agp_bind() local
58 if (agp_be->mem) in ttm_agp_bind()
61 mem = agp_allocate_memory(agp_be->bridge, ttm->num_pages, AGP_USER_MEMORY); in ttm_agp_bind()
62 if (unlikely(mem == NULL)) in ttm_agp_bind()
65 mem->page_count = 0; in ttm_agp_bind()
72 mem->pages[mem->page_count++] = page; in ttm_agp_bind()
74 agp_be->mem = mem; in ttm_agp_bind()
76 mem->is_flushed = 1; in ttm_agp_bind()
77 mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; in ttm_agp_bind()
[all …]
/linux-6.6.21/drivers/spi/
Dspi-mem.c104 static int spi_check_buswidth_req(struct spi_mem *mem, u8 buswidth, bool tx) in spi_check_buswidth_req() argument
106 u32 mode = mem->spi->mode; in spi_check_buswidth_req()
142 static bool spi_mem_check_buswidth(struct spi_mem *mem, in spi_mem_check_buswidth() argument
145 if (spi_check_buswidth_req(mem, op->cmd.buswidth, true)) in spi_mem_check_buswidth()
149 spi_check_buswidth_req(mem, op->addr.buswidth, true)) in spi_mem_check_buswidth()
153 spi_check_buswidth_req(mem, op->dummy.buswidth, true)) in spi_mem_check_buswidth()
157 spi_check_buswidth_req(mem, op->data.buswidth, in spi_mem_check_buswidth()
164 bool spi_mem_default_supports_op(struct spi_mem *mem, in spi_mem_default_supports_op() argument
167 struct spi_controller *ctlr = mem->spi->controller; in spi_mem_default_supports_op()
187 return spi_mem_check_buswidth(mem, op); in spi_mem_default_supports_op()
[all …]
/linux-6.6.21/drivers/firmware/efi/
Dcper.c241 int cper_mem_err_location(struct cper_mem_err_compact *mem, char *msg) in cper_mem_err_location() argument
250 if (mem->validation_bits & CPER_MEM_VALID_NODE) in cper_mem_err_location()
251 n += scnprintf(msg + n, len - n, "node:%d ", mem->node); in cper_mem_err_location()
252 if (mem->validation_bits & CPER_MEM_VALID_CARD) in cper_mem_err_location()
253 n += scnprintf(msg + n, len - n, "card:%d ", mem->card); in cper_mem_err_location()
254 if (mem->validation_bits & CPER_MEM_VALID_MODULE) in cper_mem_err_location()
255 n += scnprintf(msg + n, len - n, "module:%d ", mem->module); in cper_mem_err_location()
256 if (mem->validation_bits & CPER_MEM_VALID_RANK_NUMBER) in cper_mem_err_location()
257 n += scnprintf(msg + n, len - n, "rank:%d ", mem->rank); in cper_mem_err_location()
258 if (mem->validation_bits & CPER_MEM_VALID_BANK) in cper_mem_err_location()
[all …]
/linux-6.6.21/mm/
Dcma_debug.c71 static void cma_add_to_cma_mem_list(struct cma *cma, struct cma_mem *mem) in cma_add_to_cma_mem_list() argument
74 hlist_add_head(&mem->node, &cma->mem_head); in cma_add_to_cma_mem_list()
80 struct cma_mem *mem = NULL; in cma_get_entry_from_list() local
84 mem = hlist_entry(cma->mem_head.first, struct cma_mem, node); in cma_get_entry_from_list()
85 hlist_del_init(&mem->node); in cma_get_entry_from_list()
89 return mem; in cma_get_entry_from_list()
94 struct cma_mem *mem = NULL; in cma_free_mem() local
97 mem = cma_get_entry_from_list(cma); in cma_free_mem()
98 if (mem == NULL) in cma_free_mem()
101 if (mem->n <= count) { in cma_free_mem()
[all …]
/linux-6.6.21/drivers/char/hw_random/
Dintel-rng.c155 static inline u8 hwstatus_get(void __iomem *mem) in hwstatus_get() argument
157 return readb(mem + INTEL_RNG_HW_STATUS); in hwstatus_get()
160 static inline u8 hwstatus_set(void __iomem *mem, in hwstatus_set() argument
163 writeb(hw_status, mem + INTEL_RNG_HW_STATUS); in hwstatus_set()
164 return hwstatus_get(mem); in hwstatus_set()
169 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_present() local
173 data = !!(readb(mem + INTEL_RNG_STATUS) & in intel_rng_data_present()
184 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_read() local
186 *data = readb(mem + INTEL_RNG_DATA); in intel_rng_data_read()
193 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_init() local
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/gem/
Di915_gem_region.c14 struct intel_memory_region *mem) in i915_gem_object_init_memory_region() argument
16 obj->mm.region = mem; in i915_gem_object_init_memory_region()
18 mutex_lock(&mem->objects.lock); in i915_gem_object_init_memory_region()
19 list_add(&obj->mm.region_link, &mem->objects.list); in i915_gem_object_init_memory_region()
20 mutex_unlock(&mem->objects.lock); in i915_gem_object_init_memory_region()
25 struct intel_memory_region *mem = obj->mm.region; in i915_gem_object_release_memory_region() local
27 mutex_lock(&mem->objects.lock); in i915_gem_object_release_memory_region()
29 mutex_unlock(&mem->objects.lock); in i915_gem_object_release_memory_region()
33 __i915_gem_object_create_region(struct intel_memory_region *mem, in __i915_gem_object_create_region() argument
56 if (!mem) in __i915_gem_object_create_region()
[all …]
/linux-6.6.21/drivers/net/ipa/
Dipa_qmi.c289 const struct ipa_mem *mem; in init_modem_driver_req() local
302 mem = ipa_mem_find(ipa, IPA_MEM_MODEM_HEADER); in init_modem_driver_req()
303 if (mem->size) { in init_modem_driver_req()
305 req.hdr_tbl_info.start = ipa->mem_offset + mem->offset; in init_modem_driver_req()
306 req.hdr_tbl_info.end = req.hdr_tbl_info.start + mem->size - 1; in init_modem_driver_req()
309 mem = ipa_mem_find(ipa, IPA_MEM_V4_ROUTE); in init_modem_driver_req()
311 req.v4_route_tbl_info.start = ipa->mem_offset + mem->offset; in init_modem_driver_req()
314 mem = ipa_mem_find(ipa, IPA_MEM_V6_ROUTE); in init_modem_driver_req()
316 req.v6_route_tbl_info.start = ipa->mem_offset + mem->offset; in init_modem_driver_req()
319 mem = ipa_mem_find(ipa, IPA_MEM_V4_FILTER); in init_modem_driver_req()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/nvif/
Dmem.c29 struct nvif_mem *mem) in nvif_mem_ctor_map() argument
31 int ret = nvif_mem_ctor(mmu, name, mmu->mem, NVIF_MEM_MAPPABLE | type, in nvif_mem_ctor_map()
32 0, size, NULL, 0, mem); in nvif_mem_ctor_map()
34 ret = nvif_object_map(&mem->object, NULL, 0); in nvif_mem_ctor_map()
36 nvif_mem_dtor(mem); in nvif_mem_ctor_map()
42 nvif_mem_dtor(struct nvif_mem *mem) in nvif_mem_dtor() argument
44 nvif_object_dtor(&mem->object); in nvif_mem_dtor()
50 struct nvif_mem *mem) in nvif_mem_ctor_type() argument
56 mem->object.client = NULL; in nvif_mem_ctor_type()
73 args, sizeof(*args) + argc, &mem->object); in nvif_mem_ctor_type()
[all …]

12345678910>>...63