From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2hEo-0007vZ-9L for qemu-devel@nongnu.org; Fri, 16 Apr 2010 04:49:22 -0400 Received: from [140.186.70.92] (port=45610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2hEW-000328-Ks for qemu-devel@nongnu.org; Fri, 16 Apr 2010 04:49:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2fID-0007xG-Bt for qemu-devel@nongnu.org; Fri, 16 Apr 2010 02:46:57 -0400 Received: from mail-iw0-f194.google.com ([209.85.223.194]:36640) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2fIB-0007wx-Dv for qemu-devel@nongnu.org; Fri, 16 Apr 2010 02:44:45 -0400 Received: by iwn32 with SMTP id 32so1153065iwn.18 for ; Thu, 15 Apr 2010 23:44:42 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jun Koi Date: Fri, 16 Apr 2010 15:38:25 +0900 Message-ID: Subject: Re: [Qemu-devel] Which functions writes to memory? Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org 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) =9Awrite 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? Thanks a lot, J