From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: "Carlos A. M. dos Santos" <unixmania@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification
Date: Mon, 11 Aug 2008 15:51:15 +0100 [thread overview]
Message-ID: <200808111551.16227.paul@codesourcery.com> (raw)
In-Reply-To: <e71790db0808110556q866962cw4961c404e6b96b06@mail.gmail.com>
> >> #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.
Paul
next prev parent reply other threads:[~2008-08-11 14:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-11 10:37 [Qemu-devel] [PATCH 1/3] [x86] Clean up vendor identification Alexander Graf
2008-08-11 11:56 ` Laurent Vivier
2008-08-11 12:32 ` Alexander Graf
2008-08-11 12:50 ` Laurent Vivier
2008-08-11 13:37 ` M. Warner Losh
2008-08-11 14:05 ` Laurent Vivier
2008-08-11 12:56 ` Carlos A. M. dos Santos
2008-08-11 14:51 ` Paul Brook [this message]
2008-08-11 15:22 ` Carlos A. M. dos Santos
2008-08-11 13:04 ` Paul Brook
2008-08-11 13:35 ` M. Warner Losh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200808111551.16227.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
--cc=unixmania@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.