From mboxrd@z Thu Jan 1 00:00:00 1970 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 3DC51CA1012 for ; Thu, 4 Sep 2025 11:26:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BFEC10E9FA; Thu, 4 Sep 2025 11:26:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.b="VJ2xwthp"; dkim-atps=neutral Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2068.outbound.protection.outlook.com [40.107.223.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFBF610E9F3; Thu, 4 Sep 2025 11:26:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wGZA1anPpB07LWwGdg35roOKB0CXJKu4py5h8XjN8haKRgkb+rB4LrNJ++pCS/hbexhEYp2cqEipdcInop3xA8QPsy2y/ygxF2qMhGY1BPuhcWfUwSzQghqNWXnXnyAvWTdCnYUxC5OaqZcyPekx5tJhaM+1UO12mtUhiT5MnaBdTt08T1Jq1qHwushKpx+5DKw7T8uBIneaOrCfIdfGNmrSi1e7CE1sbuisLeSQtmILR/jIF7yNOcZEpvCPc4TGMxfhcVIBt8ot6EFxxFXc5Csrdx6BP61xobeW6GPx1hrchwkQn8zFHk8D9CNMQJysEGWE+h/hzPbXlwjbp1MCCw== 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=5/u4x6WK+zFniixH1WEjTFdxr9C/9X28mlYqUCHTd2c=; b=I3s6ZApuiuNDLIt1phX/RKb1AmaJhCREsvh5Wu33x/JK4gh4myDIorMDVprkUHyF9ZRWyD3mOV6hUSCnt9nnXQ2moakT3aydDy0dmrkGl88hbZNIOGrKAl/+Z6gssanbG0G8Zucf0DufxGXA+dJenssSGEfe7emRW9iTCNi8BpxmHQRx114dBVX1MSXKguF09ZuuYe5f6fsfdFf9c/EJJlN/HIMkuzcTMhJZ50L7GDZGECmJ88pYlXZ6PGJ6Ig3mCJdafeUVlS3MIL32XSMBNOZUDiRqTes98RZLKH0jNlTBE6r5bxuG6/C4Ss6RUMiaf25YL6g0GO0lVLHSvJsF4g== 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=5/u4x6WK+zFniixH1WEjTFdxr9C/9X28mlYqUCHTd2c=; b=VJ2xwthp05v6P4RSq09hWkzdP2K4PHhccQJCLhK9v4SGlTju1+ZJenrrc9Ih7pUjWZyTe5rNxaAbUUJxH78L7yR7gdb4znZ3vDsop249632RkBpD2cHkbjc9Sw8A4JPBB3XRJjGEBNEN58l5+zBQhYFtYWSSPoCQLMh0kuvmqIVAyVfaKSjgcucQG8yGlWTYipRJSXXh/nawTUVDeh7L6ypz7VUXyqnr++p+lktrLOuEhl0HmZBHSYwFwbQjc2xduHPHmUM5OZZiG4K9VJ3IKP/Pw2zmynvLjNXvIUNxFZlNmloYmI4kN70zqxfYRngIHNIGR4lxloZDIsHsTPWWeg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CH2PR12MB3990.namprd12.prod.outlook.com (2603:10b6:610:28::18) by SJ0PR12MB6928.namprd12.prod.outlook.com (2603:10b6:a03:47a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.27; Thu, 4 Sep 2025 11:26:38 +0000 Received: from CH2PR12MB3990.namprd12.prod.outlook.com ([fe80::6e37:569f:82ee:3f99]) by CH2PR12MB3990.namprd12.prod.outlook.com ([fe80::6e37:569f:82ee:3f99%3]) with mapi id 15.20.9052.027; Thu, 4 Sep 2025 11:26:38 +0000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 04 Sep 2025 20:26:34 +0900 Message-Id: Cc: , , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "David Airlie" , "Simona Vetter" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "John Hubbard" , "Joel Fernandes" , "Timur Tabi" , , , "Nouveau" Subject: Re: [PATCH 05/10] gpu: nova-core: gsp: Add GSP command queue handling From: "Alexandre Courbot" To: "Alistair Popple" X-Mailer: aerc 0.20.1-0-g2ecb8770224a-dirty References: <20250827082015.959430-1-apopple@nvidia.com> <20250827082015.959430-6-apopple@nvidia.com> <6vewssmsixzbghivrehmng7pyapmidh6nx5qjd2bzfr2orgeob@p2cni6gj75l3> In-Reply-To: <6vewssmsixzbghivrehmng7pyapmidh6nx5qjd2bzfr2orgeob@p2cni6gj75l3> X-ClientProxiedBy: TYWP286CA0017.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::10) To CH2PR12MB3990.namprd12.prod.outlook.com (2603:10b6:610:28::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB3990:EE_|SJ0PR12MB6928:EE_ X-MS-Office365-Filtering-Correlation-Id: 595642ef-3c64-4b19-fdc4-08ddeba5e9b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|366016|10070799003|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OE5aV1RGZHRzZUE0eWRjR244bE15a1dZV290cmVLUE1NZTk2SHhuN2djd0dj?= =?utf-8?B?WHA3UENKbys2UzNwSkNmNDIySVM1V2pEbURnQmZ3N0lKVDFmTy84U2VyY0sy?= =?utf-8?B?SVFoN3FveVZ4akd0bGpRLzlZRTRVZXRyY0JqQkIxR1MrUFMwTWRsZG11RUUw?= =?utf-8?B?SUFLa2NMejRUc3M4eVpPQ0NTcFhIQWgwRUNONlBEZkp3TkkrSUtWWjR3TCtU?= =?utf-8?B?Z0FLQi82bVo3OXo4R2Z6S2tMaEhtVXJ5QzE5V3M1eWU5MC90cTk1a1JHQkFI?= =?utf-8?B?dXVkY2FOSU4zT2l4NmRwczVpT2RuTGhHQWdPclhsRXBjS0J6cVFrS2lOMCsv?= =?utf-8?B?Yjl0ZG5JamwwT01EWWRnQjM1NGZUYkNxd1BLQkt2dDdCY2tIRDZSSXYvOUwx?= =?utf-8?B?ZXZ5SWZBbk9mcmtyVHZwb1dVUWNLMXhtZlROOEY1Q0MvdXJiTGFId0ltc2tk?= =?utf-8?B?RG45RzRudXdyWW14cys3ZUN4ZXpBS0QwZHZqL0h2YkFNUjFQTU5YaVp1eUJI?= =?utf-8?B?WTEvOU5sMVlSdU5pRWR0ckh3VEtTbzMzWmkrTFk5RmNrZzAvTXNTUlROdFJE?= =?utf-8?B?dlkrelljQStGVTY1Sms4dTg5M3RkdmhMWXpYbEE0YzBHKzhJKzFhekRIN0Yv?= =?utf-8?B?dWZlYUw2YVpVL1BFRFZ6VFg4cUdyNzlRM25tNVlEWUpLK2V5RFR3cX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UHBmSVhFdXBOTXJUUHdX?= =?utf-8?B?UGVhL3Z5QVE2a0lLNEQ2aWI2U3h0bUxBeEhWMGtzSVRydG10L1lMVkdqMUMy?= =?utf-8?B?cVd1dng5V21JelhDQzFLRmlYNlptWlovQkl4WWdpcFBSV1RhM0kyaExyY3Z5?= =?utf-8?B?aGdRNGlmM2syRzVxM1dMUzFRVHdrRnU2dkkxbXkwTWpNdFI5VXZHZEJMSWVk?= =?utf-8?B?T3pnSFBVU0xCSkdxdjhkSWNNZmF1UE5KV2JEd2J2ejc0VktzeWwxZWdySVcy?= =?utf-8?B?dStSckxpUE1TNVhmNUo2RVhMRWszVHhTUndub0YvT2tsZ1RrQzc0UHd2N0Fw?= =?utf-8?Q?h6swY4jwzXw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB3990.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(1800799024)(366016)(10070799003)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b2F0R1FLY2NpeXNaY2Foc0RtQm81UDVZVUgzLzNjWHhsazdnSUlkZWQ1Sm9N?= =?utf-8?B?d1AwSmljUElSQURPWVIweDVwTHZQSlRsOTlSVTVCcmEvNkJVZXlnd2R4aVRk?= =?utf-8?B?K2Jvb25OZTBZNzVSRWFrbFRxVk5vNjdCMkJ4VHdlVjBsMlhBNVlJNkQ0WGY0?= =?utf-8?B?Sm05bW5QR29UYUh4Y2tkTkNWMXNHN2NtMXR6aW85L2YvZGJFTU9sc1F6TzVW?= =?utf-8?B?UTVIMTNQR1BJR3lWZXhYb24zSXd3bkRPbW9tMkZNZS96N2dSZlRobVgzTnUw?= =?utf-8?B?VWhneXN3WnU3U1lybWRmVE05ZXJicWtmTVc3RjNRWUVONlN2TU1MRGpOWVVJ?= =?utf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mloclBSdmMra1lPRnZVdHFa?= =?utf-8?Q?9ZhSg8jXII8STRCb/GkcsREolz7ZnNwH0fgNzpUIiNKI?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 595642ef-3c64-4b19-fdc4-08ddeba5e9b5 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB3990.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2025 11:26:38.3778 (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: /Cq76Brir75xXoa/hoSs65/E4THuTqh1rMIfTpk4zogQgHi6Q6KPHnyQ6kjQc0/77NY0cHmgZmUBykm0fmDfWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6928 X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Thu Sep 4, 2025 at 3:57 PM JST, Alistair Popple wrote: >> > +} >> > + >> > +// This next section contains constants and structures hand-coded fro= m the GSP >> > +// headers We could replace these with bindgen versions, but that's a= bit of a >> > +// pain because they basically end up pulling in the world (ie. defin= itions for >> > +// every rpc method). So for now the hand-coded ones are fine. They a= re just >> > +// structs so we can easily move to bindgen generated ones if/when we= want to. >> > + >> > +// A GSP RPC header >> > +#[repr(C)] >> > +#[derive(Debug, Clone)] >> > +struct GspRpcHeader { >> > + header_version: u32, >> > + signature: u32, >> > + length: u32, >> > + function: u32, >> > + rpc_result: u32, >> > + rpc_result_private: u32, >> > + sequence: u32, >> > + cpu_rm_gfid: u32, >> > +} >>=20 >> This is the equivalent of `rpc_message_header_v03_00` in OpenRM. The >> fact it is versioned makes me a bit nervous. :) If the layout change >> somehow, we are in for a fun night of debugging. This is where having an >> opaque abstraction built on top of a bindgen-generated type would be >> handy: if the layout changes in an incompatible way, when the >> abstraction would break at compile-time. > > Argh! I guess I wrote that before we were generating the headers and I ne= ver > thought to go back and change that. Will fix these to use the generated b= inding. > > I will sync up with you offline but I'm not really understanding the poin= t here. > If a bindgen generated type changes in some incompatible way wouldn't we = already > get a compile-time error? And if the bindgen generated type changes, what= 's to > say the rest of the logic hasn't also changed? > > Whilst I'm not totally opposed to something like this it just seems prema= ture > - the ABI is supposed to be stabalising and in practice none of the struc= tures > we care about appear to have changed in the 3 years since 525.53 was rele= ased. > So IHMO it would be better to just deal with these changes if (not when) = they > happen rather than try and create an abstraction now, especially as this = is only > supposed to become more stable. While I also hope we will achieve some level of ABI stability, I want to provision a bit just in case this goal turns out to be too idealistic. At the moment we are touching bindings internals a bit everywhere in the `gsp` module. As the driver matures, that trend can only continue - if one day we realize that we need a firmware version abstraction after all, it will get increasingly difficult (and time-consuming) to shoehorn back as time goes. It is much easier to do this from the start. Also, having a proper abstraction objectively results in better code. I will share the bits I have written with you for testing purposes, but I think you will agree that this makes the GSP module much cleaner, focused on the higher-level operations, while the lower-level code is divided into easy-to-understand methods, right next to the type they manipulate instead of being inlined as part of the sub-logic of another function. Even without the prospect of multiple firmware versions, it is worth doing. >> Doing so is valuable for clarity as well as future compatibility, as it >> clearly shows in a single page of code how the header is used. Here is >> all the code operating on it, in a single block instead of being spread >> through this file: >>=20 >> impl MsgqTxHeader { >> pub(crate) fn new(msgq_size: u32, msg_count: u32, rx_hdr_offset: u32)= -> Self { >> Self(bindings::msgqTxHeader { >> version: 0, >> size: msgq_size, >> msgSize: GSP_PAGE_SIZE as u32, >> msgCount: msg_count as u32, >> writePtr: 0, >> flags: 1, >> rxHdrOff: rx_hdr_offset, >> entryOff: GSP_PAGE_SIZE as u32, >> }) >> } >>=20 >> pub(crate) fn write_ptr(&self) -> u32 { >> let ptr =3D (&self.0.writePtr) as *const u32; >>=20 >> unsafe { ptr.read_volatile() } >> } >>=20 >> pub(crate) fn set_write_ptr(&mut self, val: u32) { >> let ptr =3D (&mut self.0.writePtr) as *mut u32; >>=20 >> unsafe { ptr.write_volatile(val) } >> } >> } > > Yes, this makes a lot of sense although I'm still not seeing the value of= the > [repr(transparent)] representation. Hopefully you can explain during out = sync > up ;) This type is shared with the GSP, so we must ensure that its layout is exactly the same as the C structure it wraps.