/openbmc/linux/arch/arm/mm/ |
H A D | dma-mapping.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * linux/arch/arm/mm/dma-mapping.c 5 * Copyright (C) 2000-2004 Russell King 17 #include <linux/dma-direct.h> 18 #include <linux/dma-map-ops.h> 28 #include <asm/page.h> 33 #include <asm/dma-iommu.h> 36 #include <asm/xen/xen-ops.h> 43 size_t size; member 53 size_t size; member [all …]
|
/openbmc/linux/kernel/dma/ |
H A D | direct.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 2018-2020 Christoph Hellwig. 10 #include <linux/dma-map-ops.h> 21 * override the variable below for dma-direct to work properly. 33 static inline struct page *dma_direct_to_page(struct device *dev, in dma_direct_to_page() 41 phys_addr_t phys = (phys_addr_t)(max_pfn - 1) << PAGE_SHIFT; in dma_direct_get_required_mask() 44 return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; in dma_direct_get_required_mask() 50 dev->coherent_dma_mask, in dma_direct_optimal_gfp_mask() 51 dev->bus_dma_limit); in dma_direct_optimal_gfp_mask() 69 bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size) in dma_coherent_ok() argument [all …]
|
H A D | ops_helpers.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include <linux/dma-map-ops.h> 8 static struct page *dma_common_vaddr_to_page(void *cpu_addr) in dma_common_vaddr_to_page() 16 * Create scatter-list for the already allocated DMA buffer. 19 void *cpu_addr, dma_addr_t dma_addr, size_t size, in dma_common_get_sgtable() argument 22 struct page *page = dma_common_vaddr_to_page(cpu_addr); in dma_common_get_sgtable() local 27 sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); in dma_common_get_sgtable() 32 * Create userspace mapping for the DMA-coherent memory. 35 void *cpu_addr, dma_addr_t dma_addr, size_t size, in dma_common_mmap() argument 40 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; in dma_common_mmap() [all …]
|
H A D | pool.c | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <linux/dma-map-ops.h> 9 #include <linux/dma-direct.h> 23 /* Size can be defined by the coherent_pool command line */ 46 static void dma_atomic_pool_size_add(gfp_t gfp, size_t size) in dma_atomic_pool_size_add() argument 49 pool_size_dma += size; in dma_atomic_pool_size_add() 51 pool_size_dma32 += size; in dma_atomic_pool_size_add() 53 pool_size_kernel += size; in dma_atomic_pool_size_add() 58 unsigned long size; in cma_in_zone() local 66 size = cma_get_size(cma); in cma_in_zone() [all …]
|
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/ |
H A D | vmm.c | 32 kvfree(pgt->pde); in nvkm_vmm_pt_del() 41 const struct nvkm_vmm_page *page) in nvkm_vmm_pt_new() argument 43 const u32 pten = 1 << desc->bits; in nvkm_vmm_pt_new() 47 if (desc->type > PGT) { in nvkm_vmm_pt_new() 48 if (desc->type == SPT) { in nvkm_vmm_pt_new() 49 const struct nvkm_vmm_desc *pair = page[-1].desc; in nvkm_vmm_pt_new() 50 lpte = pten >> (desc->bits - pair->bits); in nvkm_vmm_pt_new() 58 pgt->page = page ? page->shift : 0; in nvkm_vmm_pt_new() 59 pgt->sparse = sparse; in nvkm_vmm_pt_new() 61 if (desc->type == PGD) { in nvkm_vmm_pt_new() [all …]
|
H A D | uvmm.c | 42 return nvkm_vmm_ref(nvkm_uvmm(object)->vmm); in nvkm_uvmm_search() 51 struct nvkm_vmm *vmm = uvmm->vmm; in nvkm_uvmm_mthd_pfnclr() 52 int ret = -ENOSYS; in nvkm_uvmm_mthd_pfnclr() 53 u64 addr, size; in nvkm_uvmm_mthd_pfnclr() local 55 if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) { in nvkm_uvmm_mthd_pfnclr() 56 addr = args->v0.addr; in nvkm_uvmm_mthd_pfnclr() 57 size = args->v0.size; in nvkm_uvmm_mthd_pfnclr() 61 if (nvkm_vmm_in_managed_range(vmm, addr, size) && vmm->managed.raw) in nvkm_uvmm_mthd_pfnclr() 62 return -EINVAL; in nvkm_uvmm_mthd_pfnclr() 64 if (size) { in nvkm_uvmm_mthd_pfnclr() [all …]
|
/openbmc/linux/arch/arm64/include/asm/ |
H A D | kvm_pgtable.h | 1 // SPDX-License-Identifier: GPL-2.0-only 17 * The largest supported block sizes for KVM (no 52-bit PA support): 18 * - 4K (level 1): 1GB 19 * - 16K (level 2): 32MB 20 * - 64K (level 2): 512MB 45 #define KVM_PHYS_INVALID (-1ULL) 106 static inline bool kvm_is_block_size_supported(u64 size) in kvm_is_block_size_supported() argument 108 bool is_power_of_two = IS_ALIGNED(size, size); in kvm_is_block_size_supported() 110 return is_power_of_two && (size & kvm_supported_block_sizes()); in kvm_is_block_size_supported() 114 * struct kvm_pgtable_mm_ops - Memory management callbacks. [all …]
|
/openbmc/linux/sound/pci/emu10k1/ |
H A D | memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * EMU10K1 memory page allocation (PTB area) 18 /* page arguments of these two macros are Emu page (4096 bytes), not like 21 #define __set_ptb_entry(emu,page,addr) \ argument 22 (((__le32 *)(emu)->ptb_pages.area)[page] = \ 23 cpu_to_le32(((addr) << (emu->address_mode)) | (page))) 24 #define __get_ptb_entry(emu, page) \ argument 25 (le32_to_cpu(((__le32 *)(emu)->ptb_pages.area)[page])) 30 /* get aligned page from offset address */ 32 /* get offset address from aligned page */ [all …]
|
/openbmc/linux/Documentation/admin-guide/mm/ |
H A D | hugetlbpage.rst | 9 the Linux kernel. This support is built on top of multiple page size support 11 support 4K and 2M (1G if architecturally supported) page sizes, ia64 12 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, 13 256M and ppc64 supports 4K and 16M. A TLB is a cache of virtual-to-physical 19 Users can use the huge page support in Linux kernel by either using the mmap 28 persistent hugetlb pages in the kernel's huge page pool. It also displays 29 default huge page size and information about the number of free, reserved 30 and surplus huge pages in the pool of huge pages of default size. 31 The huge page size is needed for generating the proper alignment and 32 size of the arguments to system calls that map huge page regions. [all …]
|
/openbmc/linux/mm/ |
H A D | zsmalloc.c | 10 * Released under the terms of 3-clause BSD License 16 * struct page(s) to form a zspage. 18 * Usage of struct page fields: 19 * page->private: points to zspage 20 * page->index: links together all component pages of a zspage 21 * For the huge page, this is always 0, so we use this field 23 * page->page_type: first object offset in a subpage of zspage 25 * Usage of struct page flags: 26 * PG_private: identifies the first component page 27 * PG_owner_priv_1: identifies the huge component page [all …]
|
H A D | dmapool.c | 1 // SPDX-License-Identifier: GPL-2.0-only 9 * This allocator returns small blocks of a given size which are DMA-able by 10 * the given device. It uses the dma_alloc_coherent page allocator to get 11 * new pages, then splits them up into blocks of the required size. 15 * represented by the 'struct dma_pool' which keeps a doubly-linked list of 16 * allocated pages. Each page in the page_list is split into blocks of at 17 * least 'size' bytes. Free blocks are tracked in an unsorted singly-linked 19 * keep a count of how many are currently allocated from each page. 23 #include <linux/dma-mapping.h> 56 unsigned int size; member [all …]
|
/openbmc/linux/fs/ntfs/ |
H A D | logfile.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * logfile.c - NTFS kernel journal handling. Part of the Linux-NTFS project. 5 * Copyright (c) 2002-2007 Anton Altaparmakov 27 * ntfs_check_restart_page_header - check the page header for consistency 28 * @vi: $LogFile inode to which the restart page header belongs 29 * @rp: restart page header to check 30 * @pos: position in @vi at which the restart page header resides 32 * Check the restart page header @rp for consistency and return 'true' if it is 36 * require the full restart page. 47 * If the system or log page sizes are smaller than the ntfs block size in ntfs_check_restart_page_header() [all …]
|
/openbmc/linux/include/linux/ |
H A D | dma-map-ops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 9 #include <linux/dma-mapping.h> 26 void *(*alloc)(struct device *dev, size_t size, 29 void (*free)(struct device *dev, size_t size, void *vaddr, 31 struct page *(*alloc_pages)(struct device *dev, size_t size, 34 void (*free_pages)(struct device *dev, size_t size, struct page *vaddr, 36 struct sg_table *(*alloc_noncontiguous)(struct device *dev, size_t size, 39 void (*free_noncontiguous)(struct device *dev, size_t size, 45 void *cpu_addr, dma_addr_t dma_addr, size_t size, 48 dma_addr_t (*map_page)(struct device *dev, struct page *page, [all …]
|
/openbmc/linux/arch/powerpc/include/asm/nohash/32/ |
H A D | mmu-8xx.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 10 * During software tablewalk, the registers used perform mask/shift-add 34 * Then we use the APG to say whether accesses are according to Page rules or 39 * 0 => Kernel => 11 (all accesses performed according as user iaw page definition) 40 * 1 => Kernel+Accessed => 01 (all accesses performed according to page definition) 41 * 2 => User => 11 (all accesses performed according as user iaw page definition) 42 * 3 => User+Accessed => 10 (all accesses performed according to swaped page definition) for KUEP 43 * 4-15 => Not Used 47 /* The effective page number register. When read, contains the information 52 #define MI_EPNMASK 0xfffff000 /* Effective page number for entry */ [all …]
|
/openbmc/linux/Documentation/mm/ |
H A D | vmemmap_dedup.rst | 2 .. SPDX-License-Identifier: GPL-2.0 13 The ``struct page`` structures are used to describe a physical page frame. By 14 default, there is a one-to-one mapping from a page frame to its corresponding 15 ``struct page``. 17 HugeTLB pages consist of multiple base page size pages and is supported by many 18 architectures. See Documentation/admin-guide/mm/hugetlbpage.rst for more 19 details. On the x86-64 architecture, HugeTLB pages of size 2MB and 1GB are 20 currently supported. Since the base page size on x86 is 4KB, a 2MB HugeTLB page 21 consists of 512 base pages and a 1GB HugeTLB page consists of 262144 base pages. 22 For each base page, there is a corresponding ``struct page``. [all …]
|
/openbmc/linux/arch/powerpc/mm/ |
H A D | dma-noncoherent.c | 1 // SPDX-License-Identifier: GPL-2.0-only 13 #include <linux/dma-direct.h> 14 #include <linux/dma-map-ops.h> 22 static void __dma_sync(void *vaddr, size_t size, int direction) in __dma_sync() argument 25 unsigned long end = start + size; in __dma_sync() 32 * invalidate only when cache-line aligned otherwise there is in __dma_sync() 35 if ((start | end) & (L1_CACHE_BYTES - 1)) in __dma_sync() 52 * In this case, each page of a buffer must be kmapped/kunmapped 57 * beyond the first page. 59 static inline void __dma_sync_page_highmem(struct page *page, in __dma_sync_page_highmem() argument [all …]
|
/openbmc/qemu/target/xtensa/core-de233_fpu/ |
H A D | core-matmap.h | 2 * xtensa/config/core-matmap.h -- Memory access and translation mapping 10 * information contained in the core-isa.h header file. 19 * XCHAL_ICACHE_SIZE (presence of I-cache) 20 * XCHAL_DCACHE_SIZE (presence of D-cache) 25 /* Copyright (c) 1999-2020 Tensilica Inc. 49 /*---------------------------------------------------------------------- 51 ----------------------------------------------------------------------*/ 55 /* Cache Attribute encodings -- lists of access modes for each cache attribute: */ 117 #define XCHAL_CA_WRITETHRU 11 /* cache enabled (write-through) mode */ 118 #define XCHAL_CA_WRITEBACK 7 /* cache enabled (write-back) mode */ [all …]
|
/openbmc/linux/drivers/vdpa/vdpa_user/ |
H A D | iova_domain.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * MMU-based software IOTLB. 5 * Copyright (C) 2020-2021 Bytedance Inc. and/or its affiliates. All rights reserved. 30 return -ENOMEM; in vduse_iotlb_add_range() 32 map_file->file = get_file(file); in vduse_iotlb_add_range() 33 map_file->offset = offset; in vduse_iotlb_add_range() 35 ret = vhost_iotlb_add_range_ctx(domain->iotlb, start, last, in vduse_iotlb_add_range() 38 fput(map_file->file); in vduse_iotlb_add_range() 51 while ((map = vhost_iotlb_itree_first(domain->iotlb, start, last))) { in vduse_iotlb_del_range() 52 map_file = (struct vdpa_map_file *)map->opaque; in vduse_iotlb_del_range() [all …]
|
/openbmc/linux/drivers/misc/ |
H A D | vmw_balloon.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2000-2018, VMware, Inc. All Rights Reserved. 46 …"Enable non-cooperative out-of-memory protection. Disabled by default as it may degrade performanc… 54 /* Magic number for the balloon mount-point */ 80 #define VMW_BALLOON_2M_ORDER (PMD_SHIFT - PAGE_SHIFT) 83 * 64-bit targets are only supported in 64-bit 118 * enum vmballoon_cmd_type - backdoor commands. 140 * @VMW_BALLOON_CMD_GET_TARGET: Gets the balloon target size. 141 * @VMW_BALLOON_CMD_LOCK: Informs the hypervisor about a ballooned page. 142 * @VMW_BALLOON_CMD_UNLOCK: Informs the hypervisor about a page that is about [all …]
|
/openbmc/linux/fs/hfsplus/ |
H A D | bitmap.c | 1 // SPDX-License-Identifier: GPL-2.0 19 int hfsplus_block_allocate(struct super_block *sb, u32 size, in hfsplus_block_allocate() argument 23 struct page *page; in hfsplus_block_allocate() local 32 return size; in hfsplus_block_allocate() 34 hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); in hfsplus_block_allocate() 35 mutex_lock(&sbi->alloc_mutex); in hfsplus_block_allocate() 36 mapping = sbi->alloc_file->i_mapping; in hfsplus_block_allocate() 37 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL); in hfsplus_block_allocate() 38 if (IS_ERR(page)) { in hfsplus_block_allocate() 39 start = size; in hfsplus_block_allocate() [all …]
|
/openbmc/linux/sound/pci/trident/ |
H A D | trident_memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Trident 4DWave-NX memory page allocation (TLB area) 19 /* page arguments of these two macros are Trident page (4096 bytes), not like 22 #define __set_tlb_bus(trident,page,addr) \ argument 23 (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)) 24 #define __tlb_to_addr(trident,page) \ argument 25 (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1)) 28 /* page size == SNDRV_TRIDENT_PAGE_SIZE */ 29 #define ALIGN_PAGE_SIZE PAGE_SIZE /* minimum page size for allocation */ 31 /* fill TLB entrie(s) corresponding to page with ptr */ [all …]
|
/openbmc/linux/kernel/module/ |
H A D | decompress.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 19 struct page **new_pages; in module_extend_max_pages() 21 new_pages = kvmalloc_array(info->max_pages + extent, in module_extend_max_pages() 22 sizeof(info->pages), GFP_KERNEL); in module_extend_max_pages() 24 return -ENOMEM; in module_extend_max_pages() 26 memcpy(new_pages, info->pages, info->max_pages * sizeof(info->pages)); in module_extend_max_pages() 27 kvfree(info->pages); in module_extend_max_pages() 28 info->pages = new_pages; in module_extend_max_pages() 29 info->max_pages += extent; in module_extend_max_pages() 34 static struct page *module_get_next_page(struct load_info *info) in module_get_next_page() [all …]
|
/openbmc/linux/fs/ecryptfs/ |
H A D | read_write.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 20 * @size: Number of bytes from @data to write at @offset in the lower 28 loff_t offset, size_t size) in ecryptfs_write_lower() argument 33 lower_file = ecryptfs_inode_to_private(ecryptfs_inode)->lower_file; in ecryptfs_write_lower() 35 return -EIO; in ecryptfs_write_lower() 36 rc = kernel_write(lower_file, data, size, &offset); in ecryptfs_write_lower() 44 * @page_for_lower: The page containing the data to be written to the 48 * @size: The amount of data from @page_for_lower to write to the 51 * Determines the byte offset in the file for the given page and 52 * offset within the page, maps the page, and makes the call to write [all …]
|
H A D | mmap.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 8 * Copyright (C) 1997-2003 Erez Zadok 9 * Copyright (C) 2001-2003 Stony Brook University 10 * Copyright (C) 2004-2007 International Business Machines Corp. 16 #include <linux/page-flags.h> 28 * Get one page from cache or lower f/s, return error otherwise. 30 * Returns locked and up-to-date page (if ok), with increased 33 struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index) in ecryptfs_get_locked_page() 35 struct page *page = read_mapping_page(inode->i_mapping, index, NULL); in ecryptfs_get_locked_page() local 36 if (!IS_ERR(page)) in ecryptfs_get_locked_page() [all …]
|
/openbmc/linux/fs/qnx6/ |
H A D | dir.c | 1 // SPDX-License-Identifier: GPL-2.0 9 * 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release. 10 * 16-02-2012 pagemap extension by Al Viro 16 static unsigned qnx6_lfile_checksum(char *name, unsigned size) in qnx6_lfile_checksum() argument 19 char *end = name + size; in qnx6_lfile_checksum() 27 static struct page *qnx6_get_page(struct inode *dir, unsigned long n) in qnx6_get_page() 29 struct address_space *mapping = dir->i_mapping; in qnx6_get_page() 30 struct page *page = read_mapping_page(mapping, n, NULL); in qnx6_get_page() local 31 if (!IS_ERR(page)) in qnx6_get_page() 32 kmap(page); in qnx6_get_page() [all …]
|