From patchwork Mon Aug 7 16:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13344536 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90F90C04A6A for ; Mon, 7 Aug 2023 16:32:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FC4610E2C0; Mon, 7 Aug 2023 16:32:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBAD210E2C1 for ; Mon, 7 Aug 2023 16:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IfDXzRQJmq7hjHOSakYboiQj+aP0Hf7JLmie7OP7ZJg=; b=N0osMx9ikyfZApFfWzSlj4j5shhjINUgcAufA4J2jFR8gRM3ONk99yi762jKOZRDF7GKJ4 nR5f6wx1lOh47ErIEJCEFFkBvPPoHDFe6/t8mIutrckr/FWko2PL6cbceNW+xkBsNUkCpX F19hdIeQqW344rrum+zY/adSLtd5fL4= 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-486-WUfh6ysTPGyLRH9B6lHm2w-1; Mon, 07 Aug 2023 12:32:47 -0400 X-MC-Unique: WUfh6ysTPGyLRH9B6lHm2w-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-99cc32f2ec5so135795766b.1 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=Sey0Gp0EM11H8V23rQb8HI81cGEWoQYyrU6hBd/sIuK9ZJJqlZ6BylL0a+nMGGAltI uRqldXRF4RCxrW2bkEkrH4AHm2Max2SQAptDaDOUi+dCGZnsRXxosbgsWhFIc04egTR5 B6Uhq/P6uCTdqi20SuuPn+Q2m3wUNYjOE0zwaDCzwGGc65CZ02n3ugponxIHX5Q3pnwa XClfrW/ejZbBlGDQ/kv4X5UhzonxXQqW4vjGfUlX/X4cP7rgS1O4bN6AAids8m6X+qo9 DFnZiijgNmj3qJuvamVu474S7LPoWa8Y4fZHp+7viIHKpJqVvy2nIMJFVWaodvj3bwIt Nm/w== X-Gm-Message-State: AOJu0YzOhA/tJipuCtmfDtvI/KNe8oCJPgBt/RsuiToIRvtSOsWzUfXt v9wOpKbwrs/YJFpXMUqG8mR1dOBgUH4LqvNKx6iPB5j6M2zzDp+oQbh0yW+Ut8mkC/8Mg8tVOX7 Y+9zk0THFMNnc/4ChQLj1p/xxIkF4 X-Received: by 2002:a17:906:31c1:b0:99b:c0f0:77fe with SMTP id f1-20020a17090631c100b0099bc0f077femr8075280ejf.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 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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/nouveau/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_drm *drm, } 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); From patchwork Mon Aug 7 16:32:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13344537 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B6E4C001DB for ; Mon, 7 Aug 2023 16:33:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A931A10E2C5; Mon, 7 Aug 2023 16:33:06 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA9CB10E2C1 for ; Mon, 7 Aug 2023 16:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691425976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FSJyklWcOYLh1Y7SYk3LyH530BHSBws8fX+6+9YjAp4=; b=ec/ZqnoZGHOiijvlH0hBAudZ5q2bAGp8RMbNHebzyj0SgdPdyghAhxZ7Pow3RBzfwPJN3x YvOILrlKf+cve0WAC9+zvYgxm5c5tcYi2v6g+O6nycsSozA2xptjjtJBg2MRN6lnGJZBF7 NFWaPJjc4ZJgwUlzcQoAkYruESZwuLQ= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-338-oS4t6aVONLCN-HJyo3OqxA-1; Mon, 07 Aug 2023 12:32:52 -0400 X-MC-Unique: oS4t6aVONLCN-HJyo3OqxA-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-4fe275023d4so4464406e87.2 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=iaxYjNKSMX3BYSvd0reFXNhtNW/CuE7wCzo7FQ+nCJvT0zQqZvH1qHW3DPcqT/evyh nZzAI+i7oDz8SrBdU0hB3qr2Jni8T8C/XwF/oTWkxkqmF480BU9mbTzWg3fJvs2+M9wp gW6Pt/w0J2c5sdUMwYBvvzbDUxqFd+uTIzyFYniPsWD6XArW3rKd30mPTpukH/J/bTyE GEP0by/qMUNTxL7CK31XmuCKtU7iL956gPUtf7l1AZ1+TnS3UMSoIBowLCAYw5SqVa6V xcgxZ/m1S6j5Qd5lnEMyH2qmxcivAc2qWPX+0IDDNjc+OymY3FuKE0nPLN7taSxyM+7j bAvA== X-Gm-Message-State: AOJu0YyBGXffsi1IIO8JCxPwQGjjaiFNnAyUprPZAhh48VKqG43D8bFx RXpn7kplmWwB9L9oLMdFngBzlAXLaIh1AhHm7VV5/FjNxdDIS+AmIY/F62Mv/iCqtvqJLEHq7P3 ReIn/H8fRa0V/OXONSiR4FajNqZLd X-Received: by 2002:a05:6512:280c:b0:4fb:744e:17db with SMTP id cf12-20020a056512280c00b004fb744e17dbmr7711097lfb.1.1691425971022; 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 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 uvmm") Reported-by: kernel test robot Reported-by: Stephen Rothwell Signed-off-by: Danilo Krummrich --- 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/drm/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 nvif_vmm_raw_v0 *args) .no_comp = true, }; struct nvkm_memory *memory; + void *argv = (void *)(uintptr_t)args->argv; + int argc = args->argc; u64 handle = args->memory; u8 refd; int ret; @@ -418,8 +420,7 @@ nvkm_uvmm_mthd_raw_map(struct nvkm_uvmm *uvmm, struct nvif_vmm_raw_v0 *args) return PTR_ERR(memory); } - ret = nvkm_memory_map(memory, args->offset, vmm, &vma, - (void *)args->argv, args->argc); + ret = nvkm_memory_map(memory, args->offset, vmm, &vma, argv, argc); nvkm_memory_unref(&vma.memory); nvkm_memory_unref(&memory); From patchwork Mon Aug 7 16:32:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13344538 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B0EFC001DB for ; Mon, 7 Aug 2023 16:33:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B69810E2CE; Mon, 7 Aug 2023 16:33:16 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E69C10E2C5 for ; Mon, 7 Aug 2023 16:32:58 +0000 (UTC) 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=piPAJWb0pb900GeCYfzlLDbns7cOjvHHVSLvNcNzuY4=; b=Y0K6A1v9Gbzbw0NRWs99qaqcEDzlM9Ok9s0aJiHghHgj7ZF4EWYL6OgsnxFDvM7LS/hxDZ p3/YpgCKUHrQ4NQvMPRRO5jbtqshJTh+PzlgVk5Hc2XRhTzKjO9z6Sg5eVBzW1yr4HolGg gVCzU1u3dwBIju5bVqA6q4+b4mbzukc= 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-550-HcVkeRBZP8GGA8omDT3UOQ-1; Mon, 07 Aug 2023 12:32:56 -0400 X-MC-Unique: HcVkeRBZP8GGA8omDT3UOQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-99bdee94b84so659207966b.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=1691425975; x=1692030775; 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=Kmlmfki3JoADffI1BIW/Mdy8Idu2T5BelKcZ2745u6aacvmSqBWpvaw2rXh/a3qesl MK3i0xw7waNz0x5E0y75WbQgZHfR/vKV28q0scDYaBIlkrdr6vs7UWsJ0B/Sn2PGehYe kpnHTDLms5wim1zl1htDixQ4eomWZNH89ejbdVGb06lEZ1PfRSKrGIKMrduPQVNEpEGV +P6SjXdZvNJeDaallMk95e4IAXxUO+qsLyjgDKDng2GvFWDw8cgwtaya2+hRxieVXy14 cXtap9Wx9/9t/YCkiwbxBkFIKZBCOTzMGfiQ4CVOR/4DWxEmO4fXNp5L4kGgQ+7DYtJf TCiA== X-Gm-Message-State: AOJu0YxxASRJ4cwr+dLsWQYkXSMcSIAe0qDENhlGbC7XtF4F89tMDppy 93yqT5EvevOiIz0oW+6swKvsYqNe9lk2dEsdBO7E9RHiUJ9AtksGv5tHwWTxDB2iIfNRfh6Pr0q ph6qTlcPPPnjXGuXwLDroybYpWNz9 X-Received: by 2002:a17:906:108f:b0:994:1880:dc32 with SMTP id u15-20020a170906108f00b009941880dc32mr8042336eju.17.1691425974849; 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 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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/nouveau/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) 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 = req->wait_count; @@ -352,7 +352,7 @@ nouveau_exec_ufree(struct nouveau_exec_job_args *args) int nouveau_exec_ioctl_exec(struct drm_device *dev, - void __user *data, + void *data, struct drm_file *file_priv) { struct nouveau_abi16 *abi16 = 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 = NULL; struct nouveau_exec_job_args args = {}; - struct drm_nouveau_exec __user *req = data; + struct drm_nouveau_exec *req = data; int ret = 0; if (unlikely(!abi16)) diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.h b/drivers/gpu/drm/nouveau/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); -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); #endif diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/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_args *args) 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 = req->wait_count; @@ -1749,12 +1749,12 @@ nouveau_uvmm_vm_bind_ufree(struct nouveau_uvmm_bind_job_args *args) int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, - void __user *data, + void *data, struct drm_file *file_priv) { struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_uvmm_bind_job_args args = {}; - struct drm_nouveau_vm_bind __user *req = data; + struct drm_nouveau_vm_bind *req = data; int ret = 0; if (unlikely(!nouveau_cli_uvmm_locked(cli))) diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouveau/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); -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); -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); static inline void nouveau_uvmm_lock(struct nouveau_uvmm *uvmm) From patchwork Mon Aug 7 16:32:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13344539 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BBC0C001DB for ; Mon, 7 Aug 2023 16:33:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F23010E2C8; Mon, 7 Aug 2023 16:33:26 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC0D510E2C1 for ; Mon, 7 Aug 2023 16:33:04 +0000 (UTC) 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zFP8XpgqMd1ZR+xUc/aq9ardUQohRgS98TLoMxhZWU=; b=JAjmgy5OSbvlz/45hbCxM6lEmxV+oVMV03enNWsNDHGny/gOy2Pt9d97yFgoxBMVaPKaAN pFK/AD65tlDwSgARMZxPZkMo5TAfyRzTBbkB9dmiBMbA4zUdyz3Ugdirq03ib6Xzo0yoPn 3J7yVl8IigZIP+MujsQzDwITIbuYLMc= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-xekXVb3TMNuIFUfymeJmUg-1; Mon, 07 Aug 2023 12:33:03 -0400 X-MC-Unique: xekXVb3TMNuIFUfymeJmUg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-99bcfdaaa52so320336166b.0 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=MLxzzBHtDmZgKUYy9qlxFH9k1Ek65VQboUL3uc21hac7916eWtcfrYfh5IWetoIClL ePYZj08MG+PUOOUMCTehc9LgHM1+hllLfmHCepeCHQcFClrtXuJiopil58GKMhavAEsI T3GlyAcfTT9XKpTHEt7PAT/7f5JwAHjVgqDGng6wj3ThE6IZg74rUDWXzyfityjysEqc s0dJdYLScfWgWoTIEhUC/cFCAyFnigtMaYnXgqSXQc1HdXdZJ0rQr51s48MWZUSh/Pzq EVj5y8PowSe8AsVSRjGHcH6wfoqInp3qfW07tl9FRoLw/+X2Chhg0iFyYGqhPwRu3ScI RrZQ== X-Gm-Message-State: AOJu0YzpDnTqpEAGvMl+e7K62AesEOJlCTVyrfoPRRnsU0ad0R9UWLpy k/OAwLWetHjR5vkenxZ/nPXPzY833ybqflzE/+xknFxXGkNmYH2j1074B9L9JnWzlnAU+oPfvCs DHwmugT5sj733qLZd63L8MFFmhH41 X-Received: by 2002:a17:906:5dce:b0:99c:aa43:b20c with SMTP id p14-20020a1709065dce00b0099caa43b20cmr6276318ejv.33.1691425978963; 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 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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/nouveau/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 *uvmm, u64 last = addr + range - 1; MA_STATE(mas, &uvmm->region_mt, addr, addr); - if (unlikely(mas_walk(&mas))) { - mas_unlock(&mas); + if (unlikely(mas_walk(&mas))) return -EEXIST; - } - if (unlikely(mas.last < last)) { - mas_unlock(&mas); + if (unlikely(mas.last < last)) return -EEXIST; - } mas.index = addr; mas.last = last; From patchwork Mon Aug 7 16:32:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13344540 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D550DC04A6A for ; Mon, 7 Aug 2023 16:33:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1551D10E2D0; Mon, 7 Aug 2023 16:33:37 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25DA110E2CA for ; Mon, 7 Aug 2023 16:33:06 +0000 (UTC) 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-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+2S62aAs2pHMB7uH7IHyHCrQs/gKhwqzaa+nqwK3QP4=; b=LzwaNVl0C24eIYDAEJ41C1W67CUiBNtEjCfFjycNylGIO4F/NF/xsBZtru9vC314yFtBb+ aVITiY70U911lpdxwSQSnJSKIdTVZwd1wdV86eI8WE2RBdFnnMSUORsXrz4jlvSJeZ8v0b /FOh8Af3gMkuOyOmztKbCFftPN/yHIc= 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-p5yDOofjMcCuy0g-sKUVHA-1; Mon, 07 Aug 2023 12:33:04 -0400 X-MC-Unique: p5yDOofjMcCuy0g-sKUVHA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-993d7ca4607so325918166b.1 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=1691425982; x=1692030782; 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=iA+PPC9ZZUB7H4G3QrlURcIMcpYR9N5W7c1oISI6XPjhiD1szVsDPEso5J6WZpDakj hJl/vqv5u1fVJo1fs6fNhk/W/sOZBee3Dm0p6IMRx9fKFtacTlHCpykAhnHea9/WLKex BoEnJYkUDyoKnDG1JvJPrlLU9RxjMfuPQbq1yd2s96vb/77bI1NiN2IRvew6gQd7jFlP /OaQm9/cwzK3rFE0IWiatdW9f4Vxc+MmLg7zQxutaUyR9ZF1FWN+Kd/lEZqCGzbLQJ7n 2YilXkuhEpip7dfsf6ZfdTVgZLpckFr/KaAFZMaZqWpuJ4dCK/veX0GNn78pku8LXs/A eg0w== X-Gm-Message-State: AOJu0Yyu0Z21Dx//W7fk5LRnnOLJOW0kx9ulEPcXQq8AK4FLfLGfCDP1 fe6CxMAfJGt9UgNYGEcgSmCTt1VKY9jzwVbI3xzZOTgN7EX8XQ/ZhXSqs8tQ7CMczCKPyyddsdc w2c3zfqVn5981uTYoRdq3czjHeE5D X-Received: by 2002:a17:907:2c42:b0:99b:ef86:60d8 with SMTP id hf2-20020a1709072c4200b0099bef8660d8mr7492486ejc.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 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Danilo Krummrich , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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/nouveau/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 = uvma->va.va.addr; u64 range = uvma->va.va.range; - return nouveau_uvmm_vmm_put(uvma->uvmm, addr, range); + return nouveau_uvmm_vmm_put(to_uvmm(uvma), addr, range); } static int @@ -192,7 +192,7 @@ nouveau_uvma_map(struct nouveau_uvma *uvma, u64 offset = uvma->va.gem.offset; u64 range = uvma->va.va.range; - return nouveau_uvmm_vmm_map(uvma->uvmm, addr, range, + return nouveau_uvmm_vmm_map(to_uvmm(uvma), addr, range, offset, uvma->kind, mem); } @@ -206,7 +206,7 @@ nouveau_uvma_unmap(struct nouveau_uvma *uvma) if (drm_gpuva_invalidated(&uvma->va)) return 0; - return nouveau_uvmm_vmm_unmap(uvma->uvmm, addr, range, sparse); + return nouveau_uvmm_vmm_unmap(to_uvmm(uvma), addr, range, sparse); } static int @@ -586,7 +586,6 @@ op_map_prepare(struct nouveau_uvmm *uvmm, if (ret) return ret; - uvma->uvmm = uvmm; uvma->region = args->region; uvma->kind = args->kind; @@ -794,7 +793,7 @@ op_unmap_range(struct drm_gpuva_op_unmap *u, bool sparse = !!uvma->region; 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); } static void diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouveau/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; - struct nouveau_uvmm *uvmm; struct nouveau_uvma_region *region; - u8 kind; }; +#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; @@ -79,9 +82,6 @@ struct nouveau_uvmm_bind_job_args { #define to_uvmm_bind_job(job) container_of((job), struct nouveau_uvmm_bind_job, base) -#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);