From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: R/W HG memory mappings with kvm? Date: Thu, 30 Jul 2009 12:31:46 +0300 Message-ID: <4A716882.5020408@redhat.com> References: <5f370d430907051541o752d3dbag80d5cb251e5e4d00@mail.gmail.com> <4A51A9F0.7000909@redhat.com> <5f370d430907071523t120da246wf366dbfbbac9169b@mail.gmail.com> <4A54225F.1050703@redhat.com> <4A551387.3000702@cs.ualberta.ca> <5f370d430907081501m60064c7dp23ebd4153c9050f1@mail.gmail.com> <5f370d430907262256rd7f9fdalfbbec1f9492ce86@mail.gmail.com> <4A6DBE54.3080609@cs.ualberta.ca> <5f370d430907271432y5283c2cat7673efeed0febe20@mail.gmail.com> <4A6EBCB3.4080804@redhat.com> <4A70E0DB.5020200@cs.ualberta.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Stephen Donnelly , "kvm@vger.kernel.org list" To: Cam Macdonell Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45059 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbZG3J1A (ORCPT ); Thu, 30 Jul 2009 05:27:00 -0400 In-Reply-To: <4A70E0DB.5020200@cs.ualberta.ca> Sender: kvm-owner@vger.kernel.org List-ID: On 07/30/2009 02:52 AM, Cam Macdonell wrote: >> You need a variant of qemu_ram_alloc() that accepts an fd and offset >> and mmaps that. A less intrusive, but uglier, alternative is to call >> qemu_ram_alloc() and them mmap(MAP_FIXED) on top of that. > > > Hi Avi, > > I noticed that the region of memory being allocated for shared memory > using qemu_ram_alloc gets added to the total RAM of the system > (according to /proc/meminfo). I'm wondering if this is normal/OK > since memory for the shared memory device (and similarly VGA RAM) is > not intended to be used as regular RAM. qemu_ram_alloc() and the guets /proc/meminfo are totally disconnected. I don't understand how that happened. > > Should memory of devices be reported as part of MemTotal or is > something wrong in my use of qemu_ram_alloc()? You can call qemu_ram_alloc() all you like. Guest memory is determined by the e820 map, which is in turn determined by the -m parameter. -- error compiling committee.c: too many arguments to function