Anthony Liguori wrote:
> Avi Kivity wrote:
>> Anthony Liguori wrote:
>>> Avi Kivity wrote:
>>>> Anthony Liguori wrote:
>>>>  
>>>>> I think it's just a matter of calling do_mmap() with the 
>>>>> appropriate parameters.  It looks likes there's some drivers call 
>>>>> do_mmap() directly.
>>>>>
>>>>>       
>>>>
>>>> This will halve the maximum size of virtual machines on i386 since
>>>> userspace will also mmap() the memory, and the virtual address 
>>>> space is
>>>> restricted to 3GB.
>>>>   
>>>
>>> I wonder if there is a way to force the mmap() to return the 
>>> userspace address we previously allocated.
>>>
>>
>> Yes:
>>
>>>
>>> unsigned long
>>> get_unmapped_area(struct file *file, unsigned long addr, unsigned 
>>> long len,
>>>                 unsigned long pgoff, unsigned long flags)
>>> {
>>>         unsigned long (*get_area)(struct file *, unsigned long,
>>>                                   unsigned long, unsigned long, 
>>> unsigned long);
>>>
>>>         get_area = current->mm->get_unmapped_area;
>>>         if (file && file->f_op && file->f_op->get_unmapped_area)
>>>                 get_area = file->f_op->get_unmapped_area;
>>>         addr = get_area(file, addr, len, pgoff, flags);
>
> Hrm, so you can return the area that should be used but you still 
> install vma_ops?  Wouldn't that result in an infinite loop when 
> userspace attempted to map the area since we'll try to satisfy the 
> nopage handler by doing a get_user_pages?

->nopage() should refer to the internal array in this case.

btw, while it seems that it is possible to override addr, it is not at 
all certain that it is legal to return a previously mapped area.

However, even if it isn't workable, I'm willing to live with the halved 
guest size limitation, since it's only for six month old userspace 
running large guests on i386.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to