From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Mark Rutland <mark.rutland@arm.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm <qemu-arm@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
omair.javaid@linaro.org
Subject: Re: [Qemu-devel] [PATCH v1 1/2] target/arm: kvm64 make guest debug AA32 break point aware
Date: Fri, 14 Dec 2018 16:26:08 +0000 [thread overview]
Message-ID: <87ftv013dr.fsf@linaro.org> (raw)
In-Reply-To: <a78b697f-4bb8-f54e-28a9-34ecf6a40f29@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> On 12/13/18 8:55 AM, Alex Bennée wrote:
>>
>> Ard Biesheuvel <ard.biesheuvel@linaro.org> writes:
>>
>>> Hi Alex,
>>>
>>> Thanks again for looking into this.
>>>
>>> On Thu, 13 Dec 2018 at 12:55, Alex Bennée <alex.bennee@linaro.org> wrote:
>> <snip>
>>>
>>>>
>>>> int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp)
>>>> {
>>>> + CPUARMState *env = &ARM_CPU(cs)->env;
>>>> + int el = arm_current_el(env);
>>>> + bool is_aa64 = arm_el_is_aa64(env, el);
>>>> + const uint32_t *bpi = is_aa64 ? &brk_insn : &bkpt_insn;
>>>> +
>>>> if (have_guest_debug) {
>>>> if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_insn, 4, 0) ||
>>>> - cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&brk_insn, 4, 1)) {
>>>> + cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)bpi, 4, 1)) {
>>>
>>> Should we be dealing with endianness here?
>>>
>> <snip>
>>
>> I don't think so - everything eventually ends up (ld|st)n_p which deals
>> with the endianness details.
>
> I think Ard is right. You need to consider dynamic endianness with
>
> bswap_code(arm_sctlr_b(env))
*sigh* I guess. It of course still a heuristic that can break because we
don't know if the system will have switched mode by the time it gets to
the breakpoint.
--
Alex Bennée
next prev parent reply other threads:[~2018-12-14 16:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 11:55 [Qemu-devel] [PATCH v1 0/2] Fix kvm guest debugging of AA32 guests on AA64 Alex Bennée
2018-12-13 11:55 ` [Qemu-devel] [PATCH v1 1/2] target/arm: kvm64 make guest debug AA32 break point aware Alex Bennée
2018-12-13 12:36 ` Ard Biesheuvel
2018-12-13 14:55 ` Alex Bennée
2018-12-13 22:25 ` Richard Henderson
2018-12-14 16:26 ` Alex Bennée [this message]
2018-12-14 16:40 ` Ard Biesheuvel
2018-12-13 22:21 ` Richard Henderson
2018-12-14 8:37 ` Omair Javaid
2018-12-14 13:53 ` Richard Henderson
2018-12-13 11:55 ` [Qemu-devel] [PATCH v1 2/2] target/arm: defer setting up of aarch64 gdb until arm_cpu_realize Alex Bennée
2018-12-13 23:10 ` Richard Henderson
2019-01-04 15:35 ` Peter Maydell
2019-01-07 8:49 ` Alex Bennée
2018-12-13 11:57 ` [Qemu-devel] [PATCH v1 0/2] Fix kvm guest debugging of AA32 guests on AA64 Mark Rutland
2018-12-13 15:28 ` Alex Bennée
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=87ftv013dr.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=ard.biesheuvel@linaro.org \
--cc=mark.rutland@arm.com \
--cc=omair.javaid@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).