From nobody Thu Sep 11 19:21:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 964BBC001DB for ; Mon, 7 Aug 2023 16:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbjHGQeE (ORCPT ); Mon, 7 Aug 2023 12:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbjHGQeB (ORCPT ); Mon, 7 Aug 2023 12:34:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFDD2100 for ; Mon, 7 Aug 2023 09:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IfDXzRQJmq7hjHOSakYboiQj+aP0Hf7JLmie7OP7ZJg=; b=VLI6BQEx0OXepYt0oWzQjZdQ8YEkjQOhYkh5J70+wVWTFcGKihg1ffn97KZZFNT7gN1mN7 XEe8WrrGsCd5CAu6HJ1MZ/pvFFiq9MnW99WyroOjoKlzNO69UgvjSpIY9PqycADW06kBe0 eu9j5N/Ucm5jPRP0Zg0I6DB4if1BK6Q= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-503-uPTPvyvAPdW71RYkHaqDHw-1; Mon, 07 Aug 2023 12:32:47 -0400 X-MC-Unique: uPTPvyvAPdW71RYkHaqDHw-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-99bcfdaaa52so320321066b.0 for ; Mon, 07 Aug 2023 09:32:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425966; x=1692030766; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IfDXzRQJmq7hjHOSakYboiQj+aP0Hf7JLmie7OP7ZJg=; b=e/KLjfstPItSxElT/fmQhC5Sli0GpAC+V81jxQrzglt6dFwfQPWArOuLbXutMJHbXP tCNzNMVPc9QWKwnyUGVpJOPu4FKzX4n94h4ptKPUKk69T4Tj1eg8IZt4jiv8lKj7xlEO ytyaeKabM49lFJ0JgK54+5jBNaJtJzBW6t96vcFCyr0V305I9lCVJwvTDYHjBWgIIm7Q v8Vmmug78iC0WR2//iuZXvTMWBgd2uuUrawTkdTxwZPNkP1DbpMTFYPEhW8x9lgYt/0c ORiAi7uhCMVaqaXyW0OYOjMs1nHMyYKf2InI8u1I4UuJL+7S6s4BsposILUp+T1QVMt2 iKtw== X-Gm-Message-State: AOJu0Ywk0kTXQGobR+Hz5ktk9aO3J5+bVgAcl5yLFdcO9TwrlgYWibvN 1lKQfCjyecVlaHBZ4co+v/53PBHoPIA3sTLJvEcggdghKfn79IOfWdZMn2QUAWyZSrr4lPBoego cRLzo6+DnfMx2HTr9MkPEgErx X-Received: by 2002:a17:906:31c1:b0:99b:c0f0:77fe with SMTP id f1-20020a17090631c100b0099bc0f077femr8075279ejf.69.1691425966377; Mon, 07 Aug 2023 09:32:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdZuNVePss2xGOu78Sr/qq+zLojadIk9YBj7opOTUz4DKdRdl9uzjpJuWytvQBggwWEfgpTg== X-Received: by 2002:a17:906:31c1:b0:99b:c0f0:77fe with SMTP id f1-20020a17090631c100b0099bc0f077femr8075269ejf.69.1691425966094; Mon, 07 Aug 2023 09:32:46 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id o17-20020a17090608d100b00988dbbd1f7esm5397484eje.213.2023.08.07.09.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 09:32:45 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com, kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich , kernel test robot Subject: [PATCH drm-misc-next 1/5] nouveau/dmem: fix copy-paste error in nouveau_dmem_migrate_chunk() Date: Mon, 7 Aug 2023 18:32:22 +0200 Message-ID: <20230807163238.2091-2-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807163238.2091-1-dakr@redhat.com> References: <20230807163238.2091-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix call to nouveau_fence_emit() with wrong channel parameter. Fixes: 7f2a0b50b2b2 ("drm/nouveau: fence: separate fence alloc and emit") Reported-by: kernel test robot Reported-by: Stephen Rothwell Reviewed-by: Karol Herbst Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouve= au/nouveau_dmem.c index 4ad40e42cae1..61e84562094a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -678,7 +678,7 @@ static void nouveau_dmem_migrate_chunk(struct nouveau_d= rm *drm, } =20 if (!nouveau_fence_new(&fence)) - nouveau_fence_emit(fence, chunk->drm->dmem->migrate.chan); + nouveau_fence_emit(fence, drm->dmem->migrate.chan); migrate_vma_pages(args); nouveau_dmem_fence_done(&fence); nouveau_pfns_map(svmm, args->vma->vm_mm, args->start, pfns, i); --=20 2.41.0 From nobody Thu Sep 11 19:21:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A217C001DB for ; Mon, 7 Aug 2023 16:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbjHGQeK (ORCPT ); Mon, 7 Aug 2023 12:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbjHGQeB (ORCPT ); Mon, 7 Aug 2023 12:34:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D8251FCC for ; Mon, 7 Aug 2023 09:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FSJyklWcOYLh1Y7SYk3LyH530BHSBws8fX+6+9YjAp4=; b=igZuQeFqf5k5ijkDO6jpmgVZYxEegmCdOr8j6dMigsLxETSDUrlP3ubmDPwxUqJFFSoMSY mU7JQqUO7HGlXBHYjKuXqJE/f4/0pgdmfmULJAVpTVat3KC3Dp6c9rOJIweGcWzaHs0gR0 R8GkRa8iLW5x/G64VnkXALCSvgrY6mA= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-iA2jRbI6N9yeRXxyAE1Otw-1; Mon, 07 Aug 2023 12:32:52 -0400 X-MC-Unique: iA2jRbI6N9yeRXxyAE1Otw-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4fe2631f5a6so4479056e87.0 for ; Mon, 07 Aug 2023 09:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425971; x=1692030771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FSJyklWcOYLh1Y7SYk3LyH530BHSBws8fX+6+9YjAp4=; b=UwhqhTb0VBOHDfdZx0LtTwicKENFRlzniWWr2u8mTM4weUMT9+rI+vtflPyNu42qMO oTim800UAIKSiPLZ9EWXIHGzXyq55wGQn967X5mDSXCppwRrWToQ+93W8dLDUtyftOg1 LJyDEc6TsbgAalNtU1rUhK8D0Zycpr4fsHmQEPJ7E/RspPPKCyRF2Nfz8aHYtw8KKt6r i9xoOBpzjJB/t5WPBI6Quv0eG3Kxt5+/xNQabMQhOL8n0RbS71eKcva/8AFCOSLLnwoW 0hou7t+yMSJHguHqr523gfWN5nvgIchJSw3ENbRavajK5EVALErderP5Kvv454n/1nsQ UhXw== X-Gm-Message-State: AOJu0Yx2hgVVhT8LsZT5E3YQaXLefRe4hMqxNKQBpFOzIvsQdnaG42QR vzL/I7ZqQxw5Hz9vCd4N2sfA9CkK1U/lE4F0zHPgHl1QJjjAUDfYcXkUv7WHH5Gtldn5rhlWCit mSCi+9tLra6yu1tD+pviNhy5j X-Received: by 2002:a05:6512:280c:b0:4fb:744e:17db with SMTP id cf12-20020a056512280c00b004fb744e17dbmr7711102lfb.1.1691425971024; Mon, 07 Aug 2023 09:32:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFTmw8BlSLd66bLQQphUvYc14k91eYxq6U+Y6ebxxfanOvKoolnZuNuEXZTLdCuMfe0V95eA== X-Received: by 2002:a05:6512:280c:b0:4fb:744e:17db with SMTP id cf12-20020a056512280c00b004fb744e17dbmr7711084lfb.1.1691425970741; Mon, 07 Aug 2023 09:32:50 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id e26-20020a50ec9a000000b0051873c201a0sm5377862edr.26.2023.08.07.09.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 09:32:50 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com, kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich , kernel test robot Subject: [PATCH drm-misc-next 2/5] drm/nouveau: nvkm: vmm: silence warning from cast Date: Mon, 7 Aug 2023 18:32:23 +0200 Message-ID: <20230807163238.2091-3-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807163238.2091-1-dakr@redhat.com> References: <20230807163238.2091-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Cast the integer to a pointer-sized type first to keep the compiler happy. Fixes: 6b252cf42281 ("drm/nouveau: nvkm/vmm: implement raw ops to manage uv= mm") Reported-by: kernel test robot Reported-by: Stephen Rothwell Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie --- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/d= rm/nouveau/nvkm/subdev/mmu/uvmm.c index 38b7ced934b1..46cbd4cedb78 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c @@ -399,6 +399,8 @@ nvkm_uvmm_mthd_raw_map(struct nvkm_uvmm *uvmm, struct n= vif_vmm_raw_v0 *args) .no_comp =3D true, }; struct nvkm_memory *memory; + void *argv =3D (void *)(uintptr_t)args->argv; + int argc =3D args->argc; u64 handle =3D args->memory; u8 refd; int ret; @@ -418,8 +420,7 @@ nvkm_uvmm_mthd_raw_map(struct nvkm_uvmm *uvmm, struct n= vif_vmm_raw_v0 *args) return PTR_ERR(memory); } =20 - ret =3D nvkm_memory_map(memory, args->offset, vmm, &vma, - (void *)args->argv, args->argc); + ret =3D nvkm_memory_map(memory, args->offset, vmm, &vma, argv, argc); =20 nvkm_memory_unref(&vma.memory); nvkm_memory_unref(&memory); --=20 2.41.0 From nobody Thu Sep 11 19:21:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB540C00528 for ; Mon, 7 Aug 2023 16:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231355AbjHGQeQ (ORCPT ); Mon, 7 Aug 2023 12:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjHGQeC (ORCPT ); Mon, 7 Aug 2023 12:34:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11B901BDF for ; Mon, 7 Aug 2023 09:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=piPAJWb0pb900GeCYfzlLDbns7cOjvHHVSLvNcNzuY4=; b=fGO5AfZbERvGfkD2FJid6dTDUWJVPHGhFlvQ1H2KHaegw70LrWgzJrtcyfZJXjLvqq0WKi 5UXEJnza4biKYJk7EK4YB4iNxExYabqOPXqjVgIOZgeAIpQ7barf/LrlfRdNH0cwD7blFJ WIOMzTM3w4L3RC3wMDos5myQavis17g= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389-wRzHF3_zN-y-wncBUy5D9w-1; Mon, 07 Aug 2023 12:32:56 -0400 X-MC-Unique: wRzHF3_zN-y-wncBUy5D9w-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-99bfe3dd009so756789866b.0 for ; Mon, 07 Aug 2023 09:32:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425974; x=1692030774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=piPAJWb0pb900GeCYfzlLDbns7cOjvHHVSLvNcNzuY4=; b=diuYd2g9duZRzcy6NSWc6Zkfh+Z7yy+R1/4qYQ93NXjYAWw0WzbglV/DmfcCAp6XSZ EOLb7BBLb1VZBboYjmZmnRBfgoNn55xeIiSFMOgl0hytNg52zyDxpdUKXROrR4si+LLj RWJYZHVlZhm/ndcPgLsjZRR5pDyMyR+vJ6PpY8BBzeoQzv8eXtK4RaGlUIKdqdDqXJL3 r3HTKbw7nbawSrEaSsLx2CHQeR2ZA3yMpcZaULoRVDimhyiN8UDiVGSPkJVswyUtjX8q bzOqYd3lXwK6YI1XTmb+OuWFcz+Va+cg99M+VIG/ilAUpl6Xww692K++o0nL9X3823qR JblA== X-Gm-Message-State: AOJu0YzOe0f46BjQWEUsetRCzA6ZnvpSKgjjp3DexmoAhofSrz4/F6xY Zmhnu/8Pf/o+MA1jLTuFP1BkJUTpJjd8FIILz6u63coYZedlBJPx61VWJS/6ASrNJ2cTdVFzY1G WAFJ1+pc/luja6Oiu1QMKiiJ/yf2zA6qw X-Received: by 2002:a17:906:108f:b0:994:1880:dc32 with SMTP id u15-20020a170906108f00b009941880dc32mr8042334eju.17.1691425974848; Mon, 07 Aug 2023 09:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAOrA3sQdOCxahpEKiwq8VOW54ZSfWV5X0WyopCri708v3H0dc43QYOi6NsAXi+7lwk8xLjA== X-Received: by 2002:a17:906:108f:b0:994:1880:dc32 with SMTP id u15-20020a170906108f00b009941880dc32mr8042319eju.17.1691425974672; Mon, 07 Aug 2023 09:32:54 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id f8-20020a170906560800b00992b7ff3993sm5334625ejq.126.2023.08.07.09.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 09:32:54 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com, kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich , kernel test robot Subject: [PATCH drm-misc-next 3/5] drm/nouveau: remove incorrect __user annotations Date: Mon, 7 Aug 2023 18:32:24 +0200 Message-ID: <20230807163238.2091-4-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807163238.2091-1-dakr@redhat.com> References: <20230807163238.2091-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix copy-paste error causing EXEC and VM_BIND syscalls data pointers to carry incorrect __user annotations. Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Reported-by: kernel test robot Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_exec.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_exec.h | 2 +- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_uvmm.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.c b/drivers/gpu/drm/nouve= au/nouveau_exec.c index 42d9dd43ea02..0f927adda4ed 100644 --- a/drivers/gpu/drm/nouveau/nouveau_exec.c +++ b/drivers/gpu/drm/nouveau/nouveau_exec.c @@ -293,7 +293,7 @@ nouveau_exec(struct nouveau_exec_job_args *args) =20 static int nouveau_exec_ucopy(struct nouveau_exec_job_args *args, - struct drm_nouveau_exec __user *req) + struct drm_nouveau_exec *req) { struct drm_nouveau_sync **s; u32 inc =3D req->wait_count; @@ -352,7 +352,7 @@ nouveau_exec_ufree(struct nouveau_exec_job_args *args) =20 int nouveau_exec_ioctl_exec(struct drm_device *dev, - void __user *data, + void *data, struct drm_file *file_priv) { struct nouveau_abi16 *abi16 =3D nouveau_abi16_get(file_priv); @@ -360,7 +360,7 @@ nouveau_exec_ioctl_exec(struct drm_device *dev, struct nouveau_abi16_chan *chan16; struct nouveau_channel *chan =3D NULL; struct nouveau_exec_job_args args =3D {}; - struct drm_nouveau_exec __user *req =3D data; + struct drm_nouveau_exec *req =3D data; int ret =3D 0; =20 if (unlikely(!abi16)) diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.h b/drivers/gpu/drm/nouve= au/nouveau_exec.h index 3032db27b8d7..778cacd90f65 100644 --- a/drivers/gpu/drm/nouveau/nouveau_exec.h +++ b/drivers/gpu/drm/nouveau/nouveau_exec.h @@ -48,7 +48,7 @@ struct nouveau_exec_job { int nouveau_exec_job_init(struct nouveau_exec_job **job, struct nouveau_exec_job_args *args); =20 -int nouveau_exec_ioctl_exec(struct drm_device *dev, void __user *data, +int nouveau_exec_ioctl_exec(struct drm_device *dev, void *data, struct drm_file *file_priv); =20 #endif diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouve= au/nouveau_uvmm.c index b515a21aa08e..2acbac73e57a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -1687,7 +1687,7 @@ nouveau_uvmm_vm_bind(struct nouveau_uvmm_bind_job_arg= s *args) =20 static int nouveau_uvmm_vm_bind_ucopy(struct nouveau_uvmm_bind_job_args *args, - struct drm_nouveau_vm_bind __user *req) + struct drm_nouveau_vm_bind *req) { struct drm_nouveau_sync **s; u32 inc =3D req->wait_count; @@ -1749,12 +1749,12 @@ nouveau_uvmm_vm_bind_ufree(struct nouveau_uvmm_bind= _job_args *args) =20 int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, - void __user *data, + void *data, struct drm_file *file_priv) { struct nouveau_cli *cli =3D nouveau_cli(file_priv); struct nouveau_uvmm_bind_job_args args =3D {}; - struct drm_nouveau_vm_bind __user *req =3D data; + struct drm_nouveau_vm_bind *req =3D data; int ret =3D 0; =20 if (unlikely(!nouveau_cli_uvmm_locked(cli))) diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouve= au/nouveau_uvmm.h index 3923c03012f9..534baadc3bf7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.h +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.h @@ -89,10 +89,10 @@ void nouveau_uvmm_fini(struct nouveau_uvmm *uvmm); void nouveau_uvmm_bo_map_all(struct nouveau_bo *nvbov, struct nouveau_mem = *mem); void nouveau_uvmm_bo_unmap_all(struct nouveau_bo *nvbo); =20 -int nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, void __user *data, +int nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, void *data, struct drm_file *file_priv); =20 -int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, void __user *data, +int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, void *data, struct drm_file *file_priv); =20 static inline void nouveau_uvmm_lock(struct nouveau_uvmm *uvmm) --=20 2.41.0 From nobody Thu Sep 11 19:21:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40539C001DB for ; Mon, 7 Aug 2023 16:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231725AbjHGQed (ORCPT ); Mon, 7 Aug 2023 12:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231620AbjHGQeL (ORCPT ); Mon, 7 Aug 2023 12:34:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7833B1BF2 for ; Mon, 7 Aug 2023 09:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zFP8XpgqMd1ZR+xUc/aq9ardUQohRgS98TLoMxhZWU=; b=TeqlOsojErq9/NDkd08RY9jbBQjMqNPR5Pn5deCxhOey1/Py4LzlhxpxNCfcM+D28P02cV 0nyZRO088WTxGfLutxWuFKTmqRv+S6zfsMpPFp4M2KlDa4Hfno8r0KXHNxmRXk1JH9ZTSq FAYRpkMsijNg0K5IkzbjkB2JmTzetOg= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-uEE4ilScOiCtkkoRNJu-dw-1; Mon, 07 Aug 2023 12:33:03 -0400 X-MC-Unique: uEE4ilScOiCtkkoRNJu-dw-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-99cc32f2ec5so135806866b.1 for ; Mon, 07 Aug 2023 09:32:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425979; x=1692030779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7zFP8XpgqMd1ZR+xUc/aq9ardUQohRgS98TLoMxhZWU=; b=RiNApnMHZJ1axvRbU21EQqs640ZFobXaBIo9f8ubRc2cfxt53lwz7PijrwWzD6rzOP sImFPjTpDdNMBnsPH0VMlXi4eTSuMiWNjB7Ky/WZBOw7nZsqutG5oS50KskztP9htoXY 2NZQXsf8cgJTexarZlhdesbM8HNnY/HD2zPFkOT2suBM6bCNVwyihRRu+MCMdNu8Bddt +l27M+gidgpsYR239AqYHq/cpPWCRgPzmFDhJIQWF63UEEdxAFYlbo0OGYIRLJog0wRY /eaQgNLtJJ8EG3crAAfvGnpgLCpzKFW7Yjfesvf6+ZVLogobtM4K8ub4plqmuv3Y6C9C I71g== X-Gm-Message-State: AOJu0YzHdao7obn9kstQGmIuvtcU/wKb+9Hk1ZYrPa/gYKolPVxscZPJ 6i2sj+G6v0KYmeUxvq2JVzEbMyA83S+f+d+F6dcMlvBBDR3KRFNbIUnTuYh7rxxcuxurzQ/dAUT DPFMZeEuUmaiiPLD9coDgdUNs X-Received: by 2002:a17:906:5dce:b0:99c:aa43:b20c with SMTP id p14-20020a1709065dce00b0099caa43b20cmr6276324ejv.33.1691425978964; Mon, 07 Aug 2023 09:32:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzwa0036YfN6zZ9wxNCsP6a+2soTFVv0lKi71JnNJfbR+fIxNYwVKxG8hEDVJBGDY4OrEouA== X-Received: by 2002:a17:906:5dce:b0:99c:aa43:b20c with SMTP id p14-20020a1709065dce00b0099caa43b20cmr6276305ejv.33.1691425978678; Mon, 07 Aug 2023 09:32:58 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id bn10-20020a170906c0ca00b00992b0745548sm5435523ejb.152.2023.08.07.09.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 09:32:58 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com, kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich , kernel test robot Subject: [PATCH drm-misc-next 4/5] drm/nouveau: uvmm: remove incorrect calls to mas_unlock() Date: Mon, 7 Aug 2023 18:32:25 +0200 Message-ID: <20230807163238.2091-5-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807163238.2091-1-dakr@redhat.com> References: <20230807163238.2091-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove incorrect calls to mas_unlock() in the unwind path of __nouveau_uvma_region_insert(). The region maple tree uses an external lock instead, namely the global uvmm lock. Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Reported-by: kernel test robot Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouve= au/nouveau_uvmm.c index 2acbac73e57a..91b964ef98b1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -279,15 +279,11 @@ __nouveau_uvma_region_insert(struct nouveau_uvmm *uvm= m, u64 last =3D addr + range - 1; MA_STATE(mas, &uvmm->region_mt, addr, addr); =20 - if (unlikely(mas_walk(&mas))) { - mas_unlock(&mas); + if (unlikely(mas_walk(&mas))) return -EEXIST; - } =20 - if (unlikely(mas.last < last)) { - mas_unlock(&mas); + if (unlikely(mas.last < last)) return -EEXIST; - } =20 mas.index =3D addr; mas.last =3D last; --=20 2.41.0 From nobody Thu Sep 11 19:21:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49B51C00528 for ; Mon, 7 Aug 2023 16:34:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231207AbjHGQea (ORCPT ); Mon, 7 Aug 2023 12:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjHGQeL (ORCPT ); Mon, 7 Aug 2023 12:34:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333721BE3 for ; Mon, 7 Aug 2023 09:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+2S62aAs2pHMB7uH7IHyHCrQs/gKhwqzaa+nqwK3QP4=; b=FSNOPDBgd2rWzGhx410wphPZMeE9jCOHA8O2M8czSrI4vOwxGetef6QrzXL1HOnBFXD/xo loiEAlcr+bkZQryGxpW7boc321soMYA25YgEs+0Hn54yVPcKg51iSnkjmS0ye8vhsPs06A t9XcBbriuBkWSY2oYviF9dvnuR8jFW4= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-tnDrFH7INU-qhsWp06j72Q-1; Mon, 07 Aug 2023 12:33:04 -0400 X-MC-Unique: tnDrFH7INU-qhsWp06j72Q-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-993c2d9e496so326315866b.0 for ; Mon, 07 Aug 2023 09:33:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425983; x=1692030783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+2S62aAs2pHMB7uH7IHyHCrQs/gKhwqzaa+nqwK3QP4=; b=LHFHog/TcqwJhgiPmYVmWJ9/P9pGBIskbvuW+vxhew4gDwnuDoJJYTubtsJmyNvCkK s6pMU1xjhEXog+brvhiJXIkHzR59JQ7bGA62gUjy+ptKOn6IGBS7G77TuoWGL7+TEQ4/ IB7H4xaK+2NQWDEzQLPqeMprnwNJlilhTjOSHJgp1B+aCxFWNVzY9pHOG+mJHmNzEm1V FTsI9gz1LHZwl+1cCfE+iijdcsjGTjM0TRWhzXmg4C1+wXsbhsXTU8BkawkZEaDs6A7A ootwMO2jgt69KPm9ay+oSiUtIx4BWRlHOh7Vr+Mq46xADMj6u3qTzO6odolocFSTJE7a OrXg== X-Gm-Message-State: AOJu0YwDusZEH4UkGKgVH8yCboCGuV0d2F9UXtigxryHY4ZdvJwE+SE4 kXJ7gXtjQxzkNu3N7p20MVJrcVthfIPk+2gCkm32X/gyTl4gSAzd+D8Fwcp7ctTghA/P3YkRd5V CFPnYLo3yEvVJHayzw0eVsQgG X-Received: by 2002:a17:907:2c42:b0:99b:ef86:60d8 with SMTP id hf2-20020a1709072c4200b0099bef8660d8mr7492480ejc.5.1691425982806; Mon, 07 Aug 2023 09:33:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDd4lJA/lPWWyUyn4AV5CwgF5Dpm9yGhjxgNLtBZXvmCaU/mnXlPtmXy0UEJZds96u9UqFlQ== X-Received: by 2002:a17:907:2c42:b0:99b:ef86:60d8 with SMTP id hf2-20020a1709072c4200b0099bef8660d8mr7492472ejc.5.1691425982642; Mon, 07 Aug 2023 09:33:02 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id bx22-20020a170906a1d600b00993860a6d37sm5409393ejb.40.2023.08.07.09.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 09:33:02 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com, kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich Subject: [PATCH drm-misc-next 5/5] drm/nouveau: uvmm: remove dedicated VM pointer from VMAs Date: Mon, 7 Aug 2023 18:32:26 +0200 Message-ID: <20230807163238.2091-6-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807163238.2091-1-dakr@redhat.com> References: <20230807163238.2091-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" VMAs can find their corresponding VM through their embedded struct drm_gpuva which already carries a pointer to a struct drm_gpuva_manager which the VM is based on. Hence, remove the struct nouveau_uvmm pointer from struct nouveau_uvma to save a couple of bytes per mapping. Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 9 ++++----- drivers/gpu/drm/nouveau/nouveau_uvmm.h | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouve= au/nouveau_uvmm.c index 91b964ef98b1..3a1e8538f205 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -181,7 +181,7 @@ nouveau_uvma_vmm_put(struct nouveau_uvma *uvma) u64 addr =3D uvma->va.va.addr; u64 range =3D uvma->va.va.range; =20 - return nouveau_uvmm_vmm_put(uvma->uvmm, addr, range); + return nouveau_uvmm_vmm_put(to_uvmm(uvma), addr, range); } =20 static int @@ -192,7 +192,7 @@ nouveau_uvma_map(struct nouveau_uvma *uvma, u64 offset =3D uvma->va.gem.offset; u64 range =3D uvma->va.va.range; =20 - return nouveau_uvmm_vmm_map(uvma->uvmm, addr, range, + return nouveau_uvmm_vmm_map(to_uvmm(uvma), addr, range, offset, uvma->kind, mem); } =20 @@ -206,7 +206,7 @@ nouveau_uvma_unmap(struct nouveau_uvma *uvma) if (drm_gpuva_invalidated(&uvma->va)) return 0; =20 - return nouveau_uvmm_vmm_unmap(uvma->uvmm, addr, range, sparse); + return nouveau_uvmm_vmm_unmap(to_uvmm(uvma), addr, range, sparse); } =20 static int @@ -586,7 +586,6 @@ op_map_prepare(struct nouveau_uvmm *uvmm, if (ret) return ret; =20 - uvma->uvmm =3D uvmm; uvma->region =3D args->region; uvma->kind =3D args->kind; =20 @@ -794,7 +793,7 @@ op_unmap_range(struct drm_gpuva_op_unmap *u, bool sparse =3D !!uvma->region; =20 if (!drm_gpuva_invalidated(u->va)) - nouveau_uvmm_vmm_unmap(uvma->uvmm, addr, range, sparse); + nouveau_uvmm_vmm_unmap(to_uvmm(uvma), addr, range, sparse); } =20 static void diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouve= au/nouveau_uvmm.h index 534baadc3bf7..fc7f6fd2a4e1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.h +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.h @@ -37,12 +37,15 @@ struct nouveau_uvma_region { struct nouveau_uvma { struct drm_gpuva va; =20 - struct nouveau_uvmm *uvmm; struct nouveau_uvma_region *region; - u8 kind; }; =20 +#define uvmm_from_mgr(x) container_of((x), struct nouveau_uvmm, umgr) +#define uvma_from_va(x) container_of((x), struct nouveau_uvma, va) + +#define to_uvmm(x) uvmm_from_mgr((x)->va.mgr) + struct nouveau_uvmm_bind_job { struct nouveau_job base; =20 @@ -79,9 +82,6 @@ struct nouveau_uvmm_bind_job_args { =20 #define to_uvmm_bind_job(job) container_of((job), struct nouveau_uvmm_bind= _job, base) =20 -#define uvmm_from_mgr(x) container_of((x), struct nouveau_uvmm, umgr) -#define uvma_from_va(x) container_of((x), struct nouveau_uvma, va) - int nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli, u64 kernel_managed_addr, u64 kernel_managed_size); void nouveau_uvmm_fini(struct nouveau_uvmm *uvmm); --=20 2.41.0