All of lore.kernel.org
 help / color / mirror / Atom feed
* Allocating Extra Memory To Guest
@ 2009-05-06  9:24 Kumar, Venkat
  2009-05-06 11:12 ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Kumar, Venkat @ 2009-05-06  9:24 UTC (permalink / raw)
  To: kvm@vger.kernel.org

Hi,

1. How should we allocate extra memory to guest other than memory allocated through "qemu_alloc_physram"??
2. How to register the extra allocated memory with KVM?

I have tried to allocate an extra one page to Guest but couldn't succeed; probably somebody had already done this exercise.

1. In Qemu/vl.c, I allocate a page for guest
	a. virt_addr = mmap(NULL, size, PROT_READ | PROT_WRITE,MAP_PRIVATE | 		MAP_ANON, -1, 0);

2. In "machine->init"
	a. ram_addr = qemu_ram_alloc(PAGE_SIZE);
	b.cpu_register_physical_memory(below_4g_mem_size,PAGE_SIZE,ram_addr+of	fset); (offset is the difference between the qemu's virtual address 	got from mmap and qemu's last virtual address allocated through 	"qemu_alloc_physram"

3. Increase "phys_ram_size" and "ram_size" by one page.

Did I miss something here?

Thx,

Venkat



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-06 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-06  9:24 Allocating Extra Memory To Guest Kumar, Venkat
2009-05-06 11:12 ` Avi Kivity
2009-05-06 12:09   ` Kumar, Venkat
2009-05-06 12:24     ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.