From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL79G-00037o-CS for qemu-devel@nongnu.org; Fri, 31 Jul 2015 06:02:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZL79A-000854-5f for qemu-devel@nongnu.org; Fri, 31 Jul 2015 06:02:42 -0400 Received: from mail-vk0-f49.google.com ([209.85.213.49]:34859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZL79A-00084p-2V for qemu-devel@nongnu.org; Fri, 31 Jul 2015 06:02:36 -0400 Received: by vkhg129 with SMTP id g129so19352440vkh.2 for ; Fri, 31 Jul 2015 03:02:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <878u9xhel1.fsf@linaro.org> From: Peter Maydell Date: Fri, 31 Jul 2015 11:02:16 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] Call Trace for QEMU functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naman patel Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers On 31 July 2015 at 10:29, Naman patel wrote: > Can someone explain me what happens when a guest OS calls "invlpg" on say > page swap out or a context switch? What exactly is the call flow and how > QEMU handles this instruction? When we see the instruction during translation, we emit code which will * get the argument to invlpg (extracting it from the relevant register, adding any constant offset required for the addressing mode, etc) * make a call to helper_inlvpg(). (target-i386/translate.c has the C code that does this codegen -- search for invlpg) Later when that generated code is run, we call the helper, which does what it needs to do (in this case flush a page from QEMU's TLB cache). When the call returns we'll carry on executing whatever guest instruction comes next. > Also is there anyway QEMU can send some data > back to the guest OS? INVLPG is just an x86 instruction that performs an operation; it doesn't modify any registers or flags. So there's no way for it to tell the guest OS anything. -- PMM