On Tue, Nov 05, 2013 at 02:01:14PM +0100, Alexander Graf wrote: > > On 05.11.2013, at 13:28, Cedric Le Goater <clg@xxxxxxxxxx> wrote: > > > +/* > > + * Compare endian order of host and guest to determine whether we need > > + * to byteswap or not > > + */ > > static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu) > > { > > - return vcpu->arch.shared->msr & MSR_LE; > > + return ((mfmsr() & (MSR_LE)) >> MSR_LE_LG) ^ > > mfmsr() is slow. Just use #ifdef __LITTLE_ENDIAN__. Or (MSR_KERNEL & MSR_LE). > > + /* if we are loading data from a guest which is in Split > > + * Little Endian mode, the byte order is reversed > > Only for data. Instructions are still non-reverse. You express this well in the code, but not in the comment. Well, his comment does say "if we are loading data", but I agree it's slightly ambiguous (the guest's instructions are our data). Paul. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html