From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012000.outbound.protection.outlook.com [40.93.195.0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92DA0314D34 for ; Wed, 2 Sep 2026 07:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.0 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788332743; cv=fail; b=ULmyFpGrt/d8KLaSi46Ooq1z6APOn7N89WM1HivoTL58dLY82oVbaaGA7js/G2aBWbBDKU1k8xwXRqGSsgauT+QDNfzacrAxyIFJqU9F1XLrbpQ8Ds7CcjX4uStB+K7gF9HylsJyXG1oS9etWl+pFAu/oEG4+mutp154ZCO9v0o= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788332743; c=relaxed/simple; bh=H7y7WfkdTji9VVCwu/P19s5I1nYElAaf0DO0G0hTDpI=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=aLvAO2bSMZJ3JghDOWV93ym67CYSD71sf3/rNB1uiBuu1Z/FPC7TMSD41W21lEXNw6S9ibVM7tOpZeTC7Bas7ihseiAroE5KrTV3ASmUwzZKt8TAmKzx4Mlilw1iyoa2gaqqr0gdrhNHlt8VOB3S8sX76YEqd4rh2lmtOdqU0cc= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=RAJbYQmB; arc=fail smtp.client-ip=40.93.195.0 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="RAJbYQmB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H1nk3Ag8lGJGRkjDL5NBykaRwte4wnvsJXuYBBNtxPxVa4/cVgDG0DNJOnjWr5n69T9TPb89QHv/M8RPkgYv+NBZa8h/7A7zVK/aE/j/e0WH3/eidT7KaBP1HLNS8L7gSj9SXyzGw7J4tXyWaJVjQxrhhiuFhGxPZCVXNHcYjigzjj9uL849iy870fci6JhOeGI14c+abV7Fp37pUUhgplyR7in7E7qNxrTlI85Z1ff/1Rbdf8DjJAZwlrtBeZ+zLfQR54bSd+Ol5e5f/GmQlaA8lNy2B2wtGpSiihHXlzu3Ie50W2mxKrZ6FEFrXEF802pnAHk5qPT0mWVzwHHwDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=C++iQURR54PK2QEB4HrZTCUsN6p/aIG+Ow9W9yfeeaw=; b=zLuD33nbZLTSai2n0ljv1crEM5e4uytABPZ5FLX4uIvAFkX+Ghp8dkFWYOOPahK6epsln5Fo3UiastYTGAc1rW9EnqhwwrRYI1+EiaafjZue/lgKpnTdLVmsHrSjTERH+CqjbmS8kIF1PZaSW0Z6dX6BP0MHhfQF9qUmVOhPHxuYAeMyHIKPVRgNhpKkukACLDGaCNIYGu0X/BnllKFndE21MuXsYNhLIWr+67kAQCkpbASz1bVnxt1K6Cwon/CFeu1UGfBI7qj+7hts7MSYMWnMWRw3DRplcXpKkkDLjC1I3G1YUIBpGbWrN6rEed9pciQ2tdaB4dgA4quMxyrLaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C++iQURR54PK2QEB4HrZTCUsN6p/aIG+Ow9W9yfeeaw=; b=RAJbYQmBsRwh2CnyJY0i2spaC6Vtx0gYQBAp27cVfFTGkXuPtP4dnTXjTBGQIlx/UQTP0Z85lRskWIvrETdxEI7YYGn/U+0d5SRCBjW+4t27AwbtwQL1fb6P4u+QasqiM4JO+pxQrEPn7d44nkb0TwIbMjHCMDGdjitZP1ejMV5s1QNFMK05TpHndmZ+kNO0aHPLasHFA7sbU4CQZkb+yghUboY+VI8/wSP1cwCtfvv0HoZjy7t7CYgFk4npCgWZKwFunsXW3aTY/HAp9esrZGNkHTVvwQuLaD/ZIdZoxjowNSddo3LF0VzEHwdNdT4BiXVAWt/4y3eKqitHWlOycg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN0PR12MB5977.namprd12.prod.outlook.com (2603:10b6:208:37c::22) by IA1PR12MB9063.namprd12.prod.outlook.com (2603:10b6:208:3a9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.360.13; Wed, 2 Sep 2026 07:05:37 +0000 Received: from MN0PR12MB5977.namprd12.prod.outlook.com ([fe80::d8:f725:258:2f28]) by MN0PR12MB5977.namprd12.prod.outlook.com ([fe80::d8:f725:258:2f28%4]) with mapi id 15.21.0360.008; Wed, 2 Sep 2026 07:05:36 +0000 Date: Wed, 2 Sep 2026 17:05:32 +1000 From: Alistair Popple To: Danilo Krummrich Cc: Dave Airlie , nova-gpu , M Henning , Alice Ryhl , Alexandre Courbot , Benno Lossin , Gary Guo , Eliot Courtney , John Hubbard , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH v5 05/11] drm: nova: Add an info ioctl Message-ID: References: <20260828033531.1117754-1-apopple@nvidia.com> <20260828033531.1117754-6-apopple@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SY5P282CA0144.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:205::14) To MN0PR12MB5977.namprd12.prod.outlook.com (2603:10b6:208:37c::22) Precedence: bulk X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB5977:EE_|IA1PR12MB9063:EE_ X-MS-Office365-Filtering-Correlation-Id: b5b3c771-bb03-455c-34ff-08df08c096e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|7416014|1800799024|366016|4143699003|10067099003|11063799006|6133799003|18002099003|22082099003|56012099006; X-Microsoft-Antispam-Message-Info: ElsU4yfwuYp5O/g+RvjV3AoiJz58wlQtoiUtfbHs14P2S27pgj9Brv+DAsWacZvUrhMCcx4kcLBJtlMnp8U0Xic8nWktGPeVx7OJhKZsWve+yi5Pix/jgy+SIV2Hdl4rITDh2VGy06Q7Qpqu3dm1IBFqi25P7KLPIsf7bUIR7l4VDILyPXZvICU1krJsj/m84p4aqQjkwuZDwnZYLiSTXzJSqYgC7eiOY27MGHNjp+9b5w602SFXDwcRV86MmSxH6JSXWoYgAI3f1hs9Ar03kU6/N3g2rU5QpLd6hbI4Un5SPncx9Bwq13vXrj2PfMTgjn4WjHUBbJ2FDNTymoV9bg90VPYvfGnKkbsUbF2Py/xdy0mLggFhAVhlpBMQIUuDOzAczFYZ5Gx9pPBh9y5RSdvtrluw2D+vH1VWgz833xJK5nBS75eMjIJNWg4/I4pYGuw7Wp+kgnhFeL9AsGKVkeMGfVcFNWlIL6aZOoh7sJZmriFR9sF6dyBgSu6cCl8BN1OAVNSv6PioOozBhxJ9lBFzk3g0X3DDTKoQ2nX2XL9p39O/Af1qZq14UwzcE0QCY+aHxaZMupX1x9qOcekJPHR7/87FprVaK0QWlJL1WFgwaE31zNfH17cNUqWYu/OQU9I8HukOazPm3+5jzz2hfX0PadblZAhYUYbvCFjCpkw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB5977.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(1800799024)(366016)(4143699003)(10067099003)(11063799006)(6133799003)(18002099003)(22082099003)(56012099006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NRJwDvT0SfiHveIvSEtLZvCL9n9SmY9HDhEOcqDexTjKo+k+mconfkRjhKGT?= =?us-ascii?Q?tCNhsxJMRityGeGk+WljSOA7gyY6pKO/puCfuJZRWxn32aAE4nBEiMZZWGMK?= =?us-ascii?Q?7nSEBeAQhaKTr6aIdNirGTLtGjN+YUNbaSkRaDbHndO/B3LwBhodIkykXfAI?= =?us-ascii?Q?ihEUtgdP3SlUPW2DPa/cBWOP8aoovS5zJiFhI0h+zRDTYnLLgkc2hrxvUQcs?= =?us-ascii?Q?A4GQq4zzoC7CK3k6t/J5I0BnLKIC9VFc7v9lGxGHVI9MSXpBl8dOrmV1LOQV?= =?us-ascii?Q?VazVnjHWm9eHXT+2o7fsyqS6iDR5y5SMaTTEDD3ShUFLwc9D45MiMcWGhdLT?= =?us-ascii?Q?owjcNqWvViTPC7/Rxb7cJD21eIcXJeKE0Eo/r5aaumLmfp4c0aqw3Jw7rg3y?= =?us-ascii?Q?74vAnpTFyd8pFJ4ZYprkgBmlhZFhaUnarLUEKdaeQj8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wt/dhVaZ8LhNGZH6wKvX20uok+8Agh2loTEQqia?= =?us-ascii?Q?G7Fk3GRWqnWi0+dPWST1B1KgxB+ZeR4CrlErX2hUGqTDKAgJ4OAcYMJj21vA?= =?us-ascii?Q?8XX9SyiiXubMjNueTa3JHQlksBeb/P+H6ONNjL1nXWqfwDUM2VApS6KGgd8d?= =?us-ascii?Q?oGCDPDjeVLhlX6IL5buLCcFfdlQjXZUX/JSy6u0s+2OQie6AY4MCvgxeBqBO?= =?us-ascii?Q?6FxTl/T/4eUqD8DedpzDTjGxwosaY0DbMPOspV9X3auCcT3rPk6Rpw6uPSiA?= =?us-ascii?Q?WPtBL8GNePQFf2ikTJIhgLM/fjLT6m/Syyc+J6lGeyTh3iXwlT6V0cfvU3l5?= =?us-ascii?Q?1dNY2hGH6TpymXCLbp88jNlXoLlB8ARxjVjPvYaaR1ui7NvP0AXP/l3apbPD?= =?us-ascii?Q?QPzsb1W99Q=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5b3c771-bb03-455c-34ff-08df08c096e2 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB5977.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2026 07:05:36.9040 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5olxT2tX6RIIAdoUTGLgAWDJm+d2dX5MSng6mlJsItQZvLLwhPH8DvDVk1MReyyXL8HsQd/KEgknMgi132X0kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9063 On 2026-09-02 at 15:21 +1000, Alistair Popple wrote... > On 2026-09-01 at 17:29 +1000, Danilo Krummrich wrote... > > On Tue Sep 1, 2026 at 7:09 AM CEST, Alistair Popple wrote: > > > On 2026-09-01 at 14:50 +1000, Dave Airlie wrote... > > >> > > > > >> > > We should make the NovaCoreApi just provide an accessor for &Spec and make every > > >> > > subsequent method we need public. Otherwise we end up with endless forwarding > > >> > > methods. We can also add as_raw() methods to the specific types as needed. > > >> > > > >> > Ok. This is where I don't have a good instinct for what we think should be an > > >> > accessor/forwarding method vs. where we should just expose the underlying data > > >> > structure and required methods to API users. > > >> > > > >> > In the past it seems there's been some resistance to exposing nova-core or gsp > > >> > data structures like this which is why I added the forwarding methods. In future > > >> > we're going to have other data-structures that NovaCoreApi will need to access > > >> > so it would be good to understand what we should do here so we can keep things > > >> > somewhat consistent. > > >> > > >> We can expose structure defined in nova-core, we cannot expose > > >> structures defined in gsp bindings or firmware. > > > > Yes, those structures are not even exposed to the nova-core layers we are > > dealing with here. > > > > There are the structures abstracting firmware interfaces, but despite exposing > > trivial cached values, they should not exposed to nova-drm either. > > > > Instead nova-drm should call into nova-core and ask it to do things on its > > behalf. > > > > More in general, the same is true for any other device resources. For instance, > > we also should not expose the pci::Device or the pci::Bar to nova-drm, but again > > provide a higher level API. > > > > > All the fields of self.gpu are structures defined as rust native structures in > > > nova-core. Their values may be decoded or derived from GSP responses, but by > > > design none of the raw structures from gsp bindings live in self.gpu AFAIK. > > > > We could indeed expose all values from struct Gpu directly and control > > everything through visibility, but ... > > > > >> In theory we can internally between core/drm but I'd really really > > >> like to keep that boundary as the limits of GSP for auditability > > >> purposes. > > > > ... exposing struct Gpu and controlling everything through visibility still > > means that we could easily miss some device resource being exposed directly to > > nova-drm, which also includes GSP abstractions. > > The individual fields would still need to be explicitly marked as `pub`, so it's > not like just exposing the top-level data structure suddenly exposes all these > device resources without them being explicitly marked as accessible. > > > So, I think we should provide accessors for the major structures that we > > intentionally want to expose (so we have an obvious boundary), but not for every > > single fields inside them. > > Sure, I don't really mind either way. I just figured that's what the point > of Rust visibiity was, to provide a simple boiler-plate free way of saying a > type/method/field was used externally. But will switch this to using accessors > for major data structures instead given that seems preferred. That said with the changes required for Invariant Gpu and being able to project Covariant fields out I can see why accessors for top-level data structures might be useful, particularly if some of them (eg. Spec) are Covariant. > > This is also why I said that we can expose an accessor for struct Spec, which I > > think serves as a good example. > > Ok, so just to double check are you happy with an accessor to return > gsp_static_info as well? Still interested in your thoughts here though, just to avoid churn because I'll probably pick the wrong answer :-) - Alistair > Thanks. > > - Alistair