qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 02/26] exec: add ram_debug_ops support


From: Brijesh Singh
Subject: Re: [Qemu-devel] [PATCH v7 02/26] exec: add ram_debug_ops support
Date: Wed, 7 Feb 2018 14:26:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0



On 02/07/2018 10:51 AM, Paolo Bonzini wrote:
On 07/02/2018 17:06, Brijesh Singh wrote:
@@ -3148,7 +3152,11 @@ MemTxResult flatview_read_continue(FlatView *fv, hwaddr 
addr,
          } else {
              /* RAM case */
              ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l, false);
-            memcpy(buf, ptr, l);
+            if (attrs.debug && mr->ram_debug_ops) {
+                mr->ram_debug_ops->read(buf, ptr, l, attrs);
+            } else {
+                memcpy(buf, ptr, l);
+            }
          }
if (release_lock) {

You also need to tweak flatview_read in include/exec/memory.h (probably
by adding an "&& !attrs.debug", which leaves the mr->ram_debug_ops->read
to the slow path in exec.c).



thanks, I will make the changes in flatview_read to take slow path when debug is enabled.


@@ -3218,11 +3226,13 @@ void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
enum write_rom_type {
      WRITE_DATA,
+    READ_DATA,
      FLUSH_CACHE,
  };
-static inline void cpu_physical_memory_write_rom_internal(AddressSpace *as,
-    hwaddr addr, const uint8_t *buf, int len, enum write_rom_type type)
+static inline void cpu_physical_memory_rw_internal(AddressSpace *as,
+    hwaddr addr, uint8_t *buf, int len, MemTxAttrs attrs,
+    enum write_rom_type type)
  {
      hwaddr l;
      uint8_t *ptr;

I wonder if READ_DATA and WRITE_DATA still need to go down to
cpu_physical_memory_rw_internal.  Maybe you can just call
address_space_rw with &address_space_memory as the address space, and
"(MemTxAttrs) { .debug = 1 }" as the attributes.



I will take a look to see if I can remove passing down the READ_DATA and WRITE_DATA.




reply via email to

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