qemu-devel
[Top][All Lists]
Advanced

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

Re: Question about (and problem with) pflash data access


From: Philippe Mathieu-Daudé
Subject: Re: Question about (and problem with) pflash data access
Date: Thu, 13 Feb 2020 16:24:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/13/20 3:39 PM, Peter Maydell wrote:
On Thu, 13 Feb 2020 at 14:26, Guenter Roeck <address@hidden> wrote:
What really puzzles me is that there is no trace output for
flash data accesses (trace_pflash_data_read and trace_pflash_data_write),
meaning the actual flash data access must be handled elsewhere.
Can someone give me a hint where that might be ?

If you can share built kernel/dtb/rootfs for this machine I can have a look at it.

Clearly I am missing something about inner workings of qemu.

You can see all the pflash events using '-trace pflash*'.


Probably the device is in 'romd' mode. A QEMU MemoryRegion
can be:
  * RAM (includes ROM for these purposes) -- backed by host
    memory, reads and writes (if permitted) go straight to
    the host memory via fastpath accesses

No tracing here.

  * MMIO -- backed by a read and write accessor function,
    all accesses go to these functions
  * "ROM device" -- a mix of the above where there is a
    backing bit of host memory but also accessor functions.
    When the device is in "romd" mode, reads go direct to
    host memory, and writes still go to the accessor function.
    When the device is not in "romd" mode, reads also go
    to the accessor function.

We use this in the pflash devices to make the common case
("just read the flash") fast. When the guest makes a write
to flash that puts it into programming mode, we call
memory_region_rom_device_set_romd(..., false) so we can
intercept reads and make them do the right thing for
programming mode.

thanks
-- PMM





reply via email to

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