search for: pgprot_decrypt

Displaying 20 results from an estimated 21 matches for "pgprot_decrypt".

Did you mean: pgprot_decrypted
2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
...virtio_gpu_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) +{ + pgprot_t prot; + int ret; + + ret = drm_gem_shmem_mmap(obj, vma); + if (ret < 0) + return ret; + + /* virtio-gpu needs normal caching, so clear writecombine */ + prot = vm_get_page_prot(vma->vm_flags); + prot = pgprot_decrypted(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .get_sg_table =...
2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
...virtio_gpu_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) +{ + pgprot_t prot; + int ret; + + ret = drm_gem_shmem_mmap(obj, vma); + if (ret < 0) + return ret; + + /* virtio-gpu needs normal caching, so clear writecombine */ + prot = vm_get_page_prot(vma->vm_flags); + prot = pgprot_decrypted(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .get_sg_table =...
2024 Jan 22
2
[PATCH] mm: Remove double faults once write a device pfn
...h/x86/entry/vdso/vma.c > @@ -185,7 +185,8 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm, > if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK)) { > return vmf_insert_pfn_prot(vma, vmf->address, > __pa(pvti) >> PAGE_SHIFT, > - pgprot_decrypted(vma->vm_page_prot)); > + pgprot_decrypted(vma->vm_page_prot), > + true); > } > } else if (sym_offset == image->sym_hvclock_page) { > pfn = hv_get_tsc_pfn(); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem...
2024 Jan 24
1
[PATCH] mm: Remove double faults once write a device pfn
...CK)) >> >>>> { >> >>>>> return vmf_insert_pfn_prot(vma, vmf->address, >> >>>>> __pa(pvti) >> PAGE_SHIFT, >> >>>>> - pgprot_decrypted(vma- >> >>>>> vm_page_prot)); >> >>>>> + pgprot_decrypted(vma- >> >>>>> vm_page_prot), >> >>>>> + true); >> >>>>>...
2024 Jan 23
2
[PATCH] mm: Remove double faults once write a device pfn
...if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK)) >> { >>> return vmf_insert_pfn_prot(vma, vmf->address, >>> __pa(pvti) >> PAGE_SHIFT, >>> - pgprot_decrypted(vma- >>> vm_page_prot)); >>> + pgprot_decrypted(vma- >>> vm_page_prot), >>> + true); >>> } >>> } else if (sym_offset == image->sym_hvclock_page) { >&gt...
2024 Jan 24
2
[PATCH] mm: Remove double faults once write a device pfn
...vclock_was_used(VDSO_CLOCKMODE_PVCLOCK)) >>>> { >>>>> return vmf_insert_pfn_prot(vma, vmf->address, >>>>> __pa(pvti) >> PAGE_SHIFT, >>>>> - pgprot_decrypted(vma- >>>>> vm_page_prot)); >>>>> + pgprot_decrypted(vma- >>>>> vm_page_prot), >>>>> + true); >>>>> } >>>>> } else if (s...
2019 Dec 10
0
[PATCH] drm/virtio: fix mmap page attributes
...vm_area_struct *vma) > +{ > + pgprot_t prot; > + int ret; > + > + ret = drm_gem_shmem_mmap(obj, vma); > + if (ret < 0) > + return ret; > + > + /* virtio-gpu needs normal caching, so clear writecombine */ > + prot = vm_get_page_prot(vma->vm_flags); > + prot = pgprot_decrypted(prot); > + vma->vm_page_prot = prot; > + return 0; > +} There's similar code in udl, [1] which still uses writecombine for imported buffers. Virtio does not need this? Aside from this, do you think we could handle all special cases within shmem? Best regards Thomas [1] https:/...
2019 Sep 17
0
[PATCH v2 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...- /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index acb07fe06580..deca0c30...
2019 Sep 19
0
[PATCH v3 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...- /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index acb07fe06580..deca0c30...
2019 Oct 16
0
[PATCH v4 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
...- /* VM_PFNMAP was set by drm_gem_mmap() */ - vma->vm_flags &= ~VM_PFNMAP; - vma->vm_flags |= VM_MIXEDMAP; + vma->vm_flags |= VM_IO | VM_MIXEDMAP | VM_DONTEXPAND | VM_DONTDUMP; + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); + vma->vm_ops = &drm_gem_shmem_vm_ops; /* Remove the fake offset */ vma->vm_pgoff -= drm_vma_node_start(&shmem->base.vma_node); diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index acb07fe06580..deca0c30...
2020 Sep 01
0
[PATCH 3/3] drm/ttm: remove io_reserve_lru handling v2
..._reserved(struct vm_fault *vmf, }; ttm = bo->ttm; - if (ttm_tt_populate(bo->ttm, &ctx)) { - ret = VM_FAULT_OOM; - goto out_io_unlock; - } + if (ttm_tt_populate(bo->ttm, &ctx)) + return VM_FAULT_OOM; } else { /* Iomem should not be marked encrypted */ prot = pgprot_decrypted(prot); } /* We don't prefault on huge faults. Yet. */ - if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && fault_page_size != 1) { - ret = ttm_bo_vm_insert_huge(vmf, bo, page_offset, - fault_page_size, prot); - goto out_io_unlock; - } + if (IS_ENABLED(CONFIG_TRANSPARENT_HU...
2019 Nov 20
2
Move io_reserve_lru handling into the driver
Just a gentle ping on this. Already got the Acked-by from Daniel, but I need some of the nouveau guys to test this since I can only compile test it. Regards, Christian.
2020 Sep 15
0
[PATCH 15/18] dma-mapping: add a new dma_alloc_pages API
..., diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index e71abcec8d3913..6f86c925b8251d 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -330,9 +330,7 @@ pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs) { if (force_dma_unencrypted(dev)) prot = pgprot_decrypted(prot); - if (dev_is_dma_coherent(dev) || - (IS_ENABLED(CONFIG_DMA_NONCOHERENT_CACHE_SYNC) && - (attrs & DMA_ATTR_NON_CONSISTENT))) + if (dev_is_dma_coherent(dev)) return prot; #ifdef CONFIG_ARCH_HAS_DMA_WRITE_COMBINE if (attrs & DMA_ATTR_WRITE_COMBINE) @@ -46...
2020 Sep 01
4
[PATCH 1/3] drm/ttm: make sure that we always zero init mem.bus v2
We are trying to remove the io_lru handling and depend on zero init base, offset and addr here. v2: init addr as well Signed-off-by: Christian K?nig <christian.koenig at amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e3931e515906..772c640a6046 100644 ---
2020 Aug 19
0
[PATCH 19/28] dma-mapping: replace DMA_ATTR_NON_CONSISTENT with dma_{alloc, free}_pages
..., diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 848c95c27d79ff..dacdb7226caacd 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -330,9 +330,7 @@ pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs) { if (force_dma_unencrypted(dev)) prot = pgprot_decrypted(prot); - if (dev_is_dma_coherent(dev) || - (IS_ENABLED(CONFIG_DMA_NONCOHERENT_CACHE_SYNC) && - (attrs & DMA_ATTR_NON_CONSISTENT))) + if (dev_is_dma_coherent(dev)) return prot; #ifdef CONFIG_ARCH_HAS_DMA_WRITE_COMBINE if (attrs & DMA_ATTR_WRITE_COMBINE) @@ -46...
2019 Sep 30
3
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver
While working on TTM cleanups I've found that the io_reserve_lru used by Nouveau is actually not working at all. In general we should remove driver specific handling from the memory management, so this patch moves the io_reserve_lru handling into Nouveau instead. The patch should be functional correct, but is only compile tested! Signed-off-by: Christian König <christian.koenig at
2020 Aug 21
5
Moving LRU handling into Nouveau v3
Hi guys, so I got some hardware and tested this and after hammering out tons of typos it now seems to work fine. Could you give it more testing? Thanks in advance, Christian
2020 Jan 24
4
TTM/Nouveau cleanups
Hi guys, I've already send this out in September last year, but only got a response from Daniel. Could you guys please test this and tell me what you think about it? Basically I'm trying to remove all driver specific features from TTM which don't need to be inside the framework. Thanks, Christian.
2020 Sep 14
20
a saner API for allocating DMA addressable pages v2
Hi all, this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs with a separate new dma_alloc_pages API, which is available on all platforms. In addition to cleaning up the convoluted code path, this ensures that other drivers that have asked for better support for non-coherent DMA to pages with incurring bounce buffering over can finally be properly supported. I'm still a
2020 Sep 15
32
a saner API for allocating DMA addressable pages v3
Hi all, this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs with a separate new dma_alloc_pages API, which is available on all platforms. In addition to cleaning up the convoluted code path, this ensures that other drivers that have asked for better support for non-coherent DMA to pages with incurring bounce buffering over can finally be properly supported. As a follow up I