public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Sukanto Ghosh <sukanto@cse.iitb.ac.in>
Cc: kvm@vger.kernel.org
Subject: Re: Scheduling of VCPUs and allocation of Guest Physical Memory
Date: Fri, 06 Jun 2008 09:40:39 -0500	[thread overview]
Message-ID: <48494C67.5090406@codemonkey.ws> (raw)
In-Reply-To: <4849483A.3030709@cse.iitb.ac.in>

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


  reply	other threads:[~2008-06-06 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  7:29 Scheduling of VCPUs and allocation of Guest Physical Memory Sukanto Ghosh
2008-06-05 12:54 ` Anthony Liguori
2008-06-06 14:22   ` Sukanto Ghosh
2008-06-06 14:40     ` Anthony Liguori [this message]
2008-06-09 11:10       ` Sukanto Ghosh
2008-06-09 16:19         ` Avi Kivity
2008-06-16 14:23           ` Sukanto Ghosh
2008-06-18 14:12             ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48494C67.5090406@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --cc=sukanto@cse.iitb.ac.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox