LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-13-2011, 03:59 PM   #1
imoraru
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mapping contiguous kernel memory to user space jp03833 Linux - Kernel 0 08-29-2009 08:54 AM
Linux Virtual memory mapping to Board memory map !rajkums! Linux - Kernel 4 10-19-2008 12:27 PM
Kernel virtual memory map TO Board memory map -----> Mapping !rajkums! Linux - Embedded & Single-board computer 0 10-18-2008 09:21 AM
mapping contiguous kernel memory to user space nili Linux - Kernel 4 01-29-2008 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration