Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2hDz-0007Ym-7t for qemu-devel@nongnu.org; Fri, 16 Apr 2010 04:48:31 -0400 Received: from [140.186.70.92] (port=39651 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2hDp-0000yX-Ij for qemu-devel@nongnu.org; Fri, 16 Apr 2010 04:48:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2fNw-0000kJ-De for qemu-devel@nongnu.org; Fri, 16 Apr 2010 02:53:05 -0400 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:63475 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2fNw-0000is-1P for qemu-devel@nongnu.org; Fri, 16 Apr 2010 02:50:40 -0400 Date: Fri, 16 Apr 2010 10:50:20 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] Which functions writes to memory? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="33734824-1129164052-1271400629=:15076" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: qemu-devel@nongnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --33734824-1129164052-1271400629=:15076 Content-Type: TEXT/PLAIN; charset=KOI8-R Content-Transfer-Encoding: 8BIT On Fri, 16 Apr 2010, Jun Koi wrote: > On Fri, Apr 16, 2010 at 3:17 PM, malc wrote: > > On Fri, 16 Apr 2010, Jun Koi wrote: > > > >> Hi, > >> > >> I am writing a small tool to trace all the activities that write to an > >> area of (virtual) memory in Qemu. > >> I am currently doing that by putting my code at the top of the below > >> macro in softmmu_header.h > >> > >> static inline void glue(glue(st, SUFFIX), MEMSUFFIX).... > >> > >> However, it seems I still miss some written events: in some occasions, > >> I believe that Qemu has another code writing data to memory, which > >> happens even before this macro. > >> Is it true that elsewhere, Qemu also writes into memory besides using > >> above function? > >> > >> The memory area I am tracking for written events belong to normal area > >> in OS kernel, where usually only normal code (kernel, not something > >> like SMM handler) šwrite to. > > > > Once the TLB is properly set up st helpers are bypassed entirely and > > tcg generated code writes to it directly, it's quite easy to "workaround" > > that at the expense of much slower execution. > > > > This saves me a lot of frustrated time, thanks! > > Now I can see that tcg code calls to __stb*_mmu(), but cannot find any > code call to st*_mmu(). > Do you have any hint? The tcg generated code fetches appropriate helper's address from the qemu_st/ld_helpers array and calls it indirectly. -- mailto:av1474@comtv.ru --33734824-1129164052-1271400629=:15076--