From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJWI8-00072Z-Tt for qemu-devel@nongnu.org; Mon, 09 May 2011 15:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJWI8-0004dE-2N for qemu-devel@nongnu.org; Mon, 09 May 2011 15:38:52 -0400 Received: from mail-ey0-f173.google.com ([209.85.215.173]:54205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJWI7-0004d2-Te for qemu-devel@nongnu.org; Mon, 09 May 2011 15:38:52 -0400 Received: by eyb6 with SMTP id 6so1988718eyb.4 for ; Mon, 09 May 2011 12:38:50 -0700 (PDT) From: Max Filippov Date: Mon, 9 May 2011 23:38:45 +0400 References: <1304470768-16924-1-git-send-email-jcmvbkbc@gmail.com> <4DC17FCF.2090706@twiddle.net> <4DC18641.2080904@twiddle.net> In-Reply-To: <4DC18641.2080904@twiddle.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105092338.46339.jcmvbkbc@gmail.com> Subject: Re: [Qemu-devel] [RFC 18/28] target-xtensa: implement exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org > > This is a case where you almost certainly want to check this > > condition inside QEMU and translate the opcode differently. > > > > See cpu_get_tb_cpu_state, which sets bits in *flags. These > > flags can then be checked in tb->flags while translating. > > At which point you'd avoid all the conditionalization on > > the value in PS here in check_privilege and merely issue > > the exception_cause. > > > > The ARM port is a good example for testing these sorts of bits. > > Actually, while the tb flags are useful, privileged instructions > are usually checked by testing mmu_index, since we already have > to generate different code for the TB based on which TLB entry we > need to access. Richard, do I understand it right that if I use tb->flags or mem_index to make decisions during translation, then I must issue exit_tb on instructions that can change state they reflect? Thanks. -- Max