Please find my responses & questions in line.
Thx,

Venkat


-----Original Message-----
From: Avi Kivity [mailto:[email protected]] 
Sent: Wednesday, May 06, 2009 4:42 PM
To: Kumar, Venkat
Cc: [email protected]
Subject: Re: Allocating Extra Memory To Guest

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).

==> 
If kvm-85 is the latest version, I still see "qemu_alloc_physram" invoked to 
allocate memory. This piece of code is in qemu/vl.c.
===================================================================
phys_ram_base = qemu_alloc_physram(phys_ram_size);
    if (!phys_ram_base) {
        fprintf(stderr, "Could not allocate physical memory\n");
        exit(1);
    }
====================================================================

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.

==> 
I want to allocate extra RAM for the guest apart from memory allocated through 
"qemu_alloc_physram". Let's assume that I have allocated some RAM for guest 
through "qemu_alloc_physram" call and some more memory through "malloc or 
mmap", how will I register these two virtually discontinuous memory regions 
with KVM?

> 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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to