From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6NVx-0000MD-G0 for qemu-devel@nongnu.org; Wed, 31 Dec 2014 12:56:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y6NVq-0002CT-8I for qemu-devel@nongnu.org; Wed, 31 Dec 2014 12:56:57 -0500 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:62561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6NVq-0002CC-2F for qemu-devel@nongnu.org; Wed, 31 Dec 2014 12:56:50 -0500 Received: by mail-wg0-f46.google.com with SMTP id x13so22329074wgg.19 for ; Wed, 31 Dec 2014 09:56:49 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54A438DB.6090209@redhat.com> Date: Wed, 31 Dec 2014 18:56:43 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1420024880-15416-1-git-send-email-lersek@redhat.com> <54A3F829.4000509@redhat.com> <54A4032A.7050808@redhat.com> <54A42304.7030909@redhat.com> <54A42C83.1090807@redhat.com> In-Reply-To: <54A42C83.1090807@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] fw_cfg: fix endianness in fw_cfg_data_mem_read() / _write() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek , Peter Maydell Cc: Alexander Graf , Drew Jones , Gerd Hoffmann , qemu devel list On 31/12/2014 18:04, Laszlo Ersek wrote: > > *If* it prints the number that the guest CPU sees immediately when it > performs the wide read, then it should print 0x0000000032cb0046, on both > big and little endian hosts; assuming a little endian guest. Yes. Paolo > Namely, the fw_cfg (sub)string in question is [0x46, 0x00, 0xcb, 0x32]. > The device is big endian, and the register accessor function should > return the 0x4600cb32 host value in qemu. The guest CPU should see the > same byte array [0x46, 0x00, 0xcb, 0x32], whose direct interpretation in > the little endian guest is 0x32cb0046.