/kernel/linux/linux-5.10/drivers/infiniband/core/ |
D | umem_odp.c | 61 size_t page_size = 1UL << umem_odp->page_shift; in ib_init_umem_odp() 75 ndmas = (end - start) >> umem_odp->page_shift; in ib_init_umem_odp() 136 umem_odp->page_shift = PAGE_SHIFT; in ib_umem_odp_alloc_implicit() 184 odp_data->page_shift = PAGE_SHIFT; in ib_umem_odp_alloc_child() 247 umem_odp->page_shift = PAGE_SHIFT; in ib_umem_odp_get() 250 umem_odp->page_shift = HPAGE_SHIFT; in ib_umem_odp_get() 321 *dma_addr = ib_dma_map_page(dev, page, 0, 1 << umem_odp->page_shift, in ib_umem_odp_map_dma_single_page() 359 unsigned int page_shift, hmm_order, pfn_start_idx; in ib_umem_odp_map_dma_and_lock() local 371 page_shift = umem_odp->page_shift; in ib_umem_odp_map_dma_and_lock() 385 range.start = ALIGN_DOWN(user_virt, 1UL << page_shift); in ib_umem_odp_map_dma_and_lock() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/aarch64/ |
D | processor.c | 26 unsigned int shift = (vm->pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift; in pgd_index() 34 unsigned int shift = 2 * (vm->page_shift - 3) + vm->page_shift; in pud_index() 35 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pud_index() 45 unsigned int shift = (vm->page_shift - 3) + vm->page_shift; in pmd_index() 46 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pmd_index() 56 uint64_t mask = (1UL << (vm->page_shift - 3)) - 1; in pte_index() 57 return (gva >> vm->page_shift) & mask; in pte_index() 62 uint64_t mask = ((1UL << (vm->va_bits - vm->page_shift)) - 1) << vm->page_shift; in pte_addr() 68 unsigned int shift = (vm->pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift; in ptrs_per_pgd() 74 return 1 << (vm->page_shift - 3); in ptrs_per_pte() [all …]
|
/kernel/linux/linux-5.10/drivers/pci/endpoint/ |
D | pci-epc-mem.c | 26 unsigned int page_shift = ilog2(mem->window.page_size); in pci_epc_mem_get_order() local 29 size >>= page_shift; in pci_epc_mem_get_order() 53 unsigned int page_shift; in pci_epc_multi_mem_init() local 73 page_shift = ilog2(page_size); in pci_epc_multi_mem_init() 74 pages = windows[i].size >> page_shift; in pci_epc_multi_mem_init() 173 unsigned int page_shift; in pci_epc_mem_alloc_addr() local 188 page_shift = ilog2(mem->window.page_size); in pci_epc_mem_alloc_addr() 190 ((phys_addr_t)pageno << page_shift); in pci_epc_mem_alloc_addr() 238 unsigned int page_shift; in pci_epc_mem_free_addr() local 250 page_shift = ilog2(page_size); in pci_epc_mem_free_addr() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/mm/ |
D | bad_accesses.c | 69 unsigned long i, j, addr, region_shift, page_shift, page_size; in test() local 84 page_shift = 16; in test() 86 page_shift = 12; in test() 103 (1 << page_shift) >> 10, in test() 121 for (j = page_shift - 1; j < 60; j++) { in test() 130 addr = (base | delta) & ~((1 << page_shift) - 1); in test()
|
/kernel/linux/linux-5.10/arch/powerpc/include/asm/ |
D | ultravisor.h | 50 u64 page_shift) in uv_page_in() argument 53 page_shift); in uv_page_in() 57 u64 page_shift) in uv_page_out() argument 60 page_shift); in uv_page_out() 75 static inline int uv_page_inval(u64 lpid, u64 gpa, u64 page_shift) in uv_page_inval() argument 77 return ucall_norets(UV_PAGE_INVAL, lpid, gpa, page_shift); in uv_page_inval()
|
D | kvm_book3s_uvmem.h | 15 unsigned long page_shift); 19 unsigned long page_shift); 54 unsigned long flags, unsigned long page_shift) in kvmppc_h_svm_page_in() argument 61 unsigned long flags, unsigned long page_shift) in kvmppc_h_svm_page_out() argument
|
D | iommu.h | 164 __u32 page_shift, 169 __u32 page_shift, 296 extern int iommu_tce_check_ioba(unsigned long page_shift, 299 extern int iommu_tce_check_gpa(unsigned long page_shift,
|
/kernel/linux/linux-5.10/arch/powerpc/kvm/ |
D | book3s_hv_uvmem.c | 508 unsigned long end, unsigned long page_shift, in __kvmppc_svm_page_out() argument 529 if (!kvmppc_gfn_is_uvmem_pfn(gpa >> page_shift, kvm, NULL)) in __kvmppc_svm_page_out() 561 ret = uv_page_out(kvm->arch.lpid, pfn << page_shift, in __kvmppc_svm_page_out() 562 gpa, 0, page_shift); in __kvmppc_svm_page_out() 581 unsigned long page_shift, in kvmppc_svm_page_out() argument 588 ret = __kvmppc_svm_page_out(vma, start, end, page_shift, kvm, gpa, in kvmppc_svm_page_out() 737 unsigned long page_shift, in kvmppc_svm_page_in() argument 774 ret = uv_page_in(kvm->arch.lpid, pfn << page_shift, in kvmppc_svm_page_in() 775 gpa, 0, page_shift); in kvmppc_svm_page_in() 872 unsigned long page_shift) in kvmppc_share_page() argument [all …]
|
D | book3s_64_vio.c | 135 if ((tbltmp->it_page_shift <= stt->page_shift) && in kvm_spapr_tce_attach_iommu_group() 137 stt->offset << stt->page_shift) && in kvm_spapr_tce_attach_iommu_group() 139 stt->size << stt->page_shift)) { in kvm_spapr_tce_attach_iommu_group() 288 if (!args->size || args->page_shift < 12 || args->page_shift > 34 || in kvm_vm_ioctl_create_spapr_tce() 289 (args->offset + args->size > (ULLONG_MAX >> args->page_shift))) in kvm_vm_ioctl_create_spapr_tce() 304 stt->page_shift = args->page_shift; in kvm_vm_ioctl_create_spapr_tce() 371 if (iommu_tce_check_gpa(stt->page_shift, gpa)) in kvmppc_tce_validate() 428 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_clear_tce() 429 unsigned long io_entry = entry << (stt->page_shift - tbl->it_page_shift); in kvmppc_clear_tce() 486 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_tce_iommu_unmap() [all …]
|
D | book3s_64_vio_hv.c | 113 if (iommu_tce_check_gpa(stt->page_shift, gpa)) in kvmppc_rm_tce_validate() 209 idx = (ioba >> stt->page_shift) - stt->offset; in kvmppc_rm_ioba_validate() 254 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_clear_tce() 255 unsigned long io_entry = entry << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_clear_tce() 316 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_unmap() 378 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_map() 427 entry = ioba >> stt->page_shift; in kvmppc_rm_h_put_tce() 517 entry = ioba >> stt->page_shift; in kvmppc_rm_h_put_tce_indirect() 629 unsigned long entry = ioba >> stt->page_shift; in kvmppc_rm_h_stuff_tce() 646 for (i = 0; i < npages; ++i, ioba += (1ULL << stt->page_shift)) in kvmppc_rm_h_stuff_tce() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
D | hmm-tests.c | 56 unsigned int page_shift; in FIXTURE() local 64 unsigned int page_shift; in FIXTURE() local 83 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() 92 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() 230 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F() 232 size = npages << self->page_shift; in TEST_F() 293 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F() 295 size = npages << self->page_shift; in TEST_F() 352 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F() 354 size = npages << self->page_shift; in TEST_F() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/ |
D | kvm_util.c | 149 unsigned int page_shift; member 202 vm->page_shift = vm_guest_mode_params[mode].page_shift; in vm_create() 257 0, (1ULL << (vm->va_bits - 1)) >> vm->page_shift); in vm_create() 259 (~((1ULL << (vm->va_bits - 1)) - 1)) >> vm->page_shift, in vm_create() 260 (1ULL << (vm->va_bits - 1)) >> vm->page_shift); in vm_create() 263 vm->max_gfn = ((1ULL << vm->pa_bits) >> vm->page_shift) - 1; in vm_create() 555 if ((ptr1 >> vm->page_shift) != ((ptr1 + amt) >> vm->page_shift)) in kvm_memcmp_hva_gva() 557 if ((ptr2 >> vm->page_shift) != ((ptr2 + amt) >> vm->page_shift)) in kvm_memcmp_hva_gva() 560 assert((ptr1 >> vm->page_shift) == ((ptr1 + amt - 1) >> vm->page_shift)); in kvm_memcmp_hva_gva() 561 assert((ptr2 >> vm->page_shift) == ((ptr2 + amt - 1) >> vm->page_shift)); in kvm_memcmp_hva_gva() [all …]
|
/kernel/linux/linux-5.10/drivers/infiniband/hw/hns/ |
D | hns_roce_alloc.c | 176 dma_free_coherent(dev, 1 << buf->page_shift, in hns_roce_buf_free() 185 struct hns_roce_buf *buf, u32 page_shift) in hns_roce_buf_alloc() argument 193 buf->page_shift = max_t(int, HNS_HW_PAGE_SHIFT, page_shift); in hns_roce_buf_alloc() 195 page_size = 1 << buf->page_shift; in hns_roce_buf_alloc() 257 unsigned int page_shift) in hns_roce_get_umem_bufs() argument 264 if (page_shift < HNS_HW_PAGE_SHIFT) { in hns_roce_get_umem_bufs() 266 page_shift); in hns_roce_get_umem_bufs() 271 rdma_umem_for_each_dma_block(umem, &biter, 1 << page_shift) { in hns_roce_get_umem_bufs()
|
D | hns_roce_mr.c | 122 buf_attr.page_shift = is_fast ? PAGE_SHIFT : in alloc_mr_pbl() 698 unsigned int page_shift) in mtr_kmem_direct_size() argument 701 return ALIGN(alloc_size, 1 << page_shift); in mtr_kmem_direct_size() 703 return HNS_HW_DIRECT_PAGE_COUNT << page_shift; in mtr_kmem_direct_size() 711 unsigned int page_shift) in mtr_check_direct_pages() argument 713 size_t page_size = 1 << page_shift; in mtr_check_direct_pages() 769 pgsz_bitmap = 1 << buf_attr->page_shift; in mtr_alloc_bufs() 771 pgsz_bitmap = GENMASK(buf_attr->page_shift, PAGE_SHIFT); in mtr_alloc_bufs() 788 buf_attr->page_shift); in mtr_alloc_bufs() 790 mtr->kmem, buf_attr->page_shift); in mtr_alloc_bufs() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/ |
D | alloc.c | 81 buf->page_shift = (u8)get_order(size) + PAGE_SHIFT; in mlx5_buf_alloc_node() 94 while (t & ((1 << buf->page_shift) - 1)) { in mlx5_buf_alloc_node() 95 --buf->page_shift; in mlx5_buf_alloc_node() 128 buf->page_shift = PAGE_SHIFT; in mlx5_frag_buf_alloc_node() 142 if (frag->map & ((1 << buf->page_shift) - 1)) { in mlx5_frag_buf_alloc_node() 146 &frag->map, buf->page_shift); in mlx5_frag_buf_alloc_node() 295 addr = buf->frags->map + (i << buf->page_shift); in mlx5_fill_page_array()
|
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/x86_64/ |
D | vmx.c | 410 TEST_ASSERT((nested_paddr >> vm->page_shift) <= vm->max_gfn, in nested_pg_map() 418 TEST_ASSERT((paddr >> vm->page_shift) <= vm->max_gfn, in nested_pg_map() 433 >> vm->page_shift; in nested_pg_map() 445 >> vm->page_shift; in nested_pg_map() 457 >> vm->page_shift; in nested_pg_map() 466 pte[index[0]].address = paddr >> vm->page_shift; in nested_pg_map() 523 i = (region->region.guest_phys_addr >> vm->page_shift) - 1; in nested_map_memslot() 524 last = i + (region->region.memory_size >> vm->page_shift); in nested_map_memslot() 531 (uint64_t)i << vm->page_shift, in nested_map_memslot() 532 (uint64_t)i << vm->page_shift, in nested_map_memslot() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx4/ |
D | mr.c | 194 int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, in mlx4_mtt_init() argument 201 mtt->page_shift = MLX4_ICM_PAGE_SHIFT; in mlx4_mtt_init() 204 mtt->page_shift = page_shift; in mlx4_mtt_init() 419 int page_shift, struct mlx4_mr *mr) in mlx4_mr_alloc_reserved() argument 428 return mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_alloc_reserved() 528 int npages, int page_shift, struct mlx4_mr *mr) in mlx4_mr_alloc() argument 538 access, npages, page_shift, mr); in mlx4_mr_alloc() 591 int page_shift, struct mlx4_mpt_entry *mpt_entry) in mlx4_mr_rereg_mem_write() argument 595 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_rereg_mem_write() 601 mpt_entry->entity_size = cpu_to_be32(page_shift); in mlx4_mr_rereg_mem_write() [all …]
|
/kernel/linux/linux-5.10/drivers/infiniband/hw/mlx5/ |
D | mem.c | 118 int page_shift, size_t offset, size_t num_pages, in __mlx5_ib_populate_pas() argument 121 int shift = page_shift - PAGE_SHIFT; in __mlx5_ib_populate_pas() 169 int page_shift, __be64 *pas, int access_flags) in mlx5_ib_populate_pas() argument 171 return __mlx5_ib_populate_pas(dev, umem, page_shift, 0, in mlx5_ib_populate_pas() 175 int mlx5_ib_get_buf_offset(u64 addr, int page_shift, u32 *offset) in mlx5_ib_get_buf_offset() argument 183 page_size = (u64)1 << page_shift; in mlx5_ib_get_buf_offset()
|
D | mr.c | 857 static int get_octo_len(u64 addr, u64 len, int page_shift) in get_octo_len() argument 859 u64 page_size = 1ULL << page_shift; in get_octo_len() 864 npages = ALIGN(len + offset, page_size) >> page_shift; in get_octo_len() 877 int *page_shift, int *ncont, int *order) in mr_umem_get() argument 896 *page_shift = odp->page_shift; in mr_umem_get() 898 *npages = *ncont << (*page_shift - PAGE_SHIFT); in mr_umem_get() 909 page_shift, ncont, order); in mr_umem_get() 921 *npages, *ncont, *order, *page_shift); in mr_umem_get() 984 u64 len, int npages, int page_shift, unsigned int order, in alloc_mr_from_cache() argument 1021 int page_shift, int flags) in mlx5_ib_update_xlt() argument [all …]
|
D | srq.c | 55 int page_shift; in create_srq_user() local 91 &page_shift, &ncont, NULL); in create_srq_user() 92 err = mlx5_ib_get_buf_offset(ucmd.buf_addr, page_shift, in create_srq_user() 105 mlx5_ib_populate_pas(dev, srq->umem, page_shift, in->pas, 0); in create_srq_user() 113 in->log_page_size = page_shift - MLX5_ADAPTER_PAGE_SHIFT; in create_srq_user() 164 mlx5_ib_dbg(dev, "srq->buf.page_shift = %d\n", srq->buf.page_shift); in create_srq_kernel() 179 in->log_page_size = srq->buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT; in create_srq_kernel()
|
D | cq.c | 711 int page_shift; in create_cq_user() local 749 mlx5_ib_cont_pages(cq->buf.umem, ucmd.buf_addr, 0, &npages, &page_shift, in create_cq_user() 752 ucmd.buf_addr, entries * ucmd.cqe_size, npages, page_shift, ncont); in create_cq_user() 763 mlx5_ib_populate_pas(dev, cq->buf.umem, page_shift, pas, 0); in create_cq_user() 767 page_shift - MLX5_ADAPTER_PAGE_SHIFT); in create_cq_user() 890 cq->buf.frag_buf.page_shift - in create_cq_kernel() 1129 int *page_shift, int *cqe_size) in resize_user() argument 1155 mlx5_ib_cont_pages(umem, ucmd.buf_addr, 0, &npages, page_shift, in resize_user() 1250 int page_shift; in mlx5_ib_resize_cq() local 1277 err = resize_user(dev, cq, entries, udata, &npas, &page_shift, in mlx5_ib_resize_cq() [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
D | pci-ioda-tce.c | 50 u64 dma_offset, unsigned int page_shift) in pnv_pci_setup_iommu_table() argument 54 tbl->it_page_shift = page_shift; in pnv_pci_setup_iommu_table() 292 __u32 page_shift, __u64 window_size, __u32 levels, in pnv_pci_ioda2_table_alloc_pages() argument 299 unsigned int entries_shift = window_shift - page_shift; in pnv_pci_ioda2_table_alloc_pages() 315 if ((level_shift - 3) * levels + page_shift >= 55) in pnv_pci_ioda2_table_alloc_pages() 349 page_shift); in pnv_pci_ioda2_table_alloc_pages()
|
/kernel/linux/linux-5.10/drivers/mtd/nand/raw/ |
D | nand_bbt.c | 180 from = ((loff_t)page) << this->page_shift; in read_bbt() 396 scan_read(this, buf, (loff_t)td->pages[0] << this->page_shift, in read_abs_bbts() 405 scan_read(this, buf, (loff_t)md->pages[0] << this->page_shift, in read_abs_bbts() 532 int blocktopage = this->bbt_erase_shift - this->page_shift; in search_bbt() 634 (this->bbt_erase_shift - this->page_shift); in get_bbt_block() 662 page = block << (this->bbt_erase_shift - this->page_shift); in get_bbt_block() 765 page = block << (this->bbt_erase_shift - this->page_shift); in write_bbt() 786 to = ((loff_t)page) << this->page_shift; in write_bbt() 802 ops.ooblen = (len >> this->page_shift) * mtd->oobsize; in write_bbt() 809 pageoffs = page - (int)(to >> this->page_shift); in write_bbt() [all …]
|
/kernel/linux/linux-5.10/include/rdma/ |
D | ib_umem_odp.h | 44 unsigned int page_shift; member 67 umem_odp->page_shift; in ib_umem_odp_num_pages()
|
/kernel/linux/linux-5.10/drivers/infiniband/sw/rdmavt/ |
D | mr.c | 409 mr->mr.page_shift = PAGE_SHIFT; in rvt_reg_user_mr() 601 u32 ps = 1 << mr->mr.page_shift; in rvt_set_page() 602 u32 mapped_segs = mr->mr.length >> mr->mr.page_shift; in rvt_set_page() 636 mr->mr.page_shift = PAGE_SHIFT; in rvt_map_mr_sg() 813 if (mr->page_shift) { in rvt_lkey_ok() 821 entries_spanned_by_off = off >> mr->page_shift; in rvt_lkey_ok() 822 off -= (entries_spanned_by_off << mr->page_shift); in rvt_lkey_ok() 920 if (mr->page_shift) { in rvt_rkey_ok() 928 entries_spanned_by_off = off >> mr->page_shift; in rvt_rkey_ok() 929 off -= (entries_spanned_by_off << mr->page_shift); in rvt_rkey_ok()
|