search for: nouveau_ttm_init

Displaying 20 results from an estimated 44 matches for "nouveau_ttm_init".

2023 May 18
1
[PATCH 3/4] drm/nouveau: stop using is_swiotlb_active
...s/gpu/drm/nouveau/nouveau_ttm.c @@ -24,9 +24,9 @@ */ #include <linux/limits.h> -#include <linux/swiotlb.h> #include <drm/ttm/ttm_range_manager.h> +#include <drm/drm_cache.h> #include "nouveau_drv.h" #include "nouveau_gem.h" @@ -265,7 +265,6 @@ nouveau_ttm_init(struct nouveau_drm *drm) struct nvkm_pci *pci = device->pci; struct nvif_mmu *mmu = &drm->client.mmu; struct drm_device *dev = drm->dev; - bool need_swiotlb = false; int typei, ret; ret = nouveau_ttm_init_host(drm, 0); @@ -300,13 +299,10 @@ nouveau_ttm_init(struct nouveau_d...
2020 Nov 10
3
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
The value of struct drm_device.ttm.type_vram can become -1 for unknown types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds error when accessing struct nvif_mmu.type[]: [ 18.304116] ================================================================== [ 18.311649] BUG: KASAN: slab-out-of-bounds in nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau] [ 18.320415] Read of size 1 at...
2016 Feb 25
0
[PATCH v2] instmem/gk20a: set DMA mask early
DMA mask is typically set in nouveau_ttm_init(), but this function is called late during initialization and GK20A's instmem will have called DMA functions before this happens. Having a wrongly set DMA mask can result in the use of unneeded bounce buffers. Set it early to avoid this. Signed-off-by: Alexandre Courbot <acourbot at nvidia...
2013 Jun 17
1
[PATCH] drm/nouveau: remove limit on gart
...ttm_mem_type_manager *man, struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_mem *node; - if (unlikely((mem->num_pages << PAGE_SHIFT) >= 512 * 1024 * 1024)) - return -ENOMEM; - node = kzalloc(sizeof(*node), GFP_KERNEL); if (!node) return -ENOMEM; @@ -406,8 +403,6 @@ nouveau_ttm_init(struct nouveau_drm *drm) /* GART init */ if (drm->agp.stat != ENABLED) { drm->gem.gart_available = nouveau_vmmgr(drm->device)->limit; - if (drm->gem.gart_available > 512 * 1024 * 1024) - drm->gem.gart_available = 512 * 1024 * 1024; } else { drm->gem.gart_avail...
2020 Nov 11
2
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
...spice- >> devel at lists.freedesktop.org; amd-gfx at lists.freedesktop.org >> Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when deferencing >> MMU type >> >> The value of struct drm_device.ttm.type_vram can become -1 for unknown >> types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds >> error when accessing struct nvif_mmu.type[]: > > Would this make more sense to just set the type_vram = 0 instead of -1? >From what I understand, these indices refer to an internal type of MMU, rsp the MMU's capabilities. However, my hardwa...
2015 Sep 04
4
[PATCH 0/4] tegra: DMA mask and IOMMU bit fixes
These 4 patches fix two issues that existed on Tegra regarding DMA: 1) The bit indicating whether to use an IOMMU or not was hardcoded ; make this a platform property and use it in instmem 2) The DMA mask was not set for platform devices. Fix this by converting more pci_dma* to the DMA API, and use that more generic code to set the DMA mask properly for all platforms. Tested on both x86
2014 Jun 27
3
[PATCH v3 0/2] drm: nouveau: memory coherency for ARM
v2 was doing some pretty nasty things with the DMA API, so I took a different approach for this v3. As suggested, this version uses ttm_dma_populate() to populate BOs. The reason for doing this was that it would entitle us to using the DMA sync functions, but since the memory returned is already coherent anyway, we do not even need to call these functions anymore. So this series has turned into
2020 Nov 10
0
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
...t lists.linux-foundation.org; spice- >devel at lists.freedesktop.org; amd-gfx at lists.freedesktop.org >Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when deferencing >MMU type > >The value of struct drm_device.ttm.type_vram can become -1 for unknown >types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds >error when accessing struct nvif_mmu.type[]: Would this make more sense to just set the type_vram = 0 instead of -1? Mike > > [ 18.304116] >=========================================================== >======= > [ 18.311649] BUG: KASAN:...
2020 Nov 12
2
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
...ts.freedesktop.org > >>> Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when > >deferencing > >>> MMU type > >>> > >>> The value of struct drm_device.ttm.type_vram can become -1 for > >unknown > >>> types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds > >>> error when accessing struct nvif_mmu.type[]: > >> > >> Would this make more sense to just set the type_vram = 0 instead of -1? > > > >From what I understand, these indices refer to an internal type of MMU, > >r...
2023 May 18
4
unexport swiotlb_active
Hi all, this little series removes the last swiotlb API exposed to modules. Diffstat: arch/x86/include/asm/xen/swiotlb-xen.h | 6 ------ arch/x86/kernel/pci-dma.c | 28 ++++------------------------ drivers/gpu/drm/nouveau/nouveau_ttm.c | 10 +++------- drivers/pci/xen-pcifront.c | 6 ------ kernel/dma/swiotlb.c | 1 - 5 files changed, 7
2020 Nov 11
0
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
...sts.freedesktop.org; amd-gfx at lists.freedesktop.org >>> Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when >deferencing >>> MMU type >>> >>> The value of struct drm_device.ttm.type_vram can become -1 for >unknown >>> types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds >>> error when accessing struct nvif_mmu.type[]: >> >> Would this make more sense to just set the type_vram = 0 instead of -1? > >From what I understand, these indices refer to an internal type of MMU, >rsp the MMU's capabilities....
2020 Nov 12
0
[PATCH] drm/nouveau: Fix out-of-bounds access when deferencing MMU type
...>>> Subject: [PATCH] drm/nouveau: Fix out-of-bounds access when >> >deferencing >> >>> MMU type >> >>> >> >>> The value of struct drm_device.ttm.type_vram can become -1 for >> >unknown >> >>> types of memory (see nouveau_ttm_init()). This leads to an out-of- >bounds >> >>> error when accessing struct nvif_mmu.type[]: >> >> >> >> Would this make more sense to just set the type_vram = 0 instead of -1? >> > >> >From what I understand, these indices refer to an interna...
2016 Feb 24
0
[PATCH] instmem/gk20a: set DMA mask early
DMA mask is typically set in nouveau_ttm_init(), but this function is called late during initialization and GK20A's instmem will have called DMA functions before this happens. Having a wrongly set DMA mask can result in the use of unneeded bounce buffers. Set it in GK20A's instmem constructor to avoid this. Signed-off-by: Alexandre C...
2018 Mar 10
0
[RFC PATCH 13/13] drm/nouveau: HACK FOR HMM AREA
...ap(filp, vma); + /* Hack for HMM */ + if (vma->vm_pgoff < (DRM_FILE_PAGE_OFFSET + (4UL << 30))) { + struct nouveau_cli *cli = file_priv->driver_priv; + + return nouveau_vmm_hmm(cli, filp, vma); + } + return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); } @@ -305,7 +312,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) drm->ttm.bo_global_ref.ref.object, &nouveau_bo_driver, dev->anon_inode->i_mapping, - DRM_FILE_PAGE_OFFSET, + DRM_FILE_PAGE_OFFSET + (4UL << 30), drm->client.mmu.dmabits <= 32 ? true : false); if (ret) { NV_...
2019 Sep 05
0
[PATCH 2/8] drm/nouveau: switch to gem vma offset manager
...ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index e67eb10843d1..77a0c6ad3cef 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -236,7 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret = ttm_bo_device_init(&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, - NULL, + dev->vma_offset_manager, drm->client.mmu.dmabits <= 32 ? true : false); if (ret) { NV_ERROR(drm, "error ini...
2020 Jan 19
0
[PATCH -next] drm/ttm: remove unnecessary conversion to bool
...u/nouveau_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 7ca0a24..0cbcbe1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -233,7 +233,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) &nouveau_bo_driver, dev->anon_inode->i_mapping, dev->vma_offset_manager, - drm->client.mmu.dmabits <= 32 ? true : false); + drm->client.mmu.dmabits <= 32); if (ret) { NV_ERROR(drm, "error initialising bo driv...
2024 Jan 30
0
GT216M [GeForce GT 240M] (NV50/Tesla) sddm fails to start since commit 0a2f6372a43ff5e948b8b10be34d4473f6c2ef6c
...tried various kernel (both vanilla or gentoo-patched), with custom or distro configuration; I didn't observe any difference since 6.5. I didn't check what the return value of drm_need_swiotlb() is when sddm starts fine; but +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -302,7 +302,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ??????? ret = ttm_device_init(&drm->ttm.bdev, &nouveau_bo_driver, drm->dev-> dev, ????????????????????????????????? dev->anon_inode->i_mapping, ????????????????????????????????? dev->vma_offset_manager, -???????????????????????????????? drm_need_sw...
2018 Mar 01
0
UBSAN warning in nouveau_bios.c:1528:8
...x67/0x90 [ 8.015509] ? dev_printk_emit+0x49/0x70 [ 8.015632] parse_dcb_entry+0x91e/0xd90 [nouveau] [ 8.015712] ? parse_bit_M_tbl_entry+0x150/0x150 [nouveau] [ 8.015791] olddcb_outp_foreach+0x66/0xa0 [nouveau] [ 8.015870] nouveau_bios_init+0x23a/0x2250 [nouveau] [ 8.015950] ? nouveau_ttm_init+0x3a4/0x710 [nouveau] [ 8.016029] nouveau_drm_load+0x229/0xf10 [nouveau] [ 8.016033] ? sysfs_do_create_link_sd+0xa6/0x170 [ 8.016067] drm_dev_register+0x1b7/0x330 [drm] [ 8.016070] ? pci_enable_device_flags+0x160/0x1f0 [ 8.016091] drm_get_pci_dev+0xee/0x2e0 [drm] [ 8.016172]...
2014 Feb 01
0
[RFC 02/16] drm/nouveau: basic support for platform devices
...nv_device_base(device), &dev_attr_pstate); return 0; } diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index d45d50d..9574f87 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -354,21 +354,26 @@ int nouveau_ttm_init(struct nouveau_drm *drm) { struct drm_device *dev = drm->dev; + struct nouveau_device *device = nv_device(drm->device); u32 bits; int ret; bits = nouveau_vmmgr(drm->device)->dma_bits; - if ( drm->agp.stat == ENABLED || - !pci_dma_supported(dev->pdev, DMA_BIT_MASK(bi...
2019 Sep 05
1
[PATCH 1/8] drm/ttm: turn ttm_bo_device.vma_manager into a pointer
..._mapping, + NULL, true); if (ret) return ret; diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index f0daf958e03a..e67eb10843d1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -236,6 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret = ttm_bo_device_init(&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, + NULL, drm->client.mmu.dmabits <= 32 ? true : false); if (ret) { NV_ERROR(drm, "error initialising bo driver, %d\n", re...