From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc <qemu-ppc@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for, reading/writing registers
Date: Mon, 20 Jan 2014 11:49:31 -0600 [thread overview]
Message-ID: <52DD61AB.7030709@linux.vnet.ibm.com> (raw)
In-Reply-To: <CE6AA10D-0E2B-4304-9A13-650A638D36E1@suse.de>
On 01/20/2014 08:33 AM, Alexander Graf wrote:
> On 17.01.2014, at 22:02, Thomas Falcon <tlfalcon@linux.vnet.ibm.com> wrote:
>
>> This patch allows registers to be properly read from and written to
>> when using the gdbstub to debug a ppc guest running in little
>> endian mode. It accomplishes this goal by byte swapping the values of
>> any registers if the MSR:LE value is set.
>>
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
>> ---
>> Differences from v2:
>>
>> Fixed formatting issues
>> Added logic to ensure only FP registers have a guaranteed size of 8 bytes
>
> I don't really like how the write case has to know about the size of a register (maybe we could factor this out into a single function for all reads and writes?), but this is good enough for now :). However, I can't apply the patch as your email client seems to have broken the patch formatting.
>
>
> Alex
>
>
I'm not sure of a way to swap the value without knowing its size. In both read and write, the size needs to be known and is hardcoded in some cases. The write case cannot know the size without a conditional since we need to swap in mem_buf before we call ppc_cpu_gdb_write_register. Maybe we could get around this by hanging ppc_cpu_gdb_write_register so that it returns a pointer to the register being overwritten, and then we could swap that instead of mem_buf? But even then I guess we would still need to check the size of the register before we called bswap32/64.
Anyway, sorry about the formatting issues again. Should I just resubmit the patch as is?
Thanks,
Tom
next prev parent reply other threads:[~2014-01-20 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 21:02 [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for, reading/writing registers Thomas Falcon
2014-01-20 14:33 ` Alexander Graf
2014-01-20 17:49 ` Thomas Falcon [this message]
2014-01-20 18:39 ` Alexander Graf
-- strict thread matches above, loose matches on Subject: below --
2014-01-20 20:11 [Qemu-devel] [PATCH v3] target-ppc: gdbstub allow byte swapping for " Thomas Falcon
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=52DD61AB.7030709@linux.vnet.ibm.com \
--to=tlfalcon@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).