Re: [PATCH v10 12/21] gpu: nova-core: mm: Add unified page table entry wrapper enums

Joel Fernandes
2026-04-13T22:28:02Z

On 4/13/2026 4:10 PM, Joel Fernandes wrote:
> Hi Danilo,
>
> On 4/9/2026 7:00 AM, Danilo Krummrich wrote:
>> On Thu Apr 9, 2026 at 12:33 PM CEST, Joel Fernandes wrote:
>>> Since it is 3 against 1 here, I rest my case :-).
>>
>> That's not how I'd view it. :)
>>
>> Anyways, in case I'm included in "3", that's not my position. My point was to
>> ensure we keep discussing advantages and disadvantages on their merits, as I
>> think you both have good points.
>
> Heh, yes I actually *did not* include you in the 3 since you sounded to be open
> to both. ;-)
>
>>
>>> I am still in disagreement since I do not see much benefit (that is why I said
>>> pointless above).
>>
>> That is fair -- in this case please explain why the advantages pointed out by
>> others are not worth it, propose something that picks up the best of both
>> worlds, etc.
>>
>> You can also turn it around and ask people whether they can tweak their counter
>> proposal to get rid of specific parts you dislike for a reason.
>>
>> IOW, keep the ball rolling, so we can come up with the best possible solution.
>
> Good advice, thanks! I will try to come up with something that is acceptable to
> everyone and we can further debate pros/cons on v11.
>
> There are some merits on the alternative proposal from Eliot/Alex that I'd like
> to explore while seeing if I can keep some of the merits in mine as well.
I think I found a nice approach. IMO the MMU version dispatch does not belong in
Vmm/BarUser layers. Those are version-independent code. However I agree that
doing version dispatch at every low-level page table operation is a bit heavy on
matches (if we put the MMIO overhead counter-argument aside).

So how about the following approach?

PtWalk, PtMap and everything below it are monomorphized. Vmm and BarUser are
not. Version dispatch is handled on PtWalk and PtMap entry points.

I think it makes it cleaner and splits the code up better too and the
organizations makes sense because the version differences are related to page
tables, not to generic concepts like Vmm and Bar.

Thoughts? Here is a preview:
https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git/commit/?h=pt-traits-v2&id=ff22ba64f729f9f73258777231763a7b9804123b

thanks,

--
Joel Fernandes