From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4cUt-0002Mh-11 for qemu-devel@nongnu.org; Thu, 14 May 2009 11:05:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4cUm-0002Lb-Ud for qemu-devel@nongnu.org; Thu, 14 May 2009 11:05:21 -0400 Received: from [199.232.76.173] (port=38653 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4cUm-0002LF-Oy for qemu-devel@nongnu.org; Thu, 14 May 2009 11:05:16 -0400 Received: from rv-out-0708.google.com ([209.85.198.249]:54180) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M4cUm-0006mb-8J for qemu-devel@nongnu.org; Thu, 14 May 2009 11:05:16 -0400 Received: by rv-out-0708.google.com with SMTP id c5so746138rvf.22 for ; Thu, 14 May 2009 08:04:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <877930.94637.qm@web28603.mail.ukl.yahoo.com> References: <877930.94637.qm@web28603.mail.ukl.yahoo.com> Date: Thu, 14 May 2009 21:57:25 +0700 Message-ID: Subject: Re: [Qemu-devel] How does a system call work on QEMU? From: Mulyadi Santosa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: helicoterus-elih@yahoo.it Cc: qemu-devel@nongnu.org On Thu, May 14, 2009 at 1:50 PM, wrote: > > >> 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