Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

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

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux