All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	kvm-devel <kvm@vger.kernel.org>,
	Pekka Enberg <penberg@kernel.org>,
	Will Deacon <Will.Deacon@arm.com>
Subject: Re: [PATCH v4 9/9] kvmtool: virtio: enable arm/arm64 support for bi-endianness
Date: Thu, 08 May 2014 11:15:28 +0100	[thread overview]
Message-ID: <536B5940.2050709@arm.com> (raw)
In-Reply-To: <CAFEAcA9VfHnN5xh=_xy_5O3hjmXuaw9tGJe5wKd=n8+Yswe15w@mail.gmail.com>

On 08/05/14 11:06, Peter Maydell wrote:
> On 8 May 2014 10:32, Marc Zyngier <marc.zyngier@arm.com> wrote:
>> +int kvm_cpu__get_endianness(struct kvm_cpu *vcpu)
>> +{
>> +       struct kvm_one_reg reg;
>> +       u64 psr;
>> +       u64 sctlr;
>> +
>> +       /*
>> +        * Quoting the definition given by Peter Maydell:
>> +        *
>> +        * "Endianness of the CPU which does the virtio reset at the
>> +        * point when it does that reset"
>> +        *
>> +        * We first check for an AArch32 guest: its endianness can
>> +        * change when using SETEND, which affects the CPSR.E bit.
>> +        *
>> +        * If we're AArch64, use SCTLR_EL1.E0E if access comes from
>> +        * EL0, and SCTLR_EL1.EE if access comes from EL1.
>> +        */
> 
> I note that the set of checks described here match the logic
> of the ARM ARM BigEndian() pseudocode function, which is
> a good sign.

Pure luck. Or maybe I'm now going slightly mad. Either way, consistency
is good... ;-)

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2014-05-08 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  9:32 [PATCH v4 0/9] kvmtool: handle guests of a different endianness Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 1/9] kvmtool: pass trapped vcpu to MMIO accessors Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 2/9] kvmtool: virt_queue configuration based on endianness Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 3/9] kvmtool: sample CPU endianness on virtio-mmio device reset Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 4/9] kvmtool: add queue endianness initializer Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 5/9] kvmtool: convert console backend to support bi-endianness Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 6/9] kvmtool: convert 9p " Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 7/9] kvmtool: convert blk " Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 8/9] kvmtool: convert net " Marc Zyngier
2014-05-08  9:32 ` [PATCH v4 9/9] kvmtool: virtio: enable arm/arm64 support for bi-endianness Marc Zyngier
2014-05-08 10:06   ` Peter Maydell
2014-05-08 10:15     ` Marc Zyngier [this message]
2014-05-08 10:43   ` Will Deacon

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=536B5940.2050709@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=penberg@kernel.org \
    --cc=peter.maydell@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.