From: Peter Maydell <peter.maydell@linaro.org>
To: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Cc: "patches@apm.com" <patches@apm.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Christoffer Dall" <christoffer.dall@linaro.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [PATCH V3 2/2] target-arm: Guest cpu endianness determination for virtio KVM ARM/ARM64
Date: Thu, 5 Feb 2015 11:48:25 +0000 [thread overview]
Message-ID: <CAFEAcA8FYN3VG4q4GmTT99XeXid-1SNW+ommtUtp8vaK86sQJQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9pCvTy6_5pVN-3zHtC=Ju=QuHvXn15hBnm-27Ahwm=Rg@mail.gmail.com>
On 5 February 2015 at 11:43, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 5 February 2015 at 09:59, Pranavkumar Sawargaonkar
> <pranavkumar@linaro.org> wrote:
>> +
>> + /* In 32bit guest endianess is determined by looking at CPSR's E bit */
>> + if (!is_a64(env)) {
>> + return (env->pstate & CPSR_E) ? 1 : 0;
>
> This is wrong, because if we're not 32-bit then the CPSR
> isn't in env->pstate but in env->cpsr_uncached. (I'm guessing
> you didn't test 32-bit guests.)
Actually thinking about it your code would have worked for the
common 32-bit guest case, since if we fall through to looking
at SCTLR then (assuming the guest is at EL1 which it will be when
it's messing with the virtio device) we'll end up checking the
32-bit SCTLR EE bit, which will be the same as the current
guest endianness for any sane guest kernel. So I apologise
for suggesting you didn't test that case.
-- PMM
next prev parent reply other threads:[~2015-02-05 11:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 9:59 [Qemu-devel] [PATCH V3 0/2] Add virtio endianness determination in KVM ARM/ARM64 Pranavkumar Sawargaonkar
2015-02-05 9:59 ` [Qemu-devel] [PATCH V3 1/2] target-arm: KVM64: Get and Sync up guest register state like kvm32 Pranavkumar Sawargaonkar
2015-02-05 9:59 ` [Qemu-devel] [PATCH V3 2/2] target-arm: Guest cpu endianness determination for virtio KVM ARM/ARM64 Pranavkumar Sawargaonkar
2015-02-05 11:43 ` Peter Maydell
2015-02-05 11:48 ` Peter Maydell [this message]
2015-02-06 16:43 ` Pranavkumar Sawargaonkar
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=CAFEAcA8FYN3VG4q4GmTT99XeXid-1SNW+ommtUtp8vaK86sQJQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=christoffer.dall@linaro.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=patches@apm.com \
--cc=pranavkumar@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).