From 3fa54df9722b530a54e09795ec07b74d7ea39b64 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 29 Jan 2019 17:05:38 -0500 Subject: [PATCH] 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 Backports commit ea7a5330b79523540ba776c529b09dc8cf3fa0c5 from qemu --- qemu/exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qemu/exec.c b/qemu/exec.c index 8214f824..e11098a6 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -2434,8 +2434,7 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, phys_addr, 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;