mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
trace: separate MMIO tracepoints from TB-access tracepoints
Memory accesses to code which has previously been translated into a TB show up in the MMIO path, so that they may invalidate the TB. It's extremely confusing to mix those in with device MMIOs, so split them into their own tracepoint. Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1456949575-1633-2-git-send-email-hollis_blanchard@mentor.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
5a68be94ac
commit
f2d089425d
2 changed files with 32 additions and 0 deletions
30
memory.c
30
memory.c
|
@ -407,6 +407,11 @@ static MemTxResult memory_region_oldmmio_read_accessor(MemoryRegion *mr,
|
|||
tmp = mr->ops->old_mmio.read[ctz32(size)](mr->opaque, addr);
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
@ -428,6 +433,11 @@ static MemTxResult memory_region_read_accessor(MemoryRegion *mr,
|
|||
tmp = mr->ops->read(mr->opaque, addr, size);
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
@ -450,6 +460,11 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr,
|
|||
r = mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs);
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_read(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_READ_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
@ -471,6 +486,11 @@ static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr,
|
|||
tmp = (*value >> shift) & mask;
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
@ -492,6 +512,11 @@ static MemTxResult memory_region_write_accessor(MemoryRegion *mr,
|
|||
tmp = (*value >> shift) & mask;
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
@ -513,6 +538,11 @@ static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr,
|
|||
tmp = (*value >> shift) & mask;
|
||||
if (mr->subpage) {
|
||||
trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
|
||||
} else if (mr == &io_mem_notdirty) {
|
||||
/* Accesses to code which has previously been translated into a TB show
|
||||
* up in the MMIO path, as accesses to the io_mem_notdirty
|
||||
* MemoryRegion. */
|
||||
trace_memory_region_tb_write(get_cpu_index(), addr, tmp, size);
|
||||
} else if (TRACE_MEMORY_REGION_OPS_WRITE_ENABLED) {
|
||||
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
|
||||
trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue