From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cedric Le Goater Subject: Re: [PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests Date: Fri, 08 Nov 2013 15:29:21 +0100 Message-ID: <527CF541.4080508@fr.ibm.com> References: <1381241531-27940-4-git-send-email-clg@fr.ibm.com> <20131008233123.GB17420@iris.ozlabs.ibm.com> <5F0A1154-D417-454C-A3CD-59AEF7EF0D97@suse.de> <20131009055920.GA10650@drongo> <20131010101607.GB9906@iris.ozlabs.ibm.com> <3404F831-6354-4C22-B06C-64628279CC1F@suse.de> <5278E472.5060604@fr.ibm.com> <84018BDE-858B-4F59-8AA0-9135CCFF4720@suse.de> <20131106055537.GH14842@drongo> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alexander Graf , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org mailing list" To: Paul Mackerras Return-path: In-Reply-To: <20131106055537.GH14842@drongo> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 11/06/2013 06:55 AM, Paul Mackerras wrote: > On Tue, Nov 05, 2013 at 02:01:14PM +0100, Alexander Graf wrote: >> >> On 05.11.2013, at 13:28, Cedric Le Goater 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). yes. That is better. I will resend the patch with an update. That was quite laborious for a single line patch ... Thanks, C.