[PATCH v5 4/6] KVM: PPC: Book3S: modify kvmppc_need_byteswap() for little endian host

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

 



If the host is in little endian order, there is no need to byte-swap
in little endian guests.

Signed-off-by: Cédric Le Goater <clg@xxxxxxxxxx>
---
 arch/powerpc/include/asm/kvm_book3s.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index ac06434..6974aa0 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -272,7 +272,11 @@ static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu)
 
 static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu)
 {
+#ifdef __LITTLE_ENDIAN__
+	return !(vcpu->arch.shared->msr & MSR_LE);
+#else
 	return vcpu->arch.shared->msr & MSR_LE;
+#endif
 }
 
 static inline bool kvmppc_is_bigendian(struct kvm_vcpu *vcpu)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux