Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2344842rdb; Thu, 21 Sep 2023 16:19:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGc50Jt9qCKdEmJmxyBx+2sKI1g+TaeDxIEf39bWGyJMRGn2sQ4RZvpIny6SONBJgM2ytdk X-Received: by 2002:a05:6358:50c6:b0:13a:4855:d885 with SMTP id m6-20020a05635850c600b0013a4855d885mr8776434rwm.10.1695338385626; Thu, 21 Sep 2023 16:19:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695338385; cv=pass; d=google.com; s=arc-20160816; b=J68hwyPlABnlOcrsrNRkX/w+IAnO/DNSLWfu0f8tWeTR0fvmElsDlQW79gW5o7CmkM l80RyTlnqDvNE///3cFxl3YtfAtB2RvsLCKLbTycOnP1VARvcdCuvbBCaQGy3HTJWvvx xt9MuzPcLVSCChnAOPSqsgiyLB4JbLGbjhh8ZSd/Vipj0Xnz4iZX2FBrqWA+JVm9+1YU gHXflYOYiPA7tr6gqtDmqtnArb6a6prVqnsCxZyiiG5Pc8XzHbgA24z7NPNY+HOPrWab ipwLpYp9vddzstUlqkbsbscP0B6+Mr9aL1vxK2hscH1Qf9Tch/diRpoo9OxOmRHUTbsZ 19Tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=+I8ZTFM0TYPVRKX+xRp/8N7svLu4T86/ECyoxQdGzJs=; fh=3a9LDJNHdyiSOT/wMkTJ/BcYA6s/VFeI3fu4NE+OmMg=; b=GERz3WRSMELaB+yV97H9ILgjhXPKEd/+54fHSjO+kEwsylg/Oqzg7/AeuROrnP4vjN KVualYtJnzvSGpx7V7JMDpUag8vNhYNoNlw0heM2/yROl57wzn/Gb7L4c298uuasXxfb NpSr8D0j8Q/BcysvtPK/bMeGzFqSGcJSVEipmIwDPSHfuECBD2VZCJRm0KeSH6SwYHG3 y5b0fJ+beU5TyEUKbHcxQWcEUlt7Q8mi+hiCRlZxeQwplDiuAmn86MnNRezL9pzjTGhM bLGRC2bwYZc+/UfgWOApSWfNKyopa1pnYmq1BvOZ0lLI1EbIKyoiYB2PGtziYZl1Keem HhSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GfEKwHXK; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 63-20020a630142000000b00578a98c0687si2536894pgb.99.2023.09.21.16.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=GfEKwHXK; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2F15C80B7AD1; Thu, 21 Sep 2023 10:04:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229944AbjIURCZ (ORCPT + 99 others); Thu, 21 Sep 2023 13:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbjIURCG (ORCPT ); Thu, 21 Sep 2023 13:02:06 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::60b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EF4D1BFC for ; Thu, 21 Sep 2023 10:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T5ElhLLd07T1AYHp7AU2b2DckkqLL1krNVfFgIfgAAplbVcXwKxfsgtBey9gKOYNb1nt+PlxUTkXYoguw60ozuWfFO+POwzgziwhqM10ugyAL6xOLITBT9OQCEY8tM5Fm43ReWNFGTMDqq9AJ6VygTUYVD2As97NaM4VPl/Sw4i3llQb2ebPDZP4HKXV/tdJGY3aCgUBeqG42rwjoEDbAlXEgHTYog+kKnVba4X0JzpuuVlueBn+gffwTI7+MCyEC9IuW4oLBIdaPWhQ1DLbfDLhEIRfB5cs85OhbdxdY6fG1Oz8Ltg0jBPjzBUsg9GYhvka/8xPc+DsFBx0PZIv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+I8ZTFM0TYPVRKX+xRp/8N7svLu4T86/ECyoxQdGzJs=; b=mkGsSc1xqV/T6nnoCsLlYiO2K9ssVTc1Tt6rhSuMmWYNjxrZ/EEgUCE1qButzVUj4GM8KuxsGJXBwPZuL8AOTFZzIyf4bOkirGosbWsL/9VY23wnuXBH8yPBIai7E1LFG7GhdMzsjdQ5v7ycfMNq3nfCJhm4fqeuPMDCAuxYHcZrz6kyk1UqJP0uEbSBGqZ5x+PPCdwnPR/YW76k78WFT+WcJiHr6BGVra4Q75gNnAJLECyUIEFWAeJkV5eXG/70iaYF5JHJdDjTFH21Q848scyInLvl5ZEYLocvB0HRcT2r5UOKYc8PLeh/qB6Mv3FA6sNRfIaa4muC+9/Yuyh3+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+I8ZTFM0TYPVRKX+xRp/8N7svLu4T86/ECyoxQdGzJs=; b=GfEKwHXKMZQurNRZqGl1FA4zEcS8XhDmpIWXKqr4+dtP2XWO9P7Xxm7XEHz4v2DftW79v9MrHTiKv+3Rl3PmIy+7EhJs0eOLRR9Ur6nDUMlVjXmkeEf5y3SBaKpf9hc2w0UN/DG+a6Q+2rzvRlohNG6Ev6s6A0M6gmOKqeu9Ii0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by CH3PR12MB9123.namprd12.prod.outlook.com (2603:10b6:610:1a4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 21 Sep 2023 07:39:15 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::55cb:215b:389e:eced]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::55cb:215b:389e:eced%5]) with mapi id 15.20.6792.026; Thu, 21 Sep 2023 07:39:14 +0000 Message-ID: <7951dc11-6047-6beb-8ef8-98c862e26ec3@amd.com> Date: Thu, 21 Sep 2023 09:39:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH drm-misc-next v4 4/8] drm/gpuvm: add common dma-resv per struct drm_gpuvm Content-Language: en-US To: Danilo Krummrich , airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, thomas.hellstrom@linux.intel.com, sarah.walker@imgtec.com, donald.robson@imgtec.com, boris.brezillon@collabora.com, faith.ekstrand@collabora.com Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20230920144343.64830-1-dakr@redhat.com> <20230920144343.64830-5-dakr@redhat.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20230920144343.64830-5-dakr@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0163.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::6) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|CH3PR12MB9123:EE_ X-MS-Office365-Filtering-Correlation-Id: 02627924-c1c7-4887-9efa-08dbba75da81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tucGfkQdfiSeqHKKlUgGO+se6m0Efoj4xwSJ7z+mDy8xCqJcqbIHNwpedB+RbL8rmTHkJf2V01xURbjKTeG6tpAf/fkoCKXFoqi6XP4tLwuHzfqtMNA57OxFlDBVvGqHhfpTE1trjhPHMzXu+3WvLBHA+fDsYQSPTAKTHMecURczwN3QZg7NfFeM6tUjXiOOYTgKXtzUwAhm2qsbZlQX8mXBvIKmiCxnJXCw+3caq4fjeR+pXKxCB6a7yUFm1OEb4xHCjCgnbTW3Qu74RKAMV7e+6isaKsN0kWKPL4rePiN6baR7De7O65I3NhV+L9YYJvru8mJGQicKbciyQYf2++rZMJu/KgFGvp+ksq+RSjYDbqiRPw4Ea0PcEfwEifXkXOs2t1YldTmy7wXlMMraC47BM8p5J5L7EZdBmvGXmky9rYbbVPKhgh7eEIyhFfUB2sVkrxDFQBMlqo6J+ZV+RfC8DCZ5MeuR48YJlHZXn82F/wOOOK4ngQrnroVlN+6+Tvz6ijn/oqAzSkXmodN07DxBLGq7tmapMcfa3UVPO7wHeayvgxvwPkZ0z/PZz10/M/R0BkNJKJbV94vWyl8EKrOtcBrcHaCwLX6d1n2brPGM5QMqTyX3FIbF3h7f8KkMZeleTKmjEkLkye4A6y99/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(376002)(136003)(346002)(366004)(186009)(1800799009)(451199024)(478600001)(31686004)(6486002)(6506007)(6666004)(86362001)(36756003)(31696002)(38100700002)(2906002)(26005)(6512007)(5660300002)(8676002)(83380400001)(8936002)(41300700001)(2616005)(4326008)(7416002)(316002)(66476007)(66946007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STFoY3FVb0t4OC80Vy8wbWxpbTlIL1RrVUM1UUNGWjgyMmhxWlVLQ0t0eVpC?= =?utf-8?B?SGkxd3F5N0lWTFgxLzBsb2ZaUU5ma1Nyb3JkMk5pQ3FpUkY5T3BJb0twUDdh?= =?utf-8?B?T2htT3dIRGdMM1kxS0V3VSs0VElYaVJtNG9TN08zWXRsUm5kR3FRRUxMNTd1?= =?utf-8?B?Z01JR2hzcEUxL1Y5VFVCWUl4aEtCcVBQUDc2MG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B?RVdndXRUOUhlODg5OGlieDhDVHY5c3l6ZlE4QWxwWTVQcFA3RngrVG9UL3pZ?= =?utf-8?B?NEsxai9BUUpRRjRqNHdSUGFueWd6TWhCeVJLMEltSFNWdFpBUFNxRC95SGVx?= =?utf-8?Q?cSPOoGIdk40jATO7uSl3nxbpm?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02627924-c1c7-4887-9efa-08dbba75da81 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2023 07:39:14.4945 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KOqJu8zsdveR2p5qfhBj4nozUZZGS1t+XIhtgeYgp9ZJtt8C46HXfNNEfYnLZq4Y X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9123 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:04:28 -0700 (PDT) Am 20.09.23 um 16:42 schrieb Danilo Krummrich: > Provide a common dma-resv for GEM objects not being used outside of this > GPU-VM. This is used in a subsequent patch to generalize dma-resv, > external and evicted object handling and GEM validation. > > Signed-off-by: Danilo Krummrich > --- > drivers/gpu/drm/drm_gpuvm.c | 9 +++++++-- > drivers/gpu/drm/nouveau/nouveau_uvmm.c | 2 +- > include/drm/drm_gpuvm.h | 17 ++++++++++++++++- > 3 files changed, 24 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c > index bfea4a8a19ec..cbf4b738a16c 100644 > --- a/drivers/gpu/drm/drm_gpuvm.c > +++ b/drivers/gpu/drm/drm_gpuvm.c > @@ -655,6 +655,7 @@ drm_gpuva_range_valid(struct drm_gpuvm *gpuvm, > /** > * drm_gpuvm_init() - initialize a &drm_gpuvm > * @gpuvm: pointer to the &drm_gpuvm to initialize > + * @drm: the drivers &drm_device > * @name: the name of the GPU VA space > * @start_offset: the start offset of the GPU VA space > * @range: the size of the GPU VA space > @@ -668,7 +669,7 @@ drm_gpuva_range_valid(struct drm_gpuvm *gpuvm, > * &name is expected to be managed by the surrounding driver structures. > */ > void > -drm_gpuvm_init(struct drm_gpuvm *gpuvm, > +drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_device *drm, > const char *name, > u64 start_offset, u64 range, > u64 reserve_offset, u64 reserve_range, > @@ -694,6 +695,8 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, > reserve_range))) > __drm_gpuva_insert(gpuvm, &gpuvm->kernel_alloc_node); > } > + > + drm_gem_private_object_init(drm, &gpuvm->d_obj, 0); > } > EXPORT_SYMBOL_GPL(drm_gpuvm_init); > > @@ -713,7 +716,9 @@ drm_gpuvm_destroy(struct drm_gpuvm *gpuvm) > __drm_gpuva_remove(&gpuvm->kernel_alloc_node); > > WARN(!RB_EMPTY_ROOT(&gpuvm->rb.tree.rb_root), > - "GPUVA tree is not empty, potentially leaking memory."); > + "GPUVA tree is not empty, potentially leaking memory.\n"); > + > + drm_gem_private_object_fini(&gpuvm->d_obj); > } > EXPORT_SYMBOL_GPL(drm_gpuvm_destroy); > > diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c > index 6c86b64273c3..a80ac8767843 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c > @@ -1836,7 +1836,7 @@ nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli, > uvmm->kernel_managed_addr = kernel_managed_addr; > uvmm->kernel_managed_size = kernel_managed_size; > > - drm_gpuvm_init(&uvmm->base, cli->name, > + drm_gpuvm_init(&uvmm->base, cli->drm->dev, cli->name, > NOUVEAU_VA_SPACE_START, > NOUVEAU_VA_SPACE_END, > kernel_managed_addr, kernel_managed_size, > diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h > index 0e802676e0a9..6666c07d7c3e 100644 > --- a/include/drm/drm_gpuvm.h > +++ b/include/drm/drm_gpuvm.h > @@ -240,14 +240,29 @@ struct drm_gpuvm { > * @ops: &drm_gpuvm_ops providing the split/merge steps to drivers > */ > const struct drm_gpuvm_ops *ops; > + > + /** > + * @d_obj: Dummy GEM object; used internally to pass the GPU VMs > + * dma-resv to &drm_exec. Provides the GPUVM's &dma-resv. > + */ > + struct drm_gem_object d_obj; Yeah, as pointed out in the other mail that won't work like this. The GPUVM contains GEM objects and therefore should probably have a reference to those objects. When those GEM objects now use the dma-resv object embedded inside the GPUVM then they also need a reference to the GPUVM to make sure the dma-resv object won't be freed before they are freed. This is a circle reference dependency. The simplest solution I can see is to let the driver provide the GEM object to use. Amdgpu uses the root page directory object for this. Apart from that I strongly think that we shouldn't let the GPUVM code create a driver GEM object. We did that in TTM for the ghost objects and it turned out to be a bad idea. Regards, Christian. > }; > > -void drm_gpuvm_init(struct drm_gpuvm *gpuvm, const char *name, > +void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_device *drm, > + const char *name, > u64 start_offset, u64 range, > u64 reserve_offset, u64 reserve_range, > const struct drm_gpuvm_ops *ops); > void drm_gpuvm_destroy(struct drm_gpuvm *gpuvm); > > +/** > + * drm_gpuvm_resv() - returns the &drm_gpuvm's &dma_resv > + * @gpuvm__: the &drm_gpuvm > + * > + * Returns: a pointer to the &drm_gpuvm's &dma_resv > + */ > +#define drm_gpuvm_resv(gpuvm__) (&(gpuvm__)->d_obj._resv) > + > static inline struct drm_gpuva * > __drm_gpuva_next(struct drm_gpuva *va) > {