qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] SH4: Privilege check for instructions


From: Paul Mundt
Subject: Re: [Qemu-devel] [PATCH] SH4: Privilege check for instructions
Date: Wed, 17 Sep 2008 23:42:42 +0900
User-agent: Mutt/1.5.13 (2006-08-11)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]