Received: from eggs.gnu.org ([2001:4830:134:3::10]:56629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkJCa-0002eh-SX for qemu-devel@nongnu.org; Tue, 13 May 2014 16:21:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkJCR-0003Qm-NO for qemu-devel@nongnu.org; Tue, 13 May 2014 16:21:28 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:64442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkJCR-0003Qg-JT for qemu-devel@nongnu.org; Tue, 13 May 2014 16:21:19 -0400 Received: by mail-qg0-f41.google.com with SMTP id j5so1248542qga.0 for ; Tue, 13 May 2014 13:21:19 -0700 (PDT) Date: Tue, 13 May 2014 16:21:17 -0400 From: "Gabriel L. Somlo" Message-ID: <20140513202115.GO30030@ERROL.INI.CMU.EDU> References: <1400005030-20729-1-git-send-email-somlo@cmu.edu> <1400005030-20729-2-git-send-email-somlo@cmu.edu> <53727C09.1010208@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53727C09.1010208@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] SMBIOS: Fix endian-ness when populating fields wider than 8-bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: lersek@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On Tue, May 13, 2014 at 10:09:45PM +0200, Paolo Bonzini wrote: > Il 13/05/2014 20:17, Gabriel L. Somlo ha scritto: > >- t->processor_id[0] = smbios_cpuid_version; > >- t->processor_id[1] = smbios_cpuid_features; > >+ t->processor_id[0] = smbios_cpuid_version; /* opaque, no cpu_to_le16 */ > >+ t->processor_id[1] = smbios_cpuid_features; /* opaque, no cpu_to_le16 */ > > Actually I think these should be subject to cpu_to_le32. They > correspond to CPUID values, so they are little-endian 32-bit. Right, my comment is wrong, should be "no need for cpu_to_le32()" instead of what I said ("no need for cpu_to_le16()")... :) Re. why I said "opaque, no need for endianness fix" is because they're a straight-through assignment from cpu->env.cpuid_version and cpu->env.features[FEAT_1_EDX], respectively. So they're not really "numbers" which need endianness adjustment. Did I get that wrong ? (I mean, besides the 16 vs. 32 in the comment) ? Thanks, --Gabriel