qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] tracing memory accesses
Date: Tue, 11 Nov 2008 20:51:12 +0200	[thread overview]
Message-ID: <f43fc5580811111051y2887ca11y5b10696c4e287c0b@mail.gmail.com> (raw)
In-Reply-To: <49195809.6010702@uab.cat>

On 11/11/08, Màrius Montón <marius.monton@uab.cat> wrote:
> Hello,
>
>  I've been working for a while adding SystemC capabilities to QEMU (in short, SystemC is a C++ extension to describe HW and we are using it to add new peripherals to QEMU) (http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4374971)
>
>  Now it's time to move a whole system to a SystemC described one but the CPU. My plan is to use QEMU CPU emulation and substitute all peripherals by its SystemC description and communicate using any sort of bus in SystemC too.
>
>  So I need to capture all memory accesses from CPU to Memory. I've been looking at code, and I can see that ldq_phys, ldl_phys (in exec.c) are used to load from
>  memory to CPU, but I'm not able to see what functions are used to manage stores from CPU to memory. I can see some equivalent functions called stl_phys_notdirty and stl_phys, but they never used (I'm focused in ARM platforms).
>
>  Do you have any hint about that? Do you think managing these functions is enough to capture all data moving from CPU to RAM?

The loads and stores check the TLB if the address has been translated
(see for example generic version in softmmu_header.h). If not,
cpu_arm_mmu_fault is called to translate the address. After that, the
entry is added to TLB and the access is retried.

On subsequent accesses (also for writes if the permissions allow)
there is only a TLB lookup followed by a raw access.

Capturing all accesses transparently would need stacking of devices or
generic bus/DMA system, but we have neither. Patches welcome :-)

Less transparently this could be handled so that one device registers
that it handles all physical address space, including RAM. No other
devices register anything. If you need to access other devices, the
access functions of other devices can be called directly from the all
memory device, RAM similarly. I don't know if DMA would work.

      parent reply	other threads:[~2008-11-11 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 10:01 [Qemu-devel] tracing memory accesses Màrius Montón
2008-11-11 11:10 ` Erik de Castro Lopo
2008-11-11 11:21   ` Laurent Desnogues
2008-11-11 11:26   ` Màrius Montón
2008-11-11 18:51 ` Blue Swirl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f43fc5580811111051y2887ca11y5b10696c4e287c0b@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).