On 8 May 2014 10:32, Marc Zyngier <[email protected]> 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.

thanks
-- PMM
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to