From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
"Jon Doron" <arilou@gmail.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Luc Michel" <luc.michel@greensocs.com>
Subject: Re: [PATCH-for-5.0] gdbstub: Use correct address space with Qqemu.PhyMemMode packet
Date: Mon, 30 Mar 2020 18:21:00 +0200 [thread overview]
Message-ID: <f1fd3384-8653-c2e2-7248-457ae873cc27@redhat.com> (raw)
In-Reply-To: <CAFEAcA8i1W7ss2hQjaFbVHXzqhV81M8U4Fkaj_Te5JK8JO8+mg@mail.gmail.com>
On 3/30/20 6:08 PM, Peter Maydell wrote:
> On Mon, 30 Mar 2020 at 16:30, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> Since commit 3f940dc98, we added support for vAttach packet
>> to select a particular thread/cpu/core. However when using
>> the GDB physical memory mode, it is not clear which CPU
>> address space is used.
>> Since the CPU address space is stored in CPUState::as, use
>> address_space_rw() instead of cpu_physical_memory_rw().
>>
>> Fixes: ab4752ec8d9
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> gdbstub.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/gdbstub.c b/gdbstub.c
>> index 013fb1ac0f..3baaef50e3 100644
>> --- a/gdbstub.c
>> +++ b/gdbstub.c
>> @@ -69,11 +69,8 @@ static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
>>
>> #ifndef CONFIG_USER_ONLY
>> if (phy_memory_mode) {
>> - if (is_write) {
>> - cpu_physical_memory_write(addr, buf, len);
>> - } else {
>> - cpu_physical_memory_read(addr, buf, len);
>> - }
>> + address_space_rw(cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
>> + buf, len, is_write);
>> return 0;
>
> There's an argument here for using
> int asidx = cpu_asidx_from_attrs(cpu, MEMTXATTRS_UNSPECIFIED);
> AddressSpace *as = cpu_get_address_space(cpu, asidx);
>
> though it will effectively boil down to the same thing in the end
> as there's no way for the gdbstub to specify whether it wanted
> eg the Arm secure or non-secure physical address space.
https://static.docs.arm.com/ihi0074/a/debug_interface_v6_0_architecture_specification_IHI0074A.pdf
* Configuration of hypervisor noninvasive debug.
This field can have one of the following values:
- 0b00
Separate controls for hypervisor noninvasive debug are not implemented,
or no hypervisor is implemented. For ARMv7 PEs that implement the
Virtualization Extensions, and for ARMv8 PEs that implement EL2, if
separate controls for hypervisor debug visibility are not implemented,
the hypervisor debug visibility is indicated by the relevant Non-secure
debug visibility fields NSNID and NSID.
OK so for ARM "noninvasive debug is not implemented" and we would use
the core secure address space?
Instead of MEMTXATTRS_UNSPECIFIED I should use a crafted MemTxAttrs with
.secure = 1, .unspecified = 1? The idea of this command is to use the
CPU AS but not the MMU/MPU, maybe it doesn't make sense...
next prev parent reply other threads:[~2020-03-30 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 15:30 [PATCH-for-5.0] gdbstub: Use correct address space with Qqemu.PhyMemMode packet Philippe Mathieu-Daudé
2020-03-30 16:08 ` Peter Maydell
2020-03-30 16:21 ` Philippe Mathieu-Daudé [this message]
2020-03-30 16:41 ` Peter Maydell
2020-05-31 15:27 ` Philippe Mathieu-Daudé
2020-05-31 16:42 ` Jon Doron
2020-05-31 16:57 ` Peter Maydell
2020-06-01 7:29 ` Jon Doron
2020-06-01 10:39 ` Alex Bennée
2020-06-01 10:41 ` Jon Doron
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=f1fd3384-8653-c2e2-7248-457ae873cc27@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=arilou@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=f4bug@amsat.org \
--cc=luc.michel@greensocs.com \
--cc=peter.maydell@linaro.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).