Displaying 20 results from an estimated 20 matches for "spg_shift".
Did you mean:
sig_shift
2013 Sep 25
1
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
On Wed, Sep 04, 2013 at 08:59:13AM +0200, Maarten Lankhorst wrote:
>
> When looking into this bug I noticed that nouveau_bo_vma_add needs to have a check for nvbo->page_shift == vma->vm->vmm->spg_shift,
> and only if the check is true it should map the page in TTM_PL_TT. Patch below.
> Should probably also be cc'd to stable.
>
How about this patch? Is it ready to go in?
Thanks,
-- Pasi
> ~Maarten
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...uveau/core/subdev/vm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
@@ -84,10 +84,11 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
{
struct nouveau_vm *vm = vma->vm;
struct nouveau_vmmgr *vmm = vm->vmm;
- int big = vma->node->type != vmm->spg_shift;
+ u32 shift = vma->node->type;
+ int big = shift != vmm->spg_shift;
u32 offset = vma->node->offset + (delta >> 12);
- u32 bits = vma->node->type - 12;
- u32 num = length >> vma->node->type;
+ u32 bits = shift - 12;
+ u32 num = length >> shift;
u32...
2013 Nov 29
2
Fixing nouveau for >4k PAGE_SIZE
...ore/subdev/vm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
@@ -82,55 +82,77 @@ void
nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
struct nouveau_mem *mem)
{
+ /*
+ * XXX Should the "12" in a couple of places here be replaced
+ * with vmm->spg_shift for correctness ? Might help if we ever
+ * support 64k card pages on 64k PAGE_SIZE systems
+ */
struct nouveau_vm *vm = vma->vm;
struct nouveau_vmmgr *vmm = vm->vmm;
- int big = vma->node->type != vmm->spg_shift;
u32 offset = vma->node->offset + (delta >> 12);
-...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...nouveau/core/subdev/vm/base.c
> > @@ -84,10 +84,11 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
> > {
> > struct nouveau_vm *vm = vma->vm;
> > struct nouveau_vmmgr *vmm = vm->vmm;
> > - int big = vma->node->type != vmm->spg_shift;
> > + u32 shift = vma->node->type;
> > + int big = shift != vmm->spg_shift;
> > u32 offset = vma->node->offset + (delta >> 12);
> > - u32 bits = vma->node->type - 12;
> > - u32 num = length >> vma->node->type;
> > + u32...
2012 Nov 21
2
[PATCH] drm/nouveau: fix takedown in move_notify
...head) {
- if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
+ if (new_mem->mem_type == TTM_PL_VRAM) {
nouveau_vm_map(vma, new_mem->mm_node);
- } else
- if (new_mem && new_mem->mem_type == TTM_PL_TT &&
- nvbo->page_shift == vma->vm->vmm->spg_shift) {
+ } else if (new_mem->mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->vmm->spg_shift) {
if (((struct nouveau_mem *)new_mem->mm_node)->sg)
nouveau_vm_map_sg_table(vma, 0, new_mem->
num_pages << PAGE_SHIFT,
@@ -1153,8 +11...
2013 Aug 11
0
Fixing nouveau for >4k PAGE_SIZE
...t; +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
> @@ -84,10 +84,11 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
> {
> struct nouveau_vm *vm = vma->vm;
> struct nouveau_vmmgr *vmm = vm->vmm;
> - int big = vma->node->type != vmm->spg_shift;
> + u32 shift = vma->node->type;
> + int big = shift != vmm->spg_shift;
> u32 offset = vma->node->offset + (delta >> 12);
> - u32 bits = vma->node->type - 12;
> - u32 num = length >> vma->node->type;
> + u32 bits = shift - 12;
> + u32...
2013 Dec 11
0
Fixing nouveau for >4k PAGE_SIZE
...> @@ -82,55 +82,77 @@ void
> nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
> struct nouveau_mem *mem)
> {
> + /*
> + * XXX Should the "12" in a couple of places here be replaced
> + * with vmm->spg_shift for correctness ? Might help if we ever
> + * support 64k card pages on 64k PAGE_SIZE systems
> + */
The only "12"s that were left (yes, i missed some too obviously) were
intended to just be used to represent the smallest allocation unit for
the address space allocator...
2013 Sep 04
4
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
On Thu, Aug 22, 2013 at 5:12 PM, Maarten Lankhorst
<maarten.lankhorst at canonical.com> wrote:
> Op 22-08-13 02:10, Ilia Mirkin schreef:
>> The code expects non-VRAM mem nodes to have a pages list. If that's not
>> set, it will do a null deref down the line. Warn on that condition and
>> return an error.
>>
>> See
2013 Aug 29
0
Fixing nouveau for >4k PAGE_SIZE
...e.c
>> > @@ -84,10 +84,11 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
>> > {
>> > struct nouveau_vm *vm = vma->vm;
>> > struct nouveau_vmmgr *vmm = vm->vmm;
>> > - int big = vma->node->type != vmm->spg_shift;
>> > + u32 shift = vma->node->type;
>> > + int big = shift != vmm->spg_shift;
>> > u32 offset = vma->node->offset + (delta >> 12);
>> > - u32 bits = vma->node->type - 12;
>> > - u32 num = length >> vma->n...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
Op 11-08-13 07:36, Benjamin Herrenschmidt schreef:
> On Sun, 2013-08-11 at 10:41 +1000, Benjamin Herrenschmidt wrote:
>> Now, to do that, I need a better understanding of the various things
>> in there since I'm not familiar with nouveau at all. What I think I've
>> figured out is with a few questions, it would be awesome if you could
>> answer them so I can have
2013 Sep 04
0
[PATCH] drm/nouveau: avoid null deref on bad arguments to nouveau_vma_getmap
...gt;
If it has a WARN_ON or something that would be ok, I didn't find any other places that attempt to move buffers to VRAM though, so it's probably harmless.
When looking into this bug I noticed that nouveau_bo_vma_add needs to have a check for nvbo->page_shift == vma->vm->vmm->spg_shift,
and only if the check is true it should map the page in TTM_PL_TT. Patch below.
Should probably also be cc'd to stable.
~Maarten
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 89b992e..355a1b7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+...
2015 Apr 16
2
[PATCH 6/6] mmu: gk20a: implement IOMMU mapping for big pages
...> + struct nvkm_vm *vm = vma->vm;
> + struct nvkm_mmu *mmu = vm->mmu;
> + struct nvkm_mm_node *node;
> + struct nouveau_platform_device *plat;
> + struct gk20a_mmu_iommu_mapping *p;
> + int npages = 1 << (mmu->lpg_shift - mmu->spg_shift);
> + int i, ret;
> + u64 addr;
> +
> + plat = nv_device_to_platform(nv_device(&mmu->base));
> +
> + *priv = kzalloc(sizeof(struct gk20a_mmu_iommu_mapping), GFP_KERNEL);
> + if (!*priv)
> + return;
> +
> + mutex_...
2013 Aug 11
2
Fixing nouveau for >4k PAGE_SIZE
...l, hopefully)
Now, to do that, I need a better understanding of the various things
in there since I'm not familiar with nouveau at all. What I think I've
figured out is with a few questions, it would be awesome if you could
answer them so I can have a shot at fixing it all :-)
- There is spg_shift and lpg_shift in the backend vmm. My understanding
is those correspond to the supported small and large page shift respectively
in the card's MMU, correct ? On nv41 they are both 12.
- vma->node->type indicates the desired page shift for a given vma
object we are trying to map. It may o...
2015 Apr 16
15
[PATCH 0/6] map big page by platform IOMMU
Hi,
Generally the the imported buffers which has memory type TTM_PL_TT are
mapped as small pages probably due to lack of big page allocation. But the
platform device which also use memory type TTM_PL_TT, like GK20A, can
*allocate* big page though the IOMMU hardware inside the SoC. This is a try
to map the imported buffers as big pages in GMMU by the platform IOMMU. With
some preparation work to
2014 Jul 16
1
Questions about the Nouveau VM subsystem
...5 ). Following some older threads
about this code (http://marc.info/?l=dri-devel&m=137618326022935 ) also
left me kind of puzzled, and I wonder if we could not simplify and
improve things there.
It seems like arbitrary constant values for page_shifts (usually 12) are
used where the vmm->spg_shift value should be used instead, and some
other members are used out of place. Here are a few questions to start:
- What is nouveau_mem::page_shift exactly used for? It is set here and
there but never really used, and usually the value it is set to does not
seem to bother how the memory is allocat...
2013 Oct 10
0
[PATCH] drm/nouveau: do not map evicted bo's in nouveau_bo_vma_add
...ouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
- else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->vmm->spg_shift) {
if (node->sg)
nouveau_vm_map_sg_table(vma, 0, size, node);
else
2013 Nov 12
0
[PATCH 5/7] drm/nouveau: do not map evicted vram buffers in nouveau_bo_vma_add
...ouveau_bo *nvbo, struct nouveau_vm *vm,
if (nvbo->bo.mem.mem_type == TTM_PL_VRAM)
nouveau_vm_map(vma, nvbo->bo.mem.mm_node);
- else if (nvbo->bo.mem.mem_type == TTM_PL_TT) {
+ else if (nvbo->bo.mem.mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->vmm->spg_shift) {
if (node->sg)
nouveau_vm_map_sg_table(vma, 0, size, node);
else
--
1.8.4
2013 Sep 02
0
[PATCH] drm/nv50-: fix tiled memory layout checks
...;
list_for_each_entry(vma, &nvbo->vma_list, head) {
- if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
+ if (!new_mem ||
+ old_mem->mem_type == TTM_PL_VRAM ||
+ (old_mem->mem_type == TTM_PL_TT &&
+ nvbo->page_shift == vma->vm->vmm->spg_shift))
+ nouveau_vm_unmap(vma);
+
+ if (!new_mem)
+ continue;
+
+ if (new_mem->mem_type == TTM_PL_VRAM) {
nouveau_vm_map(vma, new_mem->mm_node);
} else
if (new_mem && new_mem->mem_type == TTM_PL_TT &&
@@ -1185,8 +1193,6 @@ nouveau_bo_move_ntfy(struct ttm_buffe...
2013 Jul 29
0
[PATCH] drm/nouveau: protect vm refcount with mutex
...struct nouveau_vmmgr *vmm = vm->vmm;
- u32 fpde, lpde;
+ u32 fpde, lpde, ref;
if (unlikely(vma->node == NULL))
return;
@@ -363,9 +365,12 @@ nouveau_vm_put(struct nouveau_vma *vma)
mutex_lock(&nv_subdev(vmm)->mutex);
nouveau_vm_unmap_pgt(vm, vma->node->type != vmm->spg_shift, fpde, lpde);
nouveau_mm_free(&vm->mm, &vma->node);
- mutex_unlock(&nv_subdev(vmm)->mutex);
- nouveau_vm_ref(NULL, &vma->vm, NULL);
+ vma->vm = NULL;
+ ref = --vm->refcount;
+ mutex_unlock(&nv_subdev(vmm)->mutex);
+ if (!ref)
+ nouveau_vm_del(vm);
}...
2013 Nov 12
6
[PATCH 1/7] drm/nouveau: fix m2mf copy to tiled gart
From: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Commit de7b7d59d54852c introduced tiled GART, but a linear copy is
still performed. This may result in errors on eviction, fix it by
checking tiling from memtype.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Cc: stable at vger.kernel.org #3.10+
---
drivers/gpu/drm/nouveau/nouveau_bo.c | 33