How does a system call work on QEMU?
Quoted 6 lines
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.
Ok, I refer to full emulation.
When QEMU intercepts a system call what does it do? What type of translation or modification does it perform?
Quoted 8 lines · On Thursday 14 May 2009, [email protected] wrote:
Quoted 4 lines
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.
Ok, I refer to full emulation.
When QEMU intercepts a system call what does it do? What type of translation or modification does it perform?
It does exactly the same as real hardware.
Paul
Quoted 11 lines · Paul Brook
Quoted 8 lines · On Thursday 14 May 2009, [email protected] wrote:
Quoted 4 lines
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.
Ok, I refer to full emulation.
When QEMU intercepts a system call what does it do? What type of translation or modification does it perform?
Quoted 6 lines
It does exactly the same as real hardware.
Paul
Does QEMU generate a system call that goes to libc library and the to the kernel?
Then the kernel run it on hardware, kernel replies to libc and libc notifies to QEMU. QEMU replies to guest O.S, is it true? Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
Quoted 2 lines · Heli
Does QEMU generate a system call that goes to libc library and the to the kernel?
Then the kernel run it on hardware, kernel replies to libc and libc notifies to QEMU. QEMU replies to guestO.S, is it true?
No. Look at target-i386/translate.c, case 0x105 for syscall emulation. Eventually it ends up calling helper_syscall().
Signature · 1 line
error compiling committee.c: too many arguments to function
Avi Kivity ha scritto:
Quoted 6 lines
Quoted 2 lines · Heli
Does QEMU generate a system call that goes to libc library and the to the kernel?
Then the kernel run it on hardware, kernel replies to libc and libc notifies to QEMU. QEMU replies to guestO.S, is it true?No. Look at
target-i386/translate.c, case0x105for syscall emulation. Eventually it ends up callinghelper_syscall().
Simplify?
I am a newbie.
Thanks you all for your rapid answers.
Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
Quoted 5 lines · grisu46 wrote:
Quoted 2 lines
No. Look at
target-i386/translate.c, case0x105for syscall emulation. Eventually it ends up callinghelper_syscall().Simplify?
I am a newbie.
Sorry, you're on your own. I can give you pointers but it's up to you to follow them. If you're serious about understanding qemu you should be prepared a lot of time reading the source code and processor documentation.
Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.
Avi Kivity ha scritto:
Quoted 9 lines
Quoted 5 lines · grisu46 wrote:
Quoted 2 lines
No. Look at
target-i386/translate.c, case0x105for syscall emulation. Eventually it ends up callinghelper_syscall().Simplify?
I am a newbie.Sorry, you're on your own. I can give you pointers but it's up to you to follow them. If you're serious about understanding qemu you should be prepared a lot of time reading the source code and processor documentation.
I would like to know how a virtualization program can perform a sensitive but not privileged operation. I learn about Xen and I like to understand (no deep details need) differences between Xen paravirtualization and QEMU emulator.
Thanks
Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
Quoted 11 lines · On Thu, May 14, 2009 at 3:00 PM, grisu46 <[email protected]> wrote:
Avi Kivity ha scritto:
Quoted 10 lines
Quoted 7 lines · grisu46 wrote:
Quoted 4 lines
No. Look at
target-i386/translate.c, case0x105for syscall emulation. Eventually it ends up callinghelper_syscall().Simplify?
I am a newbie.
Quoted 9 lines
Quoted 4 lines
Sorry, you're on your own. I can give you pointers but it's up to you to follow them. If you're serious about understanding qemu you should be prepared a lot of time reading the source code and processor documentation.
I would like to know how a virtualization program can perform a sensitive but not privileged operation. I learn about Xen and I like to understand (no deep details need) differences between Xen paravirtualization and QEMU emulator.
As the name suggests, qemu (in this case) is a processor _emulator_. You're not doing any kind of sensitive operations on your host processor here. You are emulating
a processor, an all state change happens in the emulated processor.
* qemu reads the instruction.
* qemu updates its internal state accordingly.
* qemu reads next instruction.
No big secret here.
Signature · 5 lines
Glauber Costa. "Free as in Freedom" http://glommer.net "The less confident you are, the more serious you have to act."
Avi Kivity ha scritto:
Quoted 9 lines
Quoted 5 lines · grisu46 wrote:
Quoted 2 lines
No. Look at
target-i386/translate.c, case0x105for syscall emulation. Eventually it ends up callinghelper_syscall().Simplify?
I am a newbie.Sorry, you're on your own. I can give you pointers but it's up to you to follow them. If you're serious about understanding qemu you should be prepared a lot of time reading the source code and processor documentation.
So it this the architecture of qemu, emulator version? QEMU is a process that gives to o.s.guest a virtual hw layer.
Every guest will be run by a QEMU instance.
See picture schema I prepaired: http://yfrog.com/7gqemulayersj
So system calls go from a guest application to its operating system that communicates with its virtual hardware. QEMU receives a system call and software emulator QEMU performs a system call in O.S. host.
It is right?
Thanks
Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
Quoted 11 lines · Heli
Quoted 1 line
So it this the architecture of qemu, emulator version? QEMU is a process that gives to o.s.guest a virtual hw layer.
Every guest will be run by a QEMU instance.See picture schema I prepaired: http://yfrog.com/7gqemulayersj
So system calls go from a guest application to its operating system that communicates with its virtual hardware.
Yes.
Quoted 3 lines
QEMU receives a system call and software emulator QEMU performs a system call in
O.S. host.
It is right?
No, guest system calls are handled by the guest OS.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 5 lines · Heli
So it this the architecture of qemu, emulator version? QEMU is a process that gives to o.s.guest a virtual hw layer.
Every guest will be run by a QEMU instance.
Quoted 7 lines
See picture schema I prepaired: http://yfrog.com/7gqemulayersj
So system calls go from a guest application to its operating system that communicates with its virtual hardware. QEMU receives a system call and software emulator QEMU performs a system call in
O.S. host.
It is right?
I'm not a virtualization person myself, so other people might offer you more convenient sugestions but, with the due respect, I think you might be better served by an introductory text on operating systems. The 3rd edition of Andrew Tanenbaum's Modern Operating Systems, for instance, has a short section specifically devoted to virtualization which is clear enough to non-experienced readers and, I guess, answers most of your questions.
Fernando Carrijo.
Quoted 9 lines · On Thu, May 14, 2009 at 1:50 PM, <[email protected]> wrote:
Quoted 6 lines
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.
Ok, I refer to full emulation.
When QEMU intercepts a system call what does it do? What type of translation or modification does it perform?
OK then, just like Paul said, it's done exactly like normal hardware does. Emulated APIC will intercept it and Qemu will jump executing the handler.
IMHO, translation is done when Qemu executes the guest codes, be it in user mode or kernel mode. Refer to Fabrice's paper on how translation is done (mind you, it's using pre TCG method). On special case, where qemu emulates the same type of machine (e.g x86 32 bit on x86 32 bit), AFAIK Qemu does few code copy tricks, so no all codes must be translated.
More knowledgeable people in this mailing list could give you better explanation... so pardon me if I can not answer all of your doubt.
regards,
Mulyadi