From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KelCF-0005ie-IT for qemu-devel@nongnu.org; Sun, 14 Sep 2008 02:34:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KelCD-0005iS-4H for qemu-devel@nongnu.org; Sun, 14 Sep 2008 02:34:58 -0400 Received: from [199.232.76.173] (port=46956 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KelCC-0005iP-U7 for qemu-devel@nongnu.org; Sun, 14 Sep 2008 02:34:56 -0400 Received: from mx20.gnu.org ([199.232.41.8]:53864) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KelCC-00007A-De for qemu-devel@nongnu.org; Sun, 14 Sep 2008 02:34:56 -0400 Received: from wf-out-1314.google.com ([209.85.200.168]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KelCA-0000JA-V9 for qemu-devel@nongnu.org; Sun, 14 Sep 2008 02:34:55 -0400 Received: by wf-out-1314.google.com with SMTP id 27so1500392wfd.4 for ; Sat, 13 Sep 2008 23:34:53 -0700 (PDT) Message-ID: Date: Sun, 14 Sep 2008 09:34:53 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH] SH4: Privilege check for instructions In-Reply-To: <48CC8D3E.1040401@juno.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48CC8D3E.1040401@juno.dti.ne.jp> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 9/14/08, Shin-ichiro KAWASAKI wrote: > This patch adds check for all SH4 instructions which are > executed only in privileged mode. The checks get the privileged mode status from translation context. In theory, the same TB code block could be used in unprivileged and privileged mode, so the status that was true at translation time may no longer be correct at execution time. Of course normally kernel code is not visible or executable to user processes. The TB flags are handled in cpu-exec.c:tb_find_fast(). If I understand the SH part correctly, the flags copied from env->flags don't contain the privileged mode bits, isn't that in env->sr & SR_MD? Alternatively, the check could be made at execution time, but that's less efficient.