Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7388619rwd; Tue, 20 Jun 2023 00:05:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Q2cm6Ejbom3/ztwSNpjzg1zKLIUj4gneQxUXtvfhhyxnyKe4wR9nahLM4sth0A7sdew+O X-Received: by 2002:a17:90a:347:b0:260:a640:e6f3 with SMTP id 7-20020a17090a034700b00260a640e6f3mr2402410pjf.2.1687244717138; Tue, 20 Jun 2023 00:05:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687244717; cv=pass; d=google.com; s=arc-20160816; b=FQMQ5ordcB4avOCzaunCRrL0Y+Evq6etpjhxVT6qmvJ/15AlR/enCzHVZSwGMwsn+a +qrNRKuIpIicoUsjueKwBFngkq8pkHnEgaklXhY5PJhOqPrWkgJJerk22LBT45GcXKte SY91FjyJ+ODqtSNBcVok3/n3l9RmAfPbSx1t0XpBbw7YsG1BcQJEfKlVRBHqpRqN9oQO yJlkPhH7nlgJMP0I52ZIzgODRaXW2nCqpeQSsW2aEQaaIHhepGI0p5/92WV/aOHWk1vR FDHBPkBx5JTHKxnZ1U392QeVy42k3aCpC5TqMJ+Dp54MJNoVI6LO/l6ygw2S76afTLwP 6Msw== 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=7FP0khkDo7XVVLXOsc0YO5tFywdc9jJYG0y71MKW79k=; b=08OzEcsr4XHj4oYSVMymUrb0PTe0w5xRLlpteDiYK3uYtIYO/IiT5iM4N86QSzMqlN wcbmXkGwRnx7+L/QMa01YtC6aC2ONTkMHcLXXV7WgXEaIUpcBRoPVXXhSwE8yQrckviZ JZkc78EJ2lXBcGWLaT3XmWabiVV2BQKNlbWXzy4IXGuiqsnpJ2ytlnMokNRwybVxegt/ h/Q/qr7al4icEm+u9eAjTvmcPVlEUgftrcWBoJh0QLp9SE1Y8dOs6gSwELE/EI7Sgiyx iG+P+1ZV7c7DzfnJeEEU5xgvJC4mxBNiPAnRUdhDMq4p9A5tNx+brq/8mBNtVaAvvTk4 RoVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="D/uMWka1"; 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::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a17090a138d00b00256918d8db9si8711674pja.17.2023.06.20.00.04.57; Tue, 20 Jun 2023 00:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="D/uMWka1"; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231200AbjFTGpv (ORCPT + 99 others); Tue, 20 Jun 2023 02:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjFTGpt (ORCPT ); Tue, 20 Jun 2023 02:45:49 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2050.outbound.protection.outlook.com [40.107.101.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF1B9E6C; Mon, 19 Jun 2023 23:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JVuG6IkSjOCXqdEWXeI92ag5xTvrmKMxrpCSv+GMb2F8l+Naqo5b4Snt/I/JL8RKdSUfAAZHgN47ImgOrmC+cstFMtMhVtphHNkDWZnmbVtAAQD8ypUMxPpFXpUAOEIPqMbyvlidtR9c6CPgHQaA2iCi1FEo9M9dvN5YpoUYHlP+0GgW7CH/wB8XZJswklkQozkbU0vpsQhN/FgcIMTHWdZS1YW1gX9C5ZigrK27pArP2JiOe8OIat6DzVFVJwCdy9DkywZfXjGinoiGE4tFIxJsVb0l3IwbO7d2iWRnzxaAMt8R5WBZHCyM9mRVVwUTx/lroBeZv78kdwMmBR5pOw== 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=7FP0khkDo7XVVLXOsc0YO5tFywdc9jJYG0y71MKW79k=; b=fnmBxZ1Ws3VnSA/dsfNlAZ4h8B3eGC3MfJ4rAI9hF1ecuwMitkCqswajLw9zT+2uhf6CcYCf0NIiMm27+H0rhO2+impBSuYx3+zZ2PiylKVqN/vkHUafsLVhDjXMs/Yhvkl4qL3GeUft1SZt8P6vM2OZ6s2TH+Aqgj2lY/pfv7W47HTyE97nBaS5TaeL1AjgdYPZH2+GdeOU98DCfR9FGLfZ+AU2o8o3J/gmRX6StqYFJ6hkeTTVpDl6uz/QfXC9oVqPy/QTHSlII+X/ECnzX/Fj57FOck1523i9W4VnUS30UNW4pUXwgcIrnjO3HEb8pyC357NgsuJNZ4jSZKMZOg== 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=7FP0khkDo7XVVLXOsc0YO5tFywdc9jJYG0y71MKW79k=; b=D/uMWka1QW8Yog3XikL/DBZ8pu0O8t8W5IXHrfLTp94dfoGDhbtzowaudMfBIETr4jLUbHM/QWijnqccTduIoEGrb7x2UlRE+nIxd0mP0bD0jryx5rvAhTwXK4UeSnrxXqLcBfYljIGYL5hAk+Tu+WNvYULLogGDma0U1FIk09I= 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 SN7PR12MB6692.namprd12.prod.outlook.com (2603:10b6:806:270::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 06:45:45 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::384a:95a4:8819:ee84]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::384a:95a4:8819:ee84%7]) with mapi id 15.20.6500.036; Tue, 20 Jun 2023 06:45:45 +0000 Message-ID: Date: Tue, 20 Jun 2023 08:45:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH drm-next v5 03/14] drm: manager to keep track of GPUs VA mappings Content-Language: en-US To: Danilo Krummrich , airlied@gmail.com, daniel@ffwll.ch, tzimmermann@suse.de, mripard@kernel.org, corbet@lwn.net, bskeggs@redhat.com, Liam.Howlett@oracle.com, matthew.brost@intel.com, boris.brezillon@collabora.com, alexdeucher@gmail.com, ogabbay@kernel.org, bagasdotme@gmail.com, willy@infradead.org, jason@jlekstrand.net Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Donald Robson , Dave Airlie References: <20230620004217.4700-1-dakr@redhat.com> <20230620004217.4700-4-dakr@redhat.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20230620004217.4700-4-dakr@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0240.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b2::15) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|SN7PR12MB6692:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c58ac4e-1b54-4ef0-7e05-08db7159f96d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NXM5juGnqO0M0gw7+gJLCwHIbhH8JMHcurLMLY8cWJkXLWbHItCAMyLGk2fnVDHFHxr2QxMzZfPtQTFI48i51C3eGvKryjF6VDEpwN6BMnb5ySultXrCYJ1GRjcrcpO7ZQ7Dad0Fy+Wa3DAhorZD/lCz3+kRsvW2BA/9IPKZ/iZxt4D7AmwKuDf+R0cjXVQP2zLKDeajsge4fp9n/hENwgSR+mqU+agTkWWlH4gdIgtOdWwSMzNxMxbspjSQL41gdWXaSmbBoJuFtXqKTy2x/1Wn4uoKcUsryTnT93jKPopopqjp8Mk80fI9V/n3GS0I73c1ogXq0wAql6uV4iRfky1LT25DwAOrw9FxpqVmUXSW/qQeJIUyn/HvV17otX1DAtVYl6cllZn54W5pe57y48moZNCzR0yCVOs9VQbxjLuxYT2N/rX8YjykPAgoFbg07oVF9/bW7OR7NpOfJzy768Ra9QjhYlwzwHogU2XiUi9VVEyoxbXTt9lQlRZq3oz0Bk0IUo8qyA1FaYwCHxDnANEAjYNGEmbVWs2u8ag3GPwk2SRIb/LYMgcVgPgAMq//7xsOfC0DCZiwBVFdo9nHCLRMZvOk1bf3XsrPeiD3X+lTvGYgyiNeBrg/8ymwvlnZ3OTd966PZU1cZ6T/3z10y1w62IElw+l+yg5KhmbUn1M= 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:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(451199021)(41300700001)(5660300002)(8676002)(8936002)(2906002)(7416002)(36756003)(86362001)(31696002)(6506007)(6512007)(26005)(478600001)(54906003)(186003)(6486002)(6666004)(66476007)(4326008)(66946007)(66556008)(316002)(38100700002)(31686004)(2616005)(83380400001)(921005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YUxqdDl4U21EZmdQQ01GUW9LSHVaK0dCeUR0NkQrTnRuTHUvZXNZTVNtUTk1?= =?utf-8?B?Y0hFM0pjSms3WDhPYU5TdDR1TWx0NWJYaDRjdHN6SEZxNlh3Vlk2T1F3QXZT?= =?utf-8?B?Z0F5ZFJ4d0ZSNFlMcUMxS2V2S1VlYTNHSUlGN04zclFTQ28zZjFySG1DZ3dG?= =?utf-8?B?Rlp2dVZQVDJKWkJBVCtOdE1PVzBQTGNkSXB0d1I4b3I1c3k1Rys4UHJQM0Vq?= =?utf-8?B?ZzVZa3BrMWZlRVZQUDVuTmdDWDF5N2lta0JmMVh5bVFnYnhvaG1CMGlvVCtB?= =?utf-8?B?QmljQ3AxbVA2U3JaS1VlcDVGSk5ONzBySWttMGF3RVFQTlVLajl4Tkx5elRu?= =?utf-8?B?NDJ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?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c58ac4e-1b54-4ef0-7e05-08db7159f96d X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 06:45:45.7074 (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: uOvcmq9iNz0c4Y0irlKS7+fnH4/R06Wj/qaJ6dNUPmcz5QhEUkJ53mqzRy6Gxdp4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6692 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Danilo, sorry for the delayed reply. I've trying to dig myself out of a hole at the moment. Am 20.06.23 um 02:42 schrieb Danilo Krummrich: > [SNIP] > diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h > index bbc721870c13..5ec8148a30ee 100644 > --- a/include/drm/drm_gem.h > +++ b/include/drm/drm_gem.h > @@ -36,6 +36,8 @@ > > #include > #include > +#include > +#include > > #include > > @@ -379,6 +381,18 @@ struct drm_gem_object { > */ > struct dma_resv _resv; > > + /** > + * @gpuva: > + * > + * Provides the list of GPU VAs attached to this GEM object. > + * > + * Drivers should lock list accesses with the GEMs &dma_resv lock > + * (&drm_gem_object.resv). > + */ > + struct { > + struct list_head list; > + } gpuva; > + > /** > * @funcs: > * I'm pretty sure that it's not a good idea to attach this directly to the GEM object. As you wrote in the commit message it's highly driver specific what to map and where to map it. Instead I suggest to have a separate structure for mappings in a VA space which driver can then add to their GEM objects or whatever they want to map into their VMs. Regards, Christian.