[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/2] SMBIOS: Fix endian-ness when populating

From: Gabriel L. Somlo
Subject: Re: [Qemu-devel] [PATCH v2 1/2] SMBIOS: Fix endian-ness when populating fields wider than 8-bit
Date: Tue, 13 May 2014 16:21:17 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

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) ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]