[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v5] target-ppc: ppc64 target's virtio can be eithe

From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH v5] target-ppc: ppc64 target's virtio can be either endian
Date: Mon, 14 Apr 2014 14:27:53 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 14.04.14 14:12, Greg Kurz wrote:
We turn the virtio_is_big_endian() helper into a target dependant hook
to compute endianness for legacy virtio devices.

We base it on the OS endian, as reflected by the endianness of the
interrupt vectors (handled through the ILE bit in the LPCR register).

Using first_cpu to fetch the registers from KVM may look arbitrary
and awkward, but it is okay because KVM sets/unsets the ILE bit on
all CPUs.

Note that Book3e has no LPCR and worse, has a unrelated spr at the same
index... I did not find better than strcmp() to ensure we are using
the correct register.

Suggested-by: Benjamin Herrenschmidt <address@hidden>
Signed-off-by: Rusty Russell <address@hidden>
[ re-use the existing virito_is_big_endian() helper,
   check we have LPCR,
   Greg Kurz <address@hidden> ]
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>

Works for me :).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]