RE: Allocating Extra Memory To Guest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please find my responses & questions in line.
Thx,

Venkat


-----Original Message-----
From: Avi Kivity [mailto:avi@xxxxxxxxxx] 
Sent: Wednesday, May 06, 2009 4:42 PM
To: Kumar, Venkat
Cc: kvm@xxxxxxxxxxxxxxx
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux