From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: Scheduling of VCPUs and allocation of Guest Physical Memory Date: Fri, 06 Jun 2008 09:40:39 -0500 Message-ID: <48494C67.5090406@codemonkey.ws> References: <484795C3.8030603@cse.iitb.ac.in> <4847E205.4060605@codemonkey.ws> <4849483A.3030709@cse.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Sukanto Ghosh Return-path: Received: from hs-out-0708.google.com ([64.233.178.248]:27103 "EHLO hs-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756388AbYFFOk5 (ORCPT ); Fri, 6 Jun 2008 10:40:57 -0400 Received: by hs-out-0708.google.com with SMTP id 4so756374hsl.5 for ; Fri, 06 Jun 2008 07:40:54 -0700 (PDT) In-Reply-To: <4849483A.3030709@cse.iitb.ac.in> Sender: kvm-owner@vger.kernel.org List-ID: Sukanto Ghosh wrote: >>> ii) Who does the allocation of host physical memory to the guest, is >>> it KVM module or the associated QEmu process ? >> >> The QEMU process allocates the memory via malloc(). > Doesn't the QEMU process and the guest have different address-spaces ? > So, how can it malloc for the guest ? I thought the QEMU process > requests for the memory allocation to the kvm module via the /dev/kvm > device node. Yes, the guest has a different address space from the host. The QEMU process malloc()'s the physical memory for the guest, and tells KVM what the region is (via an ioctl to /dev/kvm). When the guest tries to create an address space mapping a guest VA to a guest PA, KVM will build that mapping by using virtual memory allocated by QEMU. To do this, it uses the mapping to translate guest PA to host PA. Then it will build an address space for the guest mapping guest VA to host PA. Regards, Anthony Liguori > > Thanks and regards > Sukanto > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html