search for: phys_addr

Displaying 20 results from an estimated 191 matches for "phys_addr".

2010 Aug 05
0
[GIT PULL] x86/mm for 2.6.36
...600, NULL, NULL, diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 12e4d2d..3ba6e06 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -62,8 +62,8 @@ int ioremap_change_attr(unsigned long vaddr, unsigned long size, static void __iomem *__ioremap_caller(resource_size_t phys_addr, unsigned long size, unsigned long prot_val, void *caller) { - unsigned long pfn, offset, vaddr; - resource_size_t last_addr; + unsigned long offset, vaddr; + resource_size_t pfn, last_pfn, last_addr; const resource_size_t unaligned_phys_addr = phys_addr; const unsigned long unaligned_size...
2018 Jul 30
1
[RFC 1/4] virtio: Define virtio_direct_dma_ops structure
...dma_addr) > +{ > + return 0; > +} Including this one. > +void *virtio_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, > + gfp_t gfp, unsigned long attrs) > +{ > + void *queue = alloc_pages_exact(PAGE_ALIGN(size), gfp); > + > + if (queue) { > + phys_addr_t phys_addr = virt_to_phys(queue); > + *dma_handle = (dma_addr_t)phys_addr; > + > + if (WARN_ON_ONCE(*dma_handle != phys_addr)) { > + free_pages_exact(queue, PAGE_ALIGN(size)); > + return NULL; > + } > + } > + return queue; queue is a very odd name in a generic memor...
2012 Jul 23
2
[PATCH V2] qemu-xen-traditionnal, Fix dirty logging during migration.
...dm/exec-dm.c | 6 +----- qemu-xen.h | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hw/xen_machine_fv.c b/hw/xen_machine_fv.c index fdad42a..2bb44e0 100644 --- a/hw/xen_machine_fv.c +++ b/hw/xen_machine_fv.c @@ -174,7 +174,8 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, uint8_t lock) return last_address_vaddr + address_offset; } -void qemu_invalidate_entry(uint8_t *buffer) +void qemu_invalidate_entry(uint8_t *buffer, target_phys_addr_t access_len, + int was_written) { struct map_cache *entry = NULL, *pentry = NU...
2013 Mar 13
16
frequently ballooning results in qemu exit
We created a 64bit SLES11 SP1 guest, and then used a script to change memory (using mem-set command) periodically (in 1 second): set 1G, set 2G, set 1G, set 2G, and so on. After a few minutes, we encountered QEMU exit due to SIGBUS error. Below is the call trace captured by gdb: The call trace: Program received signal SIGBUS, Bus error. 0x00007f94f74773d7 in memcpy () from /lib64/libc.so.6 (gdb)
2009 Jan 30
0
[PATCH 2/2] amd-iommu: drop locks before printing error messages
...lags); + amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn); return -EFAULT; } @@ -533,9 +533,9 @@ int amd_iommu_reserve_domain_unity_map( if ( iommu_l2e == 0 ) { - amd_iov_error( - "Invalid IO pagetable entry phys_addr = %lx\n", phys_addr); spin_unlock_irqrestore(&hd->mapping_lock, flags); + amd_iov_error("Invalid IO pagetable entry phys_addr = %lx\n", + phys_addr); return -EFAULT; } @@ -582,8 +582,8 @@ int amd_iommu_sy...
2010 Aug 06
5
[PATCH] GSoC 2010 - Memory hotplug support for Xen guests - second fully working version - once again
...amp; defined(CONFIG_XEN_BALLOON) - if (xen_domain()) - balloon_update_stats(-PAGES_PER_SECTION); -#endif break; default: WARN(1, KERN_WARNING "%s(%p, %ld) unknown action: %ld\n", @@ -357,13 +341,6 @@ memory_probe_store(struct class *class, struct class_attribute *attr, phys_addr = simple_strtoull(buf, NULL, 0); -#ifdef CONFIG_XEN_MEMORY_HOTPLUG - if (xen_domain()) { - ret = xen_memory_probe(phys_addr); - return ret ? ret : count; - } -#endif - nid = memory_add_physaddr_to_nid(phys_addr); ret = add_memory(nid, phys_addr, PAGES_PER_SECTION << PAGE_SHIFT); dif...
2020 Jul 17
0
[PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
...of type 'struct device **' 668 | static inline int dev_to_node(struct device *dev) | ~~~~~~~~~~~~~~~^~~ >> drivers/virtio/virtio_ring.c:284:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 284 | phys_addr_t phys_addr = virt_to_phys(queue); | ^~~~~~~~~~~ cc1: some warnings being treated as errors vim +/dev_to_node +280 drivers/virtio/virtio_ring.c 271 272 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, 273 dma_addr_t *dma_handle, gfp_t flag)...
2007 May 09
3
[patch 8/9] lguest: the block driver
...linux/interrupt.h> +#include <linux/lguest_bus.h> + +static char next_block_index = 'a'; + +struct blockdev +{ + spinlock_t lock; + + /* The disk structure for the kernel. */ + struct gendisk *disk; + + /* The major number for this disk. */ + int major; + int irq; + + unsigned long phys_addr; + /* The ioremap'ed block page. */ + struct lguest_block_page *lb_page; + + /* We only have a single request outstanding at a time. */ + struct lguest_dma dma; + struct request *req; +}; + +/* Jens gave me this nice helper to end all chunks of a request. */ +static void end_entire_request(stru...
2007 May 09
3
[patch 8/9] lguest: the block driver
...linux/interrupt.h> +#include <linux/lguest_bus.h> + +static char next_block_index = 'a'; + +struct blockdev +{ + spinlock_t lock; + + /* The disk structure for the kernel. */ + struct gendisk *disk; + + /* The major number for this disk. */ + int major; + int irq; + + unsigned long phys_addr; + /* The ioremap'ed block page. */ + struct lguest_block_page *lb_page; + + /* We only have a single request outstanding at a time. */ + struct lguest_dma dma; + struct request *req; +}; + +/* Jens gave me this nice helper to end all chunks of a request. */ +static void end_entire_request(stru...
2020 Nov 03
0
[patch V3 20/37] io-mapping: Cleanup atomic iomap
...m *)__kmap_local_pfn_prot(pfn, prot); } -EXPORT_SYMBOL_GPL(iomap_atomic_pfn_prot); +EXPORT_SYMBOL_GPL(__iomap_local_pfn_prot); --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h @@ -69,13 +69,17 @@ io_mapping_map_atomic_wc(struct io_mappi BUG_ON(offset >= mapping->size); phys_addr = mapping->base + offset; - return iomap_atomic_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); + preempt_disable(); + pagefault_disable(); + return __iomap_local_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); } static inline void io_mapping_unmap_atomic(void __iomem *vaddr) { - iounmap...
2018 Jul 20
0
[RFC 1/4] virtio: Define virtio_direct_dma_ops structure
...} + +int virtio_direct_mapping_error(struct device *hwdev, dma_addr_t dma_addr) +{ + return 0; +} + +void *virtio_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, + gfp_t gfp, unsigned long attrs) +{ + void *queue = alloc_pages_exact(PAGE_ALIGN(size), gfp); + + if (queue) { + phys_addr_t phys_addr = virt_to_phys(queue); + *dma_handle = (dma_addr_t)phys_addr; + + if (WARN_ON_ONCE(*dma_handle != phys_addr)) { + free_pages_exact(queue, PAGE_ALIGN(size)); + return NULL; + } + } + return queue; +} + +void virtio_direct_free(struct device *dev, size_t size, void *vaddr, + dma_a...
2020 Aug 19
0
[PATCH v3 04/18] virtio: Implement get_shm_region for PCI transport
...res_length; + + return pos; + } + return 0; +} + +static bool vp_get_shm_region(struct virtio_device *vdev, + struct virtio_shm_region *region, u8 id) +{ + struct virtio_pci_device *vp_dev = to_vp_device(vdev); + struct pci_dev *pci_dev = vp_dev->pci_dev; + u8 bar; + u64 offset, len; + phys_addr_t phys_addr; + size_t bar_len; + + if (!virtio_pci_find_shm_cap(pci_dev, id, &bar, &offset, &len)) + return false; + + phys_addr = pci_resource_start(pci_dev, bar); + bar_len = pci_resource_len(pci_dev, bar); + + if ((offset + len) < offset) { + dev_err(&pci_dev->dev, "...
2019 Dec 21
0
[PATCH 2/8] iommu/vt-d: Use default dma_direct_* mapping functions for direct mapped devices
...in_for_dev(struct device *dev) return domain; } -/* Check if the dev needs to go through non-identity map and unmap process.*/ -static bool iommu_no_mapping(struct device *dev) -{ - return iommu_dummy(dev) || identity_mapping(dev); -} - static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir, u64 dma_mask) { @@ -3531,9 +3514,6 @@ static dma_addr_t intel_map_page(struct device *dev, struct page *page, enum dma_data_direction dir, unsigned long attrs) { - if (iommu_no_mapping(dev)) - return dma_direct_map_page(dev, page, offset, size...
2020 Jul 17
0
[PATCH] virtio_ring: use alloc_pages_node for NUMA-aware allocation
...ument to parameter 'dev' here static inline int dev_to_node(struct device *dev) ^ >> drivers/virtio/virtio_ring.c:284:16: warning: ISO C90 forbids mixing declarations and code [-Wdeclaration-after-statement] phys_addr_t phys_addr = virt_to_phys(queue); ^ 21 warnings and 1 error generated. vim +280 drivers/virtio/virtio_ring.c 271 272 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, 273 dma_addr_t *dma_handle, gfp_t flag) 274...
2006 Dec 01
1
[PATCH 2/10] Add support for netfront/netback acceleration drivers
...2.6-xen-sparse/arch/i386/mm/ioremap-xen.c --- a/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c Fri Dec 01 16:21:46 2006 +0000 +++ b/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c Fri Dec 01 16:22:40 2006 +0000 @@ -249,7 +249,9 @@ void __iomem * __ioremap(unsigned long p return NULL; area->phys_addr = phys_addr; addr = (void __iomem *) area->addr; - flags |= _KERNPG_TABLE; + /* This doesn''t mean the page will always be readonly - caller + could have passed in _PAGE_RW in flags */ + flags |= _KERNPG_TABLE_READONLY; if (__direct_remap_pfn_range(&init_mm, (uns...
2018 May 11
0
[patch] swiotlb: fix ignored DMA_ATTR_NO_WARN request
...ingle+0x29b/0x2d0: swiotlb buffer is full (sz: 2097152 bytes) Signed-off-by: Mike Galbraith <efault at gmx.de> --- lib/swiotlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -714,7 +714,7 @@ swiotlb_alloc_buffer(struct device *dev, phys_addr = swiotlb_tbl_map_single(dev, __phys_to_dma(dev, io_tlb_start), - 0, size, DMA_FROM_DEVICE, 0); + 0, size, DMA_FROM_DEVICE, attrs); if (phys_addr == SWIOTLB_MAP_ERROR) goto out_warn;
2020 Jul 21
0
[PATCH v2] virtio_ring: use alloc_pages_node for NUMA-aware allocation
...void *queue = alloc_pages_exact(PAGE_ALIGN(size), flag); > - > - if (queue) { > + void *queue = NULL; > + struct page *page = alloc_pages_node(dev_to_node(vdev->dev.parent), > + flag, get_order(size)); > + if (page) { > + queue = page_address(page); > phys_addr_t phys_addr = virt_to_phys(queue); > *dma_handle = (dma_addr_t)phys_addr; > > @@ -308,7 +310,7 @@ static void vring_free_queue(struct virtio_device *vdev, size_t size, > if (vring_use_dma_api(vdev)) > dma_free_coherent(vdev->dev.parent, size, queue, dma_handle); >...
2016 Jun 02
0
[RFC v3 44/45] dma-mapping: Remove dma_get_attr
...} - if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) { + if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) == 0) { dma_common_free_remap(cpu_addr, size, VM_ARM_DMA_CONSISTENT | VM_USERMAP); } @@ -1653,8 +1653,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, phys_addr_t phys = page_to_phys(sg_page(s)); unsigned int len = PAGE_ALIGN(s->offset + s->length); - if (!is_coherent && - !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs)) + if (!is_coherent && (attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0) __dma_page_cpu_to_dev(sg_page(s), s->...
2017 Apr 07
0
[RFC 2/3] virtio-iommu: device probing and operations
...devices have been successfully detached from an address space, its ID can be reused by the driver for another address space. NOENT: device not found. INVAL: device wasn't attached to any address space. 3. Map region ------------- struct virtio_iommu_req_map { le32 address_space; le64 phys_addr; le64 virt_addr; le64 size; le32 flags; }; VIRTIO_IOMMU_MAP_F_READ 0x1 VIRTIO_IOMMU_MAP_F_WRITE 0x2 VIRTIO_IOMMU_MAP_F_EXEC 0x4 Map a range of virtually-contiguous addresses to a range of physically-contiguous addresses. Size must always be a multiple of the page granularity negotiated durin...
2018 May 11
2
kernel spew from nouveau/ swiotlb
On Thu, 2018-05-10 at 12:28 +0200, Mike Galbraith wrote: > On Thu, 2018-05-10 at 11:10 +0200, Mike Galbraith wrote: > > Greetings, > > > > When box is earning its keep, nouveau/swiotlb grumble.. a LOT. The > > below is from master.today. > > > > [12594.640959] nouveau 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes) > > [12594.693000] nouveau