Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

Mmap a writecombine region to userspace documentation

$
0
0

According to the following documentationhttps://www.kernel.org/doc/html/latest/x86/pat.html,

Drivers wanting to export some pages to userspace do it by using mmap interface and a combination of:

pgprot_noncached()

io_remap_pfn_range() or remap_pfn_range() or vmf_insert_pfn()

Note that this set of APIs only works with IO (non RAM) regions. If driver wants to export a RAM region, it has to do set_memory_uc() or set_memory_wc() as step 0 above and also track the usage of those pages and use set_memory_wb() before the page is freed to free pool.

Why is the extra step set_memory_uc() or set_memory_wc() needed for RAM regions?


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>