qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [Please discard the previous mail] System call from a Guest


From: Jong Chun Park
Subject: [Qemu-devel] [Please discard the previous mail] System call from a Guest Linux
Date: Wed, 3 Feb 2010 11:08:58 -0700

Hi, all?

First of all, I apologize you for the previous incomplete mail and this spam.  I'm working with QEMU v0.12.1 with i386 Linux guest on x86-64 Linux host. I'm trying to find a point in the source code where a system call from the guest OS is handled. If I'm not mistaken, QEMU disassembles an instruction of INT # in a switch statement of target-i386/translate.c and then calls helper_sysenter of target-i386/op_helper.c. The problem is how to tell difference between a system call of the guest OS and a system call of QEMU (I'm not sure of this, though). Assume the following code is executed after compilation in the guest OS:

int main() {
   int fd;
   if (access("hello.txt", R_OK) != 0) {
     exit(0);
   }
   fd=open("hello.txt", O_RDONLY);
   close(fd);
   return 0;
}
 
For this simple sequence of system calls, acess() -> open() -> close(), QEMU goes through disas_insn() and helper_sysenter() more than 3 times. This makes me really confused because I believed those should be called 3 times, though. It'd be greatly appreciated in advance if someone helps me out this.

Thanks a lot,
Jong

reply via email to

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