Takanori Watanabe <[EMAIL PROTECTED]> wrote:

> 1.FMWALLOCVPHYS allocs some kernel memory by vmalloc().I think that 
> this kernel API allocs page-aligned and kernel-wired memory. True?

Yes.

vmalloc() allocates large chunks of memory (page aligned, size a multiple
of the page size), that are not necessarily physically contiguous (like
memory returned by kmalloc()), but are mapped into the kernel virtual
address space range shared across all processes.

> 2.If so,the guest memory will not be swapped out ,isn't it?Isn't it bad thing?
> Shouldn't the module API changed ,so that pass mmap(2)-ed file descripter
> and get memory chanks from the file when virtual machine cause page fault?
> The reason why I think about it is because BSD device_pager can handle 
> only fixed physical memory to user-land map.

Yes, the memory will not be swapped.  This is because the pages are 
entered (by FreeMWare) into the guest-side page tables that are active
while running the guest.  If the host would decide to swap out those
pages while they are still present in guest page tables, this would be
bad :-/

Sooner or later, we'll have to implement some kind of swapping ourselves
by returning pages to the kernel (after removing them from the guest
side page tables) ...


> 3.host-linux tells OS-independent part to where the kernel module is mapped.
> It seems that this infomation is used to map some part of kernel module 
> to 'nexus' page. Which part should be mapped? Module in nexus.S? Or all kernel
> module should be mapped?

The complete kernel module is supposed to be mapped.  This is because
the nexus.S code calls routines present in the kernel module as fault
handlers while still on guest side.  (Otherwise, we'd have the huge 
overhead of a guest<->host transition for *every* fault ...)

To simplify writing such fault handlers, they whole kernel module is
mapped into the guest space, and the monitor segment descriptors are
set up just so that the offsets of the mapped kernel module in guest
space are identical to the offsets of the original kernel module in
host space (relative to the host kernel segments).

This way, we can run normal gcc-generated code (which need not even
be position-independent) as monitor fault handlers.


Bye,
Ulrich

Reply via email to