From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/4] Swapping Date: Sun, 14 Oct 2007 18:08:26 +0200 Message-ID: <47123EFA.1010808@qumranet.com> References: <47102919.6070802@qumranet.com> <471124D4.3090901@codemonkey.ws> <471126D9.4030204@qumranet.com> <47112D66.4020500@qumranet.com> <47115207.3090909@codemonkey.ws> <4711542F.2060306@qumranet.com> <4711563D.8020000@codemonkey.ws> <4711B101.7070305@qumranet.com> <47122E57.7060308@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Anthony Liguori Return-path: In-Reply-To: <47122E57.7060308-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org 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); -- 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/