From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56921 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PITyZ-0004ZZ-3o for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PITyY-0001Rw-1e for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:26:06 -0500 Received: from mail-qw0-f45.google.com ([209.85.216.45]:46732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PITyX-0001Jt-Vq for qemu-devel@nongnu.org; Tue, 16 Nov 2010 17:26:06 -0500 Received: by mail-qw0-f45.google.com with SMTP id 2so464598qwi.4 for ; Tue, 16 Nov 2010 14:26:05 -0800 (PST) Message-ID: <4CE304FF.9020804@codemonkey.ws> Date: Tue, 16 Nov 2010 16:26:07 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] pc: Fix e820 fw_cfg for big endian References: <20101108035143.26532.81891.stgit@s20.home> In-Reply-To: <20101108035143.26532.81891.stgit@s20.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: blauwirbel@gmail.com, jes.sorensen@redhat.com, qemu-devel@nongnu.org On 11/07/2010 09:57 PM, Alex Williamson wrote: > Signed-off-by: Alex Williamson > Applied. Thanks. Regards, Anthony Liguori > --- > > Compile tested only. Only current user is kvm, no cross-arch users. > > hw/pc.c | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index 0264e3d..cc8ec14 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -467,19 +467,19 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) > > int e820_add_entry(uint64_t address, uint64_t length, uint32_t type) > { > - int index = e820_table.count; > + int index = le32_to_cpu(e820_table.count); > struct e820_entry *entry; > > if (index>= E820_NR_ENTRIES) > return -EBUSY; > - entry =&e820_table.entry[index]; > + entry =&e820_table.entry[index++]; > > - entry->address = address; > - entry->length = length; > - entry->type = type; > + entry->address = cpu_to_le64(address); > + entry->length = cpu_to_le64(length); > + entry->type = cpu_to_le32(type); > > - e820_table.count++; > - return e820_table.count; > + e820_table.count = cpu_to_le32(index); > + return index; > } > > static void *bochs_bios_init(void) > > > >