How does a system call work on QEMU?
Paravirtualized Xen guest kernel is on ring1 so Xen must forward system calls to it and then guest kernel replies with a hypercall to Xen. How does a system call work on QEMU?
When a guest kernel wants to directly access to device or perform a sensitive but not privilege instruction, what's happened?
Thanks
Quoted 6 lines · On 5/14/09, [email protected] <[email protected]> wrote:
Paravirtualized Xen guest kernel is on ring1 so Xen must forward system calls to it and then guest kernel replies with a hypercall to Xen. How does a system call work on QEMU?
When a guest kernel wants to directly access to device or perform a sensitive but not privilege instruction, what's happened?
Which mode of Qemu operations do you refer to? if you refer to full MMU emulation (no KVM or kqemu involved then), then intercepting syscall is basically intercepting interrupt 80 hex or SYSENTER/SYSCALL into host user mode instruction during code translation.
Using KVM, it behaves more or less the same like Xen. KVM hypervisor sits in ring zero root mode (sometimes I am confused about root and non root mode, so guys CMIIW), while guest kernel sits in ring 0 non root mode. Non privileged instruction is directly handled by CPU, while privileged one make CPU exits to root mode. CPU will trap such instructions and redirect them to KVM entry points.
And last, if you're refererring linux-user mode, it's using same code translation. It just don't produce user mode code, but instead calling syscall() C function.
That's all I can recall, CMIIW people.
regards,
Mulyadi.