From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfyFm-0001sB-BC for qemu-devel@nongnu.org; Wed, 17 Sep 2008 10:43:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfyFk-0001rR-Lr for qemu-devel@nongnu.org; Wed, 17 Sep 2008 10:43:37 -0400 Received: from [199.232.76.173] (port=36258 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfyFk-0001rL-HI for qemu-devel@nongnu.org; Wed, 17 Sep 2008 10:43:36 -0400 Received: from mta23.gyao.ne.jp ([125.63.38.249]:19452 helo=mx.gate01.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KfyFj-0003n4-SZ for qemu-devel@nongnu.org; Wed, 17 Sep 2008 10:43:36 -0400 Received: from [124.34.33.190] (helo=master.linux-sh.org) by pop52.isp.us-com.jp with esmtp (Mail 4.69) id 1KfyFe-0002eS-V4 for qemu-devel@nongnu.org; Wed, 17 Sep 2008 23:43:30 +0900 Received: from localhost (unknown [127.0.0.1]) by master.linux-sh.org (Postfix) with ESMTP id 22F4763754 for ; Wed, 17 Sep 2008 14:42:43 +0000 (UTC) Received: from master.linux-sh.org ([127.0.0.1]) by localhost (master.linux-sh.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0evgFeDi5k1U for ; Wed, 17 Sep 2008 23:42:42 +0900 (JST) Date: Wed, 17 Sep 2008 23:42:42 +0900 From: Paul Mundt Subject: Re: [Qemu-devel] [PATCH] SH4: Privilege check for instructions Message-ID: <20080917144242.GA30834@linux-sh.org> References: <48CC8D3E.1040401@juno.dti.ne.jp> <48CCE727.7000203@juno.dti.ne.jp> <48CDBC9A.2070504@juno.dti.ne.jp> <48CFE26E.80302@juno.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48CFE26E.80302@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 Wed, Sep 17, 2008 at 01:44:30AM +0900, Shin-ichiro KAWASAKI wrote: > By the way, special load instructions for SR ('ldc Rm,SR' and 'ldc > @Rm+,SR'), > can change supervisor/user bits. Though I guess SH-Linux does not use it to > modify supervisor/user bits, it might be a problem for other OSes. > Correct. The supervisor bit is set primarily on the initial SR setup and largely ignored after that. Other things, like SR_FD, are modified very regularly. We also see similar behaviour on parts with the SR_DSP bit, which has roughly the same semantics. > Similar problems happen for status of floating point unit. The instructions > 'lds Rm,FPSCR', 'lds @Rm+,FPSCR', 'frchg', and 'fschg', might change the > status, and confuse the translated codes. I guess this will happen so often > on SH-Linux. > Those FPU instructions are used primarily in save/restore paths of FPU state in the lazy context switching code. In order to test this, you need multiple processes that are using the FPU. If you permit the compiler to emit floating point instructions, this will include basically every process in the system, so it becomes a very frequent thing.