Mapping write-combining driver memory with PAT - Linux kernel 2.6.37
I need to run a memory test where the CPU is using the write-combining memory access protocol for a range of user-space pages (mapped to RAM).
I was able to set write-combining in kernel space by using set_memory_wc. I then tried to map that memory to user-space (as part of the mmap handler for a character device):
set_memory_wc((unsigned long)vmalloc_area_ptr, 1);
pfn = vmalloc_to_pfn(vmalloc_area_ptr);
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
remap_pfn_range(vma, vma->vm_start, pfn, PAGE_SIZE, vma->vm_page_prot);
This however results in the memory being mapped write-back (the normal memory access protocol). I tried it for both Linux kernel versions 2.6.37 and 2.6.39, with the same result.
Any ideas what I'm doing wrong? Thanks!
|