On Tue, Mar 18, 2025 at 09:37:42AM +0100, Christian König wrote: > Hi Matthew, > > you actually got your understanding exactly inverted :) Thanks; that's very helpful! > Amdgpu takes a look at page->mapping to make sure they are *not* coming from the call sequence starting with amdgpu_ttm_tt_set_user_pages() or be imported from another driver through DMA-buf etc... > > The only pages which are allowed to pass this check are the private driver allocated ones, see this code function amdgpu_ttm_tt_populate(): > > for (i = 0; i < ttm->num_pages; ++i) > ttm->pages[i]->mapping = bdev->dev_mapping; > > So far that has been save since nobody else should be using the address space object from our drivers inode under /dev. > > But when you plan to remove page->mapping we probably have a problem here. OK. This makes the problem a lot more tractable.