qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Usermode emulation changes


From: Paul Brook
Subject: [Qemu-devel] Usermode emulation changes
Date: Sat, 25 Mar 2006 19:31:21 +0000
User-agent: KMail/1.9.1

I've just committed a relatively large patch to the qemu usermode emulation 
code. Before the patch the userspace emulation code assumed that host and 
guest address spaces were the same. The goal of these changes is to remove 
that assumption. This allows us to do two things:

- Offset the guest address space by a constant amount.  This is useful if the 
area of memory used by statically linked guest applications is not available 
on the host. In particular windows hosts can't map the first 64k of memory, 
and Arm applications are usually liked with a base address of 0x8000. Windows 
host support is a whole other patch, but this is a prerequisite.

- Use of softmmu with usermode emulation. This makes 64-bit guest on 32-bit 
host possible. Actually doing this still requires a significant amount of 
work (e.g most of mmap.c would need rewriting).

There are two "safe" ways of accessing guest memory from the syscall code. The 
tget* and tput* macros read/write a single value, including appropriate 
byteswapping.
Alternatively lock_user (and variants) can be used to obtain a pointer to a 
contiguous block of guest memory. The user is still responsible for 
byteswapping the data as necessary.
Currently these just bias the value and return the appropriate pointer. 
However with softmmu the block may need copying to a temporary location if it 
crosses a page boundary. The interface has been designed to allow this to be 
implemented efficiently.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]