| /linux/tools/testing/selftests/arm64/mte/ |
| H A D | check_mmap_options.c | 45 int mem_type; member 113 static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, in check_anonymous_memory_mapping() argument 126 map_ptr = (char *)mte_allocate_memory(map_size, mem_type, mapping, false); in check_anonymous_memory_mapping() 127 if (check_allocated_memory(map_ptr, map_size, mem_type, false) != KSFT_PASS) in check_anonymous_memory_mapping() 141 mte_free_memory((void *)map_ptr, map_size, mem_type, false); in check_anonymous_memory_mapping() 148 static int check_file_memory_mapping(int mem_type, int mode, int mapping, in check_file_memory_mapping() argument 166 map_ptr = (char *)mte_allocate_file_memory(map_size, mem_type, mapping, false, fd); in check_file_memory_mapping() 167 if (check_allocated_memory(map_ptr, map_size, mem_type, false) != KSFT_PASS) { in check_file_memory_mapping() 191 static int check_clear_prot_mte_flag(int mem_type, int mode, int mapping, int atag_check) in check_clear_prot_mte_flag() argument 201 ptr = (char *)mte_allocate_memory_tag_range(sizes[run], mem_type, mapping, in check_clear_prot_mte_flag() [all …]
|
| H A D | check_buffer_fill.c | 28 static int check_buffer_by_byte(int mem_type, int mode) in check_buffer_by_byte() argument 38 ptr = (char *)mte_allocate_memory(sizes[i], mem_type, 0, true); in check_buffer_by_byte() 39 if (check_allocated_memory(ptr, sizes[i], mem_type, true) != KSFT_PASS) in check_buffer_by_byte() 52 mte_free_memory((void *)ptr, sizes[i], mem_type, true); in check_buffer_by_byte() 63 static int check_buffer_underflow_by_byte(int mem_type, int mode, in check_buffer_underflow_by_byte() argument 74 ptr = (char *)mte_allocate_memory_tag_range(sizes[i], mem_type, 0, in check_buffer_underflow_by_byte() 76 if (check_allocated_memory_range(ptr, sizes[i], mem_type, in check_buffer_underflow_by_byte() 151 mte_free_memory_tag_range((void *)ptr, sizes[i], mem_type, underflow_range, 0); in check_buffer_underflow_by_byte() 158 static int check_buffer_overflow_by_byte(int mem_type, int mode, in check_buffer_overflow_by_byte() argument 170 ptr = (char *)mte_allocate_memory_tag_range(sizes[i], mem_type, 0, in check_buffer_overflow_by_byte() [all …]
|
| H A D | check_tags_inclusion.c | 49 static int check_single_included_tags(int mem_type, int mode) in check_single_included_tags() argument 54 ptr = mte_allocate_memory(BUFFER_SIZE + MT_GRANULE_SIZE, mem_type, 0, false); in check_single_included_tags() 56 mem_type, false) != KSFT_PASS) in check_single_included_tags() 77 mte_free_memory_tag_range(ptr, BUFFER_SIZE, mem_type, 0, MT_GRANULE_SIZE); in check_single_included_tags() 81 static int check_multiple_included_tags(int mem_type, int mode) in check_multiple_included_tags() argument 87 ptr = mte_allocate_memory(BUFFER_SIZE + MT_GRANULE_SIZE, mem_type, 0, false); in check_multiple_included_tags() 89 mem_type, false) != KSFT_PASS) in check_multiple_included_tags() 109 mte_free_memory_tag_range(ptr, BUFFER_SIZE, mem_type, 0, MT_GRANULE_SIZE); in check_multiple_included_tags() 113 static int check_all_included_tags(int mem_type, int mode) in check_all_included_tags() argument 118 ptr = mte_allocate_memory(BUFFER_SIZE + MT_GRANULE_SIZE, mem_type, 0, false); in check_all_included_tags() [all …]
|
| H A D | mte_common_util.c | 167 static void *__mte_allocate_memory_range(size_t size, int mem_type, int mapping, in __mte_allocate_memory_range() argument 175 switch (mem_type) { in __mte_allocate_memory_range() 187 if (mem_type == USE_MMAP) in __mte_allocate_memory_range() 200 if (mem_type == USE_MPROTECT) { in __mte_allocate_memory_range() 212 void *mte_allocate_memory_tag_range(size_t size, int mem_type, int mapping, in mte_allocate_memory_tag_range() argument 215 return __mte_allocate_memory_range(size, mem_type, mapping, range_before, in mte_allocate_memory_tag_range() 219 void *mte_allocate_memory(size_t size, int mem_type, int mapping, bool tags) in mte_allocate_memory() argument 221 return __mte_allocate_memory_range(size, mem_type, mapping, 0, 0, tags, -1); in mte_allocate_memory() 224 void *mte_allocate_file_memory(size_t size, int mem_type, int mapping, bool tags, int fd) in mte_allocate_file_memory() argument 229 if (mem_type != USE_MPROTECT && mem_type != USE_MMAP) { in mte_allocate_file_memory() [all …]
|
| H A D | mte_common_util.h | 48 void *mte_allocate_memory(size_t size, int mem_type, int mapping, bool tags); 49 void *mte_allocate_memory_tag_range(size_t size, int mem_type, int mapping, 51 void *mte_allocate_file_memory(size_t size, int mem_type, int mapping, 53 void *mte_allocate_file_memory_tag_range(size_t size, int mem_type, int mapping, 55 void mte_free_memory(void *ptr, size_t size, int mem_type, bool tags); 56 void mte_free_memory_tag_range(void *ptr, size_t size, int mem_type, 101 int mem_type, bool tags) in check_allocated_memory() argument 110 mte_free_memory((void *)ptr, size, mem_type, false); in check_allocated_memory() 117 static inline int check_allocated_memory_range(void *ptr, size_t size, int mem_type, in check_allocated_memory_range() argument 127 mte_free_memory_tag_range((void *)ptr, size, mem_type, range_before, in check_allocated_memory_range()
|
| H A D | check_hugetlb_options.c | 146 static int check_hugetlb_memory_mapping(int mem_type, int mode, int mapping, int tag_check) in check_hugetlb_memory_mapping() argument 155 map_ptr = (char *)mte_allocate_memory(map_size, mem_type, mapping, false); in check_hugetlb_memory_mapping() 156 if (check_allocated_memory(map_ptr, map_size, mem_type, false) != KSFT_PASS) in check_hugetlb_memory_mapping() 169 mte_free_memory((void *)map_ptr, map_size, mem_type, false); in check_hugetlb_memory_mapping() 176 static int check_clear_prot_mte_flag(int mem_type, int mode, int mapping) in check_clear_prot_mte_flag() argument 185 map_ptr = (char *)mte_allocate_memory_tag_range(map_size, mem_type, mapping, in check_clear_prot_mte_flag() 187 if (check_allocated_memory_range(map_ptr, map_size, mem_type, in check_clear_prot_mte_flag() 192 mte_free_memory_tag_range((void *)map_ptr, map_size, mem_type, in check_clear_prot_mte_flag() 198 mte_free_memory_tag_range((void *)map_ptr, map_size, mem_type, 0, 0); in check_clear_prot_mte_flag() 205 static int check_child_hugetlb_memory_mapping(int mem_type, int mode, int mapping) in check_child_hugetlb_memory_mapping() argument [all …]
|
| H A D | check_child_memory.c | 84 static int check_child_memory_mapping(int mem_type, int mode, int mapping) in check_child_memory_mapping() argument 93 ptr = (char *)mte_allocate_memory_tag_range(sizes[run], mem_type, mapping, in check_child_memory_mapping() 95 if (check_allocated_memory_range(ptr, sizes[run], mem_type, in check_child_memory_mapping() 99 mte_free_memory_tag_range((void *)ptr, sizes[run], mem_type, UNDERFLOW, OVERFLOW); in check_child_memory_mapping() 106 static int check_child_file_mapping(int mem_type, int mode, int mapping) in check_child_file_mapping() argument 119 map_ptr = (char *)mte_allocate_file_memory(map_size, mem_type, mapping, false, fd); in check_child_file_mapping() 120 if (check_allocated_memory(map_ptr, map_size, mem_type, false) != KSFT_PASS) { in check_child_file_mapping()
|
| /linux/drivers/firmware/cirrus/test/ |
| H A D | cs_dsp_test_bin.c | 69 int mem_type; member 129 param->mem_type); in bin_patch_one_word() 134 param->mem_type, in bin_patch_one_word() 145 reg_addr = cs_dsp_mock_base_addr_for_mem(priv, param->mem_type) + in bin_patch_one_word() 178 param->mem_type); in bin_patch_one_multiword() 183 param->mem_type, in bin_patch_one_multiword() 194 reg_addr = cs_dsp_mock_base_addr_for_mem(priv, param->mem_type) + in bin_patch_one_multiword() 227 param->mem_type); in bin_patch_multi_oneword() 234 param->mem_type, in bin_patch_multi_oneword() 246 reg_addr = cs_dsp_mock_base_addr_for_mem(priv, param->mem_type) + in bin_patch_multi_oneword() [all …]
|
| H A D | cs_dsp_test_control_cache.c | 30 int mem_type; member 84 .mem_type = WMFW_ADSP2_YM, 107 static int _get_alg_mem_base_words(struct kunit *test, int alg_index, int mem_type) in _get_alg_mem_base_words() argument 109 switch (mem_type) { in _get_alg_mem_base_words() 117 KUNIT_FAIL(test, "Bug in test: illegal memory type %d\n", mem_type); in _get_alg_mem_base_words() 173 def.mem_type = WMFW_ADSP2_YM; in cs_dsp_ctl_v2_cache_alloc() 218 alg_base_words = _get_alg_mem_base_words(test, alg_idx, param->mem_type); in cs_dsp_ctl_cache_init() 219 reg = cs_dsp_mock_base_addr_for_mem(priv, param->mem_type); in cs_dsp_ctl_cache_init() 227 def.mem_type = param->mem_type; in cs_dsp_ctl_cache_init() 277 def.mem_type = param->mem_type; in cs_dsp_ctl_cache_init_write_only() [all …]
|
| H A D | cs_dsp_mock_mem_maps.c | 92 unsigned int cs_dsp_mock_size_of_region(const struct cs_dsp *dsp, int mem_type) in cs_dsp_mock_size_of_region() argument 107 if (dsp->mem[i].type == mem_type) in cs_dsp_mock_size_of_region() 123 unsigned int cs_dsp_mock_base_addr_for_mem(struct cs_dsp_test *priv, int mem_type) in cs_dsp_mock_base_addr_for_mem() argument 130 if (region[i].type == mem_type) in cs_dsp_mock_base_addr_for_mem() 134 KUNIT_FAIL(priv->test, "Unexpected region %d\n", mem_type); in cs_dsp_mock_base_addr_for_mem() 174 unsigned int cs_dsp_mock_reg_block_length_bytes(struct cs_dsp_test *priv, int mem_type) in cs_dsp_mock_reg_block_length_bytes() argument 178 switch (mem_type) { in cs_dsp_mock_reg_block_length_bytes() 190 switch (mem_type) { in cs_dsp_mock_reg_block_length_bytes() 225 unsigned int cs_dsp_mock_reg_block_length_registers(struct cs_dsp_test *priv, int mem_type) in cs_dsp_mock_reg_block_length_registers() argument 227 return cs_dsp_mock_reg_block_length_bytes(priv, mem_type) / in cs_dsp_mock_reg_block_length_registers() [all …]
|
| /linux/drivers/gpu/drm/ttm/tests/ |
| H A D | ttm_resource_test.c | 14 u32 mem_type; member 50 u32 mem_type, u32 flags) in ttm_init_test_mocks() argument 58 priv->place = ttm_place_kunit_init(test, mem_type, flags); in ttm_init_test_mocks() 63 u32 mem_type) in ttm_init_test_manager() argument 76 ttm_set_driver_manager(ttm_dev, mem_type, man); in ttm_init_test_manager() 83 .mem_type = TTM_PL_SYSTEM, 87 .mem_type = TTM_PL_VRAM, 91 .mem_type = TTM_PRIV_DUMMY_REG, 95 .mem_type = TTM_PL_SYSTEM, 117 ttm_init_test_mocks(test, priv, params->mem_type, params->flags); in ttm_resource_init_basic() [all …]
|
| H A D | ttm_bo_validate_test.c | 23 u32 mem_type; member 158 u32 mem_type = TTM_PL_VRAM; in ttm_bo_init_reserved_mock_man() local 163 ttm_mock_manager_init(priv->ttm_dev, mem_type, MANAGER_SIZE); in ttm_bo_init_reserved_mock_man() 168 place = ttm_place_kunit_init(test, mem_type, 0); in ttm_bo_init_reserved_mock_man() 190 ttm_mock_manager_fini(priv->ttm_dev, mem_type); in ttm_bo_init_reserved_mock_man() 264 KUNIT_EXPECT_EQ(test, bo->resource->mem_type, snd_mem); in ttm_bo_validate_basic() 305 u32 mem_type = TTM_PL_VRAM; in ttm_bo_validate_failed_alloc() local 313 ttm_bad_manager_init(priv->ttm_dev, mem_type, MANAGER_SIZE); in ttm_bo_validate_failed_alloc() 315 place = ttm_place_kunit_init(test, mem_type, 0); in ttm_bo_validate_failed_alloc() 325 ttm_bad_manager_fini(priv->ttm_dev, mem_type); in ttm_bo_validate_failed_alloc() [all …]
|
| H A D | ttm_mock_manager.h | 24 int ttm_mock_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size); 25 int ttm_bad_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size); 26 int ttm_busy_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size); 27 void ttm_mock_manager_fini(struct ttm_device *bdev, u32 mem_type); 28 void ttm_bad_manager_fini(struct ttm_device *bdev, u32 mem_type);
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_drm_client.c | 171 u32 mem_type = bo->ttm.resource->mem_type; in bo_meminfo() local 176 stats[mem_type].shared += sz; in bo_meminfo() 178 stats[mem_type].private += sz; in bo_meminfo() 181 stats[mem_type].resident += sz; in bo_meminfo() 185 stats[mem_type].active += sz; in bo_meminfo() 186 else if (mem_type == XE_PL_SYSTEM) in bo_meminfo() 187 stats[mem_type].purgeable += sz; in bo_meminfo() 202 u32 mem_type; in show_meminfo() local 255 for (mem_type = XE_PL_SYSTEM; mem_type < TTM_NUM_MEM_TYPES; ++mem_type) { in show_meminfo() 256 if (!xe_mem_type_to_name[mem_type]) in show_meminfo() [all …]
|
| H A D | xe_bo_evict.c | 118 u32 mem_type; in xe_bo_evict_all_user() local 122 for (mem_type = XE_PL_TT; mem_type <= XE_PL_VRAM1; ++mem_type) { in xe_bo_evict_all_user() 124 ttm_manager_type(bdev, mem_type); in xe_bo_evict_all_user() 134 if (mem_type == XE_PL_TT && (IS_DGFX(xe) || !xe_device_has_flat_ccs(xe))) in xe_bo_evict_all_user() 300 unsigned int mem_type; in xe_bo_pci_dev_remove_all() local 306 for (mem_type = XE_PL_VRAM1; mem_type >= XE_PL_TT; --mem_type) { in xe_bo_pci_dev_remove_all() 308 ttm_manager_type(&xe->ttm, mem_type); in xe_bo_pci_dev_remove_all()
|
| /linux/drivers/gpu/drm/nouveau/nvkm/falcon/ |
| H A D | base.c | 45 nvkm_falcon_dma(struct nvkm_falcon *falcon, enum nvkm_falcon_mem *mem_type, u32 *mem_base) in nvkm_falcon_dma() argument 47 switch (*mem_type) { in nvkm_falcon_dma() 57 enum nvkm_falcon_mem mem_type, u32 mem_base, int len, bool sec) in nvkm_falcon_dma_wr() argument 59 const struct nvkm_falcon_func_dma *dma = nvkm_falcon_dma(falcon, &mem_type, &mem_base); in nvkm_falcon_dma_wr() 60 const char *type = nvkm_falcon_mem(mem_type); in nvkm_falcon_dma_wr() 69 if (mem_type == DMEM) { in nvkm_falcon_dma_wr() 79 ret = dma->init(falcon, dma_addr, dmalen, mem_type, sec, &cmd); in nvkm_falcon_dma_wr() 121 nvkm_falcon_pio(struct nvkm_falcon *falcon, enum nvkm_falcon_mem *mem_type, u32 *mem_base) in nvkm_falcon_pio() argument 123 switch (*mem_type) { in nvkm_falcon_pio() 140 nvkm_falcon_pio_rd(struct nvkm_falcon *falcon, u8 port, enum nvkm_falcon_mem mem_type, u32 mem_base, in nvkm_falcon_pio_rd() argument [all …]
|
| /linux/drivers/gpu/drm/vmwgfx/ |
| H A D | vmwgfx_ttm_buffer.c | 35 .mem_type = TTM_PL_VRAM, 42 .mem_type = TTM_PL_SYSTEM, 291 vmw_be->mem_type = bo_mem->mem_type; in vmw_ttm_bind() 293 switch (bo_mem->mem_type) { in vmw_ttm_bind() 329 switch (vmw_be->mem_type) { in vmw_ttm_unbind() 442 switch (mem->mem_type) { in vmw_ttm_io_mem_reserve() 491 static bool vmw_memtype_is_system(uint32_t mem_type) in vmw_memtype_is_system() argument 493 return mem_type == TTM_PL_SYSTEM || mem_type == VMW_PL_SYSTEM; in vmw_memtype_is_system() 506 new_man = ttm_manager_type(bo->bdev, new_mem->mem_type); in vmw_move() 508 old_man = ttm_manager_type(bo->bdev, bo->resource->mem_type); in vmw_move() [all …]
|
| /linux/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_ttm.c | 98 .mem_type = TTM_PL_SYSTEM, in amdgpu_evict_flags() 121 switch (bo->resource->mem_type) { in amdgpu_evict_flags() 196 if (WARN_ON(mem->mem_type == AMDGPU_PL_PREEMPT)) in amdgpu_ttm_map_buffer() 201 *addr = amdgpu_ttm_domain_start(adev, mem->mem_type) + in amdgpu_ttm_map_buffer() 251 if (mem->mem_type == TTM_PL_TT) { in amdgpu_ttm_map_buffer() 330 (abo_src->tbo.resource->mem_type == TTM_PL_VRAM)) in amdgpu_ttm_copy_mem_to_mem() 333 (dst->mem->mem_type == TTM_PL_VRAM)) { in amdgpu_ttm_copy_mem_to_mem() 397 if (old_mem->mem_type == TTM_PL_VRAM && in amdgpu_move_blit() 442 if (res->mem_type == TTM_PL_SYSTEM || res->mem_type == TTM_PL_TT || in amdgpu_res_cpu_visible() 443 res->mem_type == AMDGPU_PL_PREEMPT || res->mem_type == AMDGPU_PL_DOORBELL || in amdgpu_res_cpu_visible() [all …]
|
| /linux/arch/mips/loongson64/ |
| H A D | init.c | 51 u32 i, mem_type; in szmem() local 64 mem_type = loongson_memmap->map[i].mem_type; in szmem() 75 switch (mem_type) { in szmem() 80 (u32)node_id, mem_type, &mem_start, &mem_size); in szmem() 90 (u32)node_id, mem_type, &mem_start, &mem_size); in szmem() 97 (u32)node_id, mem_type, &mem_start, &mem_size); in szmem()
|
| /linux/drivers/i2c/busses/ |
| H A D | i2c-amd-mp2.h | 64 enum mem_type { enum 86 enum mem_type mem_type : 1; member 129 enum mem_type mem_type : 1; member
|
| /linux/drivers/gpu/drm/ttm/ |
| H A D | ttm_bo.c | 59 int i, mem_type; in ttm_bo_mem_space_debug() local 62 mem_type = placement->placement[i].mem_type; in ttm_bo_mem_space_debug() 64 i, placement->placement[i].flags, mem_type); in ttm_bo_mem_space_debug() 65 man = ttm_manager_type(bo->bdev, mem_type); in ttm_bo_mem_space_debug() 129 old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; in ttm_bo_handle_move_mem() 130 new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt; in ttm_bo_handle_move_mem() 146 if (mem->mem_type != TTM_PL_SYSTEM) { in ttm_bo_handle_move_mem() 429 if (bo->resource->mem_type == TTM_PL_SYSTEM) in ttm_bo_eviction_valuable() 453 unsigned int mem_type; in ttm_bo_evict_first() local 467 mem_type = res->mem_type; in ttm_bo_evict_first() [all …]
|
| /linux/arch/loongarch/kernel/ |
| H A D | numa.c | 165 u32 mem_type; in info_node_memblock() local 171 mem_type = md->type; in info_node_memblock() 176 switch (mem_type) { in info_node_memblock() 185 (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); in info_node_memblock() 194 (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); in info_node_memblock() 204 mem_type, mem_start, mem_size); in info_node_memblock()
|
| H A D | mem.c | 15 u32 mem_type; in memblock_init() local 21 mem_type = md->type; in memblock_init() 25 switch (mem_type) { in memblock_init()
|
| /linux/drivers/gpu/drm/qxl/ |
| H A D | qxl_object.c | 67 qbo->placements[c].mem_type = TTM_PL_VRAM; in qxl_ttm_placement_from_domain() 71 qbo->placements[c].mem_type = TTM_PL_PRIV; in qxl_ttm_placement_from_domain() 73 qbo->placements[c].mem_type = TTM_PL_VRAM; in qxl_ttm_placement_from_domain() 77 qbo->placements[c].mem_type = TTM_PL_SYSTEM; in qxl_ttm_placement_from_domain() 81 qbo->placements[c].mem_type = TTM_PL_SYSTEM; in qxl_ttm_placement_from_domain() 215 if (bo->tbo.resource->mem_type == TTM_PL_VRAM) in qxl_bo_kmap_atomic_page() 217 else if (bo->tbo.resource->mem_type == TTM_PL_PRIV) in qxl_bo_kmap_atomic_page() 269 if ((bo->tbo.resource->mem_type != TTM_PL_VRAM) && in qxl_bo_kunmap_atomic_page() 270 (bo->tbo.resource->mem_type != TTM_PL_PRIV)) in qxl_bo_kunmap_atomic_page()
|
| /linux/arch/arm/include/asm/mach/ |
| H A D | map.h | 53 struct mem_type; 54 extern const struct mem_type *get_mem_type(unsigned int type); 59 const struct mem_type *mtype);
|