From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] exec.c: Use correct attrs in cpu_memory_rw_debug()
Date: Thu, 17 Jan 2019 16:17:06 +0100 [thread overview]
Message-ID: <530d35a3-3efd-efcc-3ec2-a113b540b392@redhat.com> (raw)
In-Reply-To: <20190117133834.7480-1-peter.maydell@linaro.org>
On 1/17/19 2:38 PM, Peter Maydell wrote:
> 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: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> exec.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 6e875f0640a..2f0f40b0be6 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3881,12 +3881,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;
>
prev parent reply other threads:[~2019-01-17 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 13:38 [Qemu-devel] [PATCH] exec.c: Use correct attrs in cpu_memory_rw_debug() Peter Maydell
2019-01-17 14:28 ` Stefano Garzarella
2019-01-17 15:17 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530d35a3-3efd-efcc-3ec2-a113b540b392@redhat.com \
--to=philmd@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).