From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010054.outbound.protection.outlook.com [40.93.198.54]) (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 5CF19202961; Mon, 20 Oct 2025 18:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.54 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760986554; cv=fail; b=Icvsyr1O9nW+fIbQ0eDms35ZiPwWpkyajNjICv2m8xs4YFaEO7UOLEgFCTl2TvOJ0WP9Bxj10sSgu7UYBPOTDlrIP6q87ERrEH6jr1socbnaBPhj6hi3I3MsPujFPeP4tSRRXNDIUY20ztqEOXtyadJ9qM8OMZxS8sOUcRYvuvM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760986554; c=relaxed/simple; bh=yY9MHzTWlY+bgNbZCtmWdeRlSDLM6qfOrt4u8QXg8fM=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=bbc4JjcKNErLEfONPSleg89Xt/TNsHHagcfbVT3Tw6oB6V4u5tNTmgEX60vu8VnwkVMTlkyCri0vYLMvEeuOLtRFBZJSpuPppPCMsDc0P881dZ/v0slWiBFUg8WLULo/IckGnBniCwxKi0OoMfXWov8JzHSyyHcmbemSg2T7OCU= 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=BHqs+9HW; arc=fail smtp.client-ip=40.93.198.54 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="BHqs+9HW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bv7+HxyNttoo5HCmKVMEw6eSzj8qHd+719nFY3SHOMepUqp3aHOX06kQI1Qix4EE5PGYWa5IIJEDEF7Y8z/cpt8B2x7Aw3YNi8X3HkxSx0NbPOBwPwdTnD3To0rJBdFb0ab+Y9GGdb7BcHpuaP5vlBQ6ul/PzV9RTD3oRhtEGITPdKE7g940inBh0IJnAgn6bI6ZOKzS1GkmXotWpazlFD2H29rwVfQFtX2pcB1YyF6jwOzqVHQ/UWOp40zbskYCdKeT7Y2qUybKtmV2WuXT21TosRBcCCruL2rfoPdUL0PNwL29vszKKom30gD6p8PeqtluUChZsbXWisU0f1kV/A== 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=S+U0pBSSOrevwROIXWur0DwW26sZm/I6PuFpMt3oyNg=; b=Jzz2vFqssKTJuOCQqCmgALPBiDcnRR4FwYHk1u7dwefYwoVYHHeHrh47/HF6MZczdUFZbYqlSbXHQw0KCRK4OVftSE1Lnb19gJS8v367ZGOivO2KtvDETRyTDuD5y3eBrwklPUISuIGDZlAKwONEWzjcmLzwddijS/JUtINmn9Q7nOfaAhYjKJze7wxSzRvGN6McNHRpz3rHCC4/4+NZLya1/AzStSXMqC7z6WyPbfK2uqqALz9SkFpqr9nFKLxgDPKEBChBDN0dMXPkXK48qTaRJSqckoarW9KbFM61e/BcWmKtFtTALtKY10KmxCOuZ9h4qIHXAsWHu/s1PR6W6Q== 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=S+U0pBSSOrevwROIXWur0DwW26sZm/I6PuFpMt3oyNg=; b=BHqs+9HWb7YRFTvaadsAa9tEpvb6+pYzfkuhZ9ggw6N0JzHelSQOMmh60C1TznKfmicbbZWB/64mThYnaMudSyiSqL0NOHr9pAAufY0Mv2N87JkkRf51JE1mPn5XBlhEXb1n5PbSF3Ft9xpclpyT6duqeqtJIH4oCfgJXpjj1I9OohX1CiBn4MUyzAOx24aIwSlGbYwsmj9EmMkpXFAijrb0G5msPyMe+bWG9z0QBOURWtkFvH9bxbjA7iaAGmxwvmi9fYZnyi5uPAzNzm1yiUaWGBb/BQYmjjvyPErz4PockBvBUvWMh3f9Hgxq83n9jeFZyjFdXK2K49+QpvYE6A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SN7PR12MB8059.namprd12.prod.outlook.com (2603:10b6:806:32b::7) by CH3PR12MB9316.namprd12.prod.outlook.com (2603:10b6:610:1ce::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9228.16; Mon, 20 Oct 2025 18:55:49 +0000 Received: from SN7PR12MB8059.namprd12.prod.outlook.com ([fe80::4ee2:654e:1fe8:4b91]) by SN7PR12MB8059.namprd12.prod.outlook.com ([fe80::4ee2:654e:1fe8:4b91%2]) with mapi id 15.20.9228.015; Mon, 20 Oct 2025 18:55:47 +0000 From: Joel Fernandes To: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, dakr@kernel.org, acourbot@nvidia.com Cc: Alistair Popple , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , bjorn3_gh@protonmail.com, Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , John Hubbard , Joel Fernandes , Timur Tabi , joel@joelfernandes.org, Elle Rhumsaa , Daniel Almeida , nouveau@lists.freedesktop.org Subject: [PATCH 0/7] Pre-requisite patches for mm and irq in nova-core Date: Mon, 20 Oct 2025 14:55:32 -0400 Message-Id: <20251020185539.49986-1-joelagnelf@nvidia.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BL1PR13CA0393.namprd13.prod.outlook.com (2603:10b6:208:2c2::8) To SN7PR12MB8059.namprd12.prod.outlook.com (2603:10b6:806:32b::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR12MB8059:EE_|CH3PR12MB9316:EE_ X-MS-Office365-Filtering-Correlation-Id: f8ab71a5-1ad3-43e8-cc97-08de100a47a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?cUAuiN8gFu8UxXEQ9O+Bl3G6tJzHn7wd5zZx94vnBXBA4rcWo3w+kJR/CrHM?= =?us-ascii?Q?BTnUKi50ZeO6w6kgmwFvGtd0gyctsqMyss8dCev10jkt5Ioiuu9jd95MKcyO?= =?us-ascii?Q?YgiGvWoYy+J16ZybGoEl8xhyfeWea1Cm3tyfF25vXexb6JVogirymtt4bEKy?= =?us-ascii?Q?oxwyoC9Vg1MBWcEBAxd+EhJnF2Dkj/oPZSqRv8uaPYX5IJmd75rUfxy2EQ+d?= =?us-ascii?Q?GdmMSTUq0YnSrb8R7/fafV7+q8OXO/B6H1v5CeqDeUlP61/2pBhlWJsL7NgD?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wqI7GOiZALqh11gAXx1hgfTRKsdW?= =?us-ascii?Q?MdRIk6VCmyQw7cnFKHttxwffdZ6G9nCgWTx/OoettkVhw9VkibzJiZg3AYoz?= =?us-ascii?Q?LJgJ9ibApI1sgGVyCABPi3dG9G4wJYhcO3La88n7sPNJHugzxuqBclXqqDFu?= =?us-ascii?Q?DcB9TZtjwE5n6A1Ek2peZ9Jp7UkC3rJMnRtTVxblTRGUm+VD7c9pa9fK4woS?= =?us-ascii?Q?7Z7o0PrTnEhPpsCq+1qKOVSls6oh9/Ndzfp4QaLeGyfBBgOwYuL4pTnA2rxI?= =?us-ascii?Q?nDMRLRz6Nnc8l2G17Mg4+HTPt+DliHBq?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR12MB8059.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/rAwUGpPVptUDqB6yzlxdCMbTWhxOmexjOVrEybwZ/lgG/ww/ytUKPdeFkO6?= =?us-ascii?Q?KTKiafoD3l+9S9lyVR7G94ZncEm4Ai4qITQz8IPvsNDgksaHoslZhnypAFwv?= =?us-ascii?Q?Xs5DSsT7ag2ZAQmQZlLezlt/UJE/retxQUMFte4j68Kezmh262BUBX1WIVuZ?= =?us-ascii?Q?tqYrJsyEuEaEvO/RfP87CPk9Zv0BrYlBZzURrNaHHgmTQeBKoY26GCFcMW32?= =?us-ascii?Q?EOQb0FkZpmmv02xUfmMpzTUdETPo9nGxOaksLS8rEcErKBIKl1n2A9kBE53V?= =?us-ascii?Q?96Iz0cKkC/sscmAcXBhptYdV938HhGlk5aJIEK+ShvaG8tCagT7366DGrP/I?= =?us-ascii?Q?klfmCFhp1Nn9NHaIJog5/xwbwsxcxUUrjCbd5JO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2ZIbYJHUnL5+J36x+pQpEvdEbII/ot7M0ZQ8lkonQy6PM39O0xaQ?= =?us-ascii?Q?c1L/joN/Y3hBkfYmt0ZzkhDekpyzK9OAIcnZdGIEcLMOuYUeAEpwBxvD2oWR?= =?us-ascii?Q?R0Ffp2fu+JZKTemQHkNeVN/Iw6B2rCBulitYQQ/laE0w1gheun6Nn4VJPdKV?= =?us-ascii?Q?4+e/BIxEJ7V1rpmYIox3Oze9tf1llii6Spz0VBRgDDMIXeEjwYj1u+isjJ+G?= =?us-ascii?Q?D7kMsuBlb7A5mC6tQK8zmW6sGR2T8oNnl0p7kZ8O9p4APGdaiPBpv3XjrGeJ?= =?us-ascii?Q?jn+F06OUIchm5KdTozAOjXlnbpnyAHXNcFo4rdga?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8ab71a5-1ad3-43e8-cc97-08de100a47a0 X-MS-Exchange-CrossTenant-AuthSource: SN7PR12MB8059.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2025 18:55:47.2480 (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: GZIEHp46PIIjJH+OLWdHxtgVnbsXBcEK1yHSxmoQbVvwe0/VWgNIjubwGA0SRZOftsAVMV+fj1ffDIFOQntvZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9316 These patches have some prerequistes needed for nova-core as support is added for memory management and interrupt handling. I rebased them on drm-rust-next and would like them to be considered for the next merge window. I also included a simple rust documentation patch fixing some issues I noticed while reading it :). The series adds support for the PRAMIN aperture mechanism, which is a prerequisite for virtual memory as it is required to boot strap virtual memory (we cannot write to VRAM using virtual memory because we need to write page tables to VRAM in the first place). I also add page table related structures (mm/types.rs) using the bitfield macro, which will be used for page table walking, memory mapping, etc. This is currently unused code, because without physical memory allocation (using the buddy allocator), we cannot use this code as page table pages need to be allocated in the first place. However, I have included several examples in the file about how these structures will be used. I have also simplified the code keeping future additions to it for later. For interrupts, I only have added additional support for GSP's message queue interrupt. I am working on adding support to the interrupt controller module (VFN) which is the next thing for me to post after this series. I have it prototyped and working, however I am currently making several changes to it related to virtual functions. For now in this series, I just want to get the GSP-specific patch out of the way, hence I am including it here. I also have added a patch for bitfield macro which constructs a bitfield struct given its storage type. This is used in a later GSP interrupt patch in the series to read from one register and write to another. Joel Fernandes (7): docs: rust: Fix a few grammatical errors gpu: nova-core: Add support to convert bitfield to underlying type docs: gpu: nova-core: Document GSP RPC message queue architecture docs: gpu: nova-core: Document the PRAMIN aperture mechanism gpu: nova-core: Add support for managing GSP falcon interrupts nova-core: mm: Add support to use PRAMIN windows to write to VRAM nova-core: mm: Add data structures for page table management Documentation/gpu/nova/core/msgq.rst | 159 +++++++++ Documentation/gpu/nova/core/pramin.rst | 113 +++++++ Documentation/gpu/nova/index.rst | 2 + Documentation/rust/coding-guidelines.rst | 4 +- drivers/gpu/nova-core/bitfield.rs | 7 + drivers/gpu/nova-core/falcon/gsp.rs | 26 +- drivers/gpu/nova-core/gpu.rs | 2 +- drivers/gpu/nova-core/mm/mod.rs | 4 + drivers/gpu/nova-core/mm/pramin.rs | 241 ++++++++++++++ drivers/gpu/nova-core/mm/types.rs | 405 +++++++++++++++++++++++ drivers/gpu/nova-core/nova_core.rs | 1 + drivers/gpu/nova-core/regs.rs | 39 ++- 12 files changed, 996 insertions(+), 7 deletions(-) create mode 100644 Documentation/gpu/nova/core/msgq.rst create mode 100644 Documentation/gpu/nova/core/pramin.rst create mode 100644 drivers/gpu/nova-core/mm/mod.rs create mode 100644 drivers/gpu/nova-core/mm/pramin.rs create mode 100644 drivers/gpu/nova-core/mm/types.rs -- 2.34.1