MMU fault - MarekBykowski/readme GitHub Wiki

HOME » MMU fault

If CONFIG_HAVE_IOREMAP_PROT. arm64 doesn't have

  • generic_access_phys() is a generic fault handler for vma
  • follow_phys() does a page table walk to find the pte followed by phys from virt for EL0. It is what I wanted to do with at s1e0r (Address Translate Stage 1 EL0 Read). Note, it is for a raw pte (aka without "struct page" just pure PFN) or for VM_IO (memory mapped IO) and as a result not for a normal memory.

VMA and page faulting

  • initally motivated from ipumm_main.c
  • desciption in LDD Chapter 15: Memory Mapping and DMA
  • another example in sound/core/pcm_native.c

If you need to have multiple large and physically contiguous buffers mapped into one virtually contiguous area, you cannot use dma_mmap_coherent, so you have to do this the hard way:

Call dma_alloc_coherent as often as you need it; in your mmap implementation, just set vm_area_struct->vm_ops; in vm_operations_struct.fault, call virt_to_page, call get_page, and set vm_fault->page to the page. For an example, see sound/core/pcm_native.c