[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42A44181-C64E-4804-95BC-828D0C604A89@nvidia.com>
Date: Tue, 21 Oct 2025 21:58:36 +0000
From: Joel Fernandes <joelagnelf@...dia.com>
To: John Hubbard <jhubbard@...dia.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"dakr@...nel.org" <dakr@...nel.org>, Alexandre Courbot <acourbot@...dia.com>,
Alistair Popple <apopple@...dia.com>, Miguel Ojeda <ojeda@...nel.org>, Alex
Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo
<gary@...yguo.net>, "bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, David
Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Maarten
Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, Timur Tabi
<ttabi@...dia.com>, "joel@...lfernandes.org" <joel@...lfernandes.org>, Elle
Rhumsaa <elle@...thered-steel.dev>, Daniel Almeida
<daniel.almeida@...labora.com>, "nouveau@...ts.freedesktop.org"
<nouveau@...ts.freedesktop.org>
Subject: Re: [PATCH 7/7] nova-core: mm: Add data structures for page table
management
> On Oct 21, 2025, at 4:30 PM, John Hubbard <jhubbard@...dia.com> wrote:
>
> On 10/21/25 11:26 AM, Joel Fernandes wrote:
>>> On 10/20/2025 4:59 PM, John Hubbard wrote:
>>>> On 10/20/25 11:55 AM, Joel Fernandes wrote:
>>> ...
>> Yes, there's different format versions.
>>
>> This patch supports all Turing and later GPUs because all GPUs including Hopper+
>> are backward compatible with version 1. However they wont be able to use the
>> version 2 and 3 features with only this patch.
>>
>> I kind of intentionally did this for a first cut. But yes, I could split it into
>> versions. The 3 MMU structures (PTE, PDE and Dual PDE) are versioned. Version 2
>> is Turing and later. Hopper+ is when Version 3 got introduced and it is also
>
> Ah, then we shouldn't even do version 1. We should take full advantage of
> the fact that Nova's earliest GPU is Turing.
Makes sense, though one advantage of just defining version 1 too is it may
be a good reference or a fallback should we ever need it (Especially since it
took me 2 months to be get my nova-core MMU code working and it may be
nice to have a fallback. Let me think about it, I believe it will be just few more
lines of code, so should not be that bad.)
>
>> backward compatible with Version 2.
>>
>> We could eventually support versions 2 and 3 (instead of just version 1 as I am
>> doing), however my working MMU translation prototype is based on version 1 (I
>> did not have to configure anything in the MMU to switch versions, this was default).
>>
>> There are a couple of options:
>>
>> 1. For starters, support only version 1. Drawback is, when/if we want to use
>> version 2 and 3 features, it may require some rework.
>>
>> 2. Have the following hierarchy:
>> mm/types.rs - all common structures (stuff that is generic like Pfn).
>> mm/types/ver1.rs - Version 1 specific types.
>> mm/types/ver2.rs - Version 2 specific types.
>> mm/types/ver3.rs - Version 3 specific types.
>
> Maybe a file/directory structure that more directly indicates page table
> formats. "mm/types" could be quite a few things.
>
Agreed, though mm/types also contains other non-pagetable structures.
I could prefix ver1/2/3 with page_tables_, so it would be like:
mm/types/page_tables_ver{1,2,3}.rs. That is much more clear.
>
>> version (which is reasonable).
>>
>> 5. Your options here.
>>
>> Btw, I used Nouveau as a reference as well, so likely Nouveau doesn't support
>> version 2 and 3 features. Not that that matters (we should support newer
>> features in nova-core), but just thought I'd mention it.
>>
>> Other thoughts?
>
> Two things:
>
> 1) Danilo is working on writing down locking requirements for Nova page
> tables, based on earlier experience with Nouveau page table locking
> problems, which were apparently very serious.
Sure, though I believe it should not block these patches because we are
not yet designing higher level users. These patches just expose the structures
and things like locking should be built at a higher level. I believe Danilo
is referring to page table look ups and updates, that will a different module
outside of types.
> 2) Maybe it would be good to start with versions 2 and 3, so that we
> can see how to do >1 version?
Yes I will start with version 2, 3. If version 1 is simple, I may include that
in too for the benefit of my working prototype if that is Ok :) Worst case,
we have to just delete an extra file should be not need it :)
thanks,
- Joel
>
> thanks,
> --
> John Hubbard
>
Powered by blists - more mailing lists