From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Allocating Extra Memory To Guest Date: Wed, 06 May 2009 14:12:25 +0300 Message-ID: <4A017099.20305@redhat.com> References: <3D9CB4061D1EB3408D4A0B910433453C030BABAFBC@inbmail01.lsi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: "Kumar, Venkat" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59593 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759424AbZEFLND (ORCPT ); Wed, 6 May 2009 07:13:03 -0400 In-Reply-To: <3D9CB4061D1EB3408D4A0B910433453C030BABAFBC@inbmail01.lsi.com> Sender: kvm-owner@vger.kernel.org List-ID: Kumar, Venkat wrote: > Hi, > > 1. How should we allocate extra memory to guest other than memory allocated through "qemu_alloc_physram"?? > qemu_alloc_physram() is obsolete. I've just removed it to avoid confusion (and a warning). I presume you want to give kvm memory which is not real RAM - from a host device? hw/device-assignment.c does that. Please clarify what you want to do. > 2. How to register the extra allocated memory with KVM? > cpu_register_physical_memory(), but that has to come from qemu_ram_alloc(). As a hack, you can call qemu_ram_alloc(), and then mmap(qemu_ram_ptr(ram_offset), ... ) to replace the RAM with device memory. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.