qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification


From: Carlos A. M. dos Santos
Subject: Re: [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification
Date: Mon, 11 Aug 2008 12:22:31 -0300

On Mon, Aug 11, 2008 at 11:51 AM, Paul Brook <address@hidden> wrote:
>> >> #define CPUID_VENDOR_INTEL_1 'Genu'
>> >> ...
>> >
>> > Is that a real improvement? It won't make the code faster and the
>> > readability doesn't improve that much either.
>>
>> I'd take it as a security improvement. One can easily commit a typo
>> when editting magic numbers, either decimal or hexa.
>
> I don't believe this argument at all. A bug is a bug, it's got nothing to do
> with "security".  If anything the hex values are more reliable because you
> don't have to guess how the string is converted to an integer - this is
> proved by the fact that the above suggestion is incorrect[1].  The hex values
> are given in the cpu reference docs, so there shouldn't be any doubt whether
> they are correct.
>
> [1] As someone else mentioned (though not very clearly) gcc interprets 'Genu'
> as a big-endian value, whereas the Intel docs define "Genu" as being
> little-endian.

Right, this kills my argument. Let's go forward and stop wasting time
discussing the color of the bikeshed. :-)

-- 
If you think things can't get worse it's probably only
because you lack sufficient imagination.




reply via email to

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