From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoSRm-0002yx-7h for qemu-devel@nongnu.org; Sat, 03 Nov 2007 19:30:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoSRk-0002wH-Hb for qemu-devel@nongnu.org; Sat, 03 Nov 2007 19:30:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoSRk-0002w8-Du for qemu-devel@nongnu.org; Sat, 03 Nov 2007 19:30:32 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IoSRk-0005PR-0p for qemu-devel@nongnu.org; Sat, 03 Nov 2007 19:30:32 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH, RFC] Disable implicit self-modifying code support for RISC CPUs Date: Sat, 3 Nov 2007 23:30:24 +0000 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711032330.25578.paul@codesourcery.com> 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 Cc: Blue Swirl > RISC CPUs don't support self-modifying code unless the affected area > is flushed explicitly. For experience with ARM cpus, I think this is only true for userspace. Many CPUs only require explicit flushes when the icache is enabled. It's not uncommon for bootloaders to leave the icache disabled and omit the cache flushes. The ARM cache flush instructions/syscalls are currently implemented as a no-op, so nontrivial additional work would be required to disabled the qemu SMC detections. IIRC there are also special cases where a system call instruction guarantees some level of architectural consistency for backwards compatibility. On some cores it is only necessary to flush the pipeline, but it's also common to know that e.g. a particular core has a 4-stage pipeline, so inserting 4 NOPs is sufficient to ensure consistency. Paul