From: Sukanto Ghosh Subject: Re: Scheduling of VCPUs and allocation of Guest Physical Memory Date: Mon, 09 Jun 2008 16:40:07 +0530 Message-ID: <484D0F8F.4010807@cse.iitb.ac.in> References: <484795C3.8030603@cse.iitb.ac.in> <4847E205.4060605@codemonkey.ws> <4849483A.3030709@cse.iitb.ac.in> <48494C67.5090406@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from smtp1.iitb.ac.in ([203.78.217.177]:35933 "HELO smtp1.iitb.ac.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1759061AbYFILG5 (ORCPT ); Mon, 9 Jun 2008 07:06:57 -0400 Received: from [10.105.41.67] (unknown [10.105.41.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.iitb.ac.in (Postfix) with ESMTP id D1EC4138E5 for ; Mon, 9 Jun 2008 16:36:48 +0530 (IST) In-Reply-To: <48494C67.5090406@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori wrote: > 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). Why does the QEMU process needs to malloc() the physical memory for the guest ? Why can't it be done by the kernel itself ? Is it because the said pages will be sharable between the QEMU process and the guest, which will aid the QEMU process while performing DMA. Also, when and how are host-initiated virtual interrupts delivered? I guess, that it is done at the time of VM-entry. But what about the interrupts that need to be delivered immediately and while the VM is executing (assume interrupts are enabled in the guest). Is any kind of signal-based mechanism employed to force a VM-exit ? Thanks and Regards, Sukanto Ghosh