Subject: Re: Problems getting Win98 running under VMware on a NetBSD 1.5U
To: None <port-i386@netbsd.org>
From: Atsushi Onoe <onoe@sm.sony.co.jp>
List: port-i386
Date: 06/13/2001 09:31:29
Hmm.  I think that the problem is around wiring mmap'ed page whose
corresponding block on file system is not actually allocated yet.

Here is a summary what vmware does:
	- create a file "ram0" in $TMPDIR to be used as a MEMORY for vmware.
	- unlink the file, but still opened.
	- use ftruncate() to extend the file to reserved memory size.
		(*)file system block is not allocated here.
	- use mmap() to map it to a virtual address space.
	- call uvm_pagewire() via "vmmon" kernel module to wire some of these
	  pages on the physical memory.
	- access to the memory by guest OS.
	- repeat above processes for additional work area (?).
		ftruncate - mmap - uvm_pagewire

It works on 1.5.1 fine.  But the guest on -current very likely hangs up or
panics, and sometimes vmware process itself dumps core with SIGBUS/SEGV.
Changing uvm_pagewire() to uvm_vslock() or uvm_map_pageable() doesn't
help at all.

And it semms that it works again on current after I changed the behavior
of ftruncate() in linux emulation to allocate file system block when its
file size increases.

I'm still not sure the problem is in the kernel (UBC?) or just in the
"vmmon" kernel module of the vmware.  

Atsushi Onoe