Sukanto Ghosh wrote:
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.
Userspace allocation is done in order to allow flexibility in how memory
is allocated. Userspace can choose to allocate large pages, apply a
numa policy to the memory, mlock() it, etc.
It also makes swapping simple, as Linux already knows how to swap
userspace memory.
Also, s390 has to do it this way.
Also, when and how are host-initiated virtual interrupts delivered? I
guess, that it is done at the time of VM-entry.
Yes.
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 ?
Sending a signal to a task that is executing guest code will force it to
exit to userspace immediately. The in-kernel interrupt controller
emulation also forces guest exits by sending inter-processor interrupts.
--
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