Received: from eggs.gnu.org ([140.186.70.92]:39013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9SHn-0002WW-Hj for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:53:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9SHm-0002F8-7P for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:53:11 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:51629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9SHl-0002Br-H2 for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:53:10 -0400 Date: Fri, 30 Sep 2011 09:53:02 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20110930015302.GA44924@cs.nctu.edu.tw> References: <20110929075525.GA23956@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] When do we need to do TB unchaining? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org, =?utf-8?B?6Zmz6Z+L5Lu7?= Hi, Blue > I don't think it is possible. The only non-device cases for x86 are > tb_invalidate_phys_page_range(), cpu_x86_set_a20() and > do_inject_x86_mce(), none of which should be reachable from user > emulator. >=20 > Maybe these should be #ifdeffed out from user emulator builds. I am not sure if SMC will use tb_invalidate_phys_page_range. Currently, QEMU defines tcg_handle_interrupt (replace original cpu_interrupt) and cpu_interrupt for system and process mode separately. Perhaps this should leave to x86 experts to judge. =20 > > 2. cpu_exit: > > > > =C2=A0QEMU will register a host SIGALRM handler, host_alarm_handler > > (qemu-timer.c), =C2=A0when initialize the enviroment in system mode. > > Then when host OS delivers SIGALRM to QEMU, host_alarm_handler > > calls qemu_notify_event -> cpu_exit. cpu_exit raise env->exit_request > > , then call cpu_unlink_tb to unlink env's TBs. > > > > =C2=A0There are other places where cpu_exit is called, like > > > > =C2=A0- cpu_signal: I think this is used when IOTHREAD is enabled. > > > > =C2=A0- DMA_init: I guess cpu_exit is called when DMA is done so > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0that control is gave = back to QEMU from the code > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cache. >=20 > Yes, this is a questionable hack to improve performance. Maybe it's > also not needed anymore since I/O thread was enabled. >=20 > > =C2=A0- gdb_do_syscall: Don't know when it get called. > > > > =C2=A0- vm_stop -> cpu_stop_current: Don't know when it get called. >=20 > grep -r is your friend. I'll dig into it. Thanks. :) =20 Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667