From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwK7g-0001f3-Jd for qemu-devel@nongnu.org; Mon, 08 Jul 2013 18:41:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwK7f-0007GK-3F for qemu-devel@nongnu.org; Mon, 08 Jul 2013 18:41:32 -0400 Message-ID: <1373323278.4446.61.camel@pasglop> From: Benjamin Herrenschmidt Date: Tue, 09 Jul 2013 08:41:18 +1000 In-Reply-To: <87sizosnoj.fsf@codemonkey.ws> References: <1372315560-5478-1-git-send-email-aik@ozlabs.ru> <1372315560-5478-9-git-send-email-aik@ozlabs.ru> <87sizozyjl.fsf@codemonkey.ws> <1373319954.4446.52.camel@pasglop> <87sizosnoj.fsf@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/17] pseries: savevm support for PAPR TCE tables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alexey Kardashevskiy , Alexander Graf , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Paul Mackerras , David Gibson On Mon, 2013-07-08 at 17:15 -0500, Anthony Liguori wrote: > Hypercall arguments are passed in CPU endianness so what's being stored > in the tce table is CPU endianness. > > Since VBUFFER just does a blind write() of the full array of uint64s, > what goes on the wire will be CPU endianness. > > So if you do a savevm on a little endian host and loadvm on a big endian > host, badness ensues. > > The proper thing to do is use a VARRAY instead of a VBUFFER. VARRAY > will handle endian because it treats the data as an array, not as an > opaque buffer. Ok, so that's indeed an issue for emulated TCEs because what qemu stores is not the real (BE) TCE table but a "host native" version of it. I see. Cheers, Ben.