Re: [PATCH RFC v6 14/26] nova-core: mm: Add TLB flush support

Joel Fernandes
2026-01-21T18:45:26Z

Hello, Zhi,

On 1/21/2026 4:59 AM, Zhi Wang wrote:
> On Tue, 20 Jan 2026 15:42:51 -0500
> Joel Fernandes <joelagnelf@nvidia.com> wrote:
>
>> Add TLB (Translation Lookaside Buffer) flush support for GPU MMU.
>>
> The same concern as in PATCH 5, guess we need to think of concurrency for
> TLB flush.

Will change:
pub(crate) fn flush(&self, pdb_addr: VramAddress)

to:
pub(crate) fn flush(&mut self, pdb_addr: VramAddress)

and also changing in mm/mod.rs:
pub(crate) fn tlb(&self) -> &Tlb {
to:
pub(crate) fn tlb(&mut self) -> &mut Tlb.

Since TLB operations modify registers, that does make sense to me.

For the buddy allocator, however, I am locking internally so I left it as is:
/// Access the [`GpuBuddy`] allocator.
pub(crate) fn buddy(&self) -> &GpuBuddy {
&self.buddy
}

--
Joel Fernandes