On Wed, Jan 19, 2022 at 08:36:35AM -0400, Jason Gunthorpe wrote: > On Wed, Jan 19, 2022 at 01:54:32AM +0000, lizhijian@xxxxxxxxxxx wrote: [snip] > > > > IMHO, for the rxe, rxe_mr_init_user() will call get_user_page() to pin iova first, and then > > the page address will be recorded into mr->cur_map_set->map[x]. So that when we want > > to reference iova's kernel address, we can call iova_to_vaddr() where it will retrieve its kernel > > address by travel the mr->cur_map_set->map[x]. > > That flow needs a kmap > > > Do you mean we should retrieve iova's page first, and the reference the kernel address by > > kmap(), sorry for my stupid question ? > > Going from struct page to something the kernel can can touch requires > kmap kmap() the call is being deprecated. Please use kmap_local_page() if possible. https://lore.kernel.org/lkml/20211210232404.4098157-1-ira.weiny@xxxxxxxxx/ Thanks, Ira