[Nouveau] [PATCH v3 4/5] nouveau/hmm: support mapping large sysmem pages

2020-07-01 Thread Ralph Campbell
Nouveau currently only supports mapping PAGE_SIZE sized pages of system memory when shared virtual memory (SVM) is enabled. Use the new hmm_pfn_to_map_order() function to support mapping system memory pages that are PMD_SIZE. Signed-off-by: Ralph Campbell ---

[Nouveau] [PATCH v3 0/5] mm/hmm/nouveau: add PMD system memory mapping

2020-07-01 Thread Ralph Campbell
The goal for this series is to introduce the hmm_pfn_to_map_order() function. This allows a device driver to know that a given 4K PFN is actually mapped by the CPU using a larger sized CPU page table entry and therefore the device driver can safely map system memory using larger device MMU PTEs.

[Nouveau] [PATCH v3 3/5] nouveau: fix mapping 2MB sysmem pages

2020-07-01 Thread Ralph Campbell
The nvif_object_ioctl() method NVIF_VMM_V0_PFNMAP wasn't correctly setting the hardware specific GPU page table entries for 2MB sized pages. Fix this by adding functions to set and clear PD0 GPU page table entries. Signed-off-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c

[Nouveau] [PATCH v3 2/5] mm/hmm: add hmm_mapping order

2020-07-01 Thread Ralph Campbell
hmm_range_fault() returns an array of page frame numbers and flags for how the pages are mapped in the requested process' page tables. The PFN can be used to get the struct page with hmm_pfn_to_page() and the page size order can be determined with compound_order(page) but if the page is larger

[Nouveau] [PATCH v3 1/5] nouveau/hmm: fault one page at a time

2020-07-01 Thread Ralph Campbell
The SVM page fault handler groups faults into a range of contiguous virtual addresses and requests hmm_range_fault() to populate and return the page frame number of system memory mapped by the CPU. In preparation for supporting large pages to be mapped by the GPU, process faults one page at a

[Nouveau] [PATCH v3 5/5] hmm: add tests for hmm_pfn_to_map_order()

2020-07-01 Thread Ralph Campbell
Add a sanity test for hmm_range_fault() returning the page mapping size order. Signed-off-by: Ralph Campbell --- lib/test_hmm.c | 4 ++ lib/test_hmm_uapi.h| 4 ++ tools/testing/selftests/vm/hmm-tests.c | 76 ++ 3 files