From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lamia Youseff Subject: Problem using alloc_vm_area() Date: Wed, 22 Oct 2008 19:28:35 -0700 Message-ID: <48FFE153.4020706@cs.ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi all, I am having trouble mapping an area allocated by vmalloc_alloc_area to user space. I would appreciate any help or hint on what i might be missing in my implementation. Inside my device_mmap, this is what i do. I first allocate memory using 1. mem = alloc_vm_area( 1 * PAGE_SIZE ); then i get pfn using vmalloc_to_pfn, 2. pfn = vmalloc_to_pfn((struct vm_struct*)mem)->addr); then, i try to map it using 3. ret = remap_pfn_range(vma, vma->start, pfn, PAGE_SIZE, PAGE_SHARED); Although remap_pfn_range does not return an error, the DomU kernel randomly crashes, or if it worked, it is not mapped to user-space correctly. I need your advise on line 2 & 3, if possible. Please, let me know if i can provide more information, Thank you, -- Lamia