aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-01-29 11:46:04 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-01-29 11:46:04 +0000
commitea7a5330b79523540ba776c529b09dc8cf3fa0c5 (patch)
treeafe8fd333d58ffe81b040641bebca0c0e4c93fd3 /exec.c
parentb36356f69941bcda47ac3d97c2b05757728575c9 (diff)
downloadqemu-ea7a5330b79523540ba776c529b09dc8cf3fa0c5.zip
qemu-ea7a5330b79523540ba776c529b09dc8cf3fa0c5.tar.gz
qemu-ea7a5330b79523540ba776c529b09dc8cf3fa0c5.tar.bz2
exec.c: Use correct attrs in cpu_memory_rw_debug()
In the softmmu version of cpu_memory_rw_debug(), we ask the CPU for the attributes to use for the virtual memory access, and we correctly use those to identify the address space index. However, we were not passing them in to the address_space_write_rom() and address_space_rw() functions. The effect of this was that a memory access from the gdbstub to a device which had behaviour that was sensitive to the memory attributes (such as some ARMv8M NVIC registers) was incorrectly always performed as if non-secure, rather than using the right security state for the CPU's current state. Fixes: https://bugs.launchpad.net/qemu/+bug/1812091 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190117133834.7480-1-peter.maydell@linaro.org
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/exec.c b/exec.c
index 895449f..9557a4e 100644
--- a/exec.c
+++ b/exec.c
@@ -3882,12 +3882,10 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
phys_addr += (addr & ~TARGET_PAGE_MASK);
if (is_write) {
address_space_write_rom(cpu->cpu_ases[asidx].as, phys_addr,
- MEMTXATTRS_UNSPECIFIED,
- buf, l);
+ attrs, buf, l);
} else {
address_space_rw(cpu->cpu_ases[asidx].as, phys_addr,
- MEMTXATTRS_UNSPECIFIED,
- buf, l, 0);
+ attrs, buf, l, 0);
}
len -= l;
buf += l;