When running a 64 bit virtual cpu in kvm (72+dfsg-4, debian/lenny),
the virtual cpuid reports the cpu as:
vendor_id : GenuineIntel
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 0.9.1
stepping : 3
AFAICT, from intel's cpuid documentation in
http://download.intel.com/design/processor/applnots/24161832.pdf, such
a family/model combination doesn't actually exist (pentiumpro is model
1, pentium II is model 3 and 5, celeron is model 6, etc).
On the other hand the config.guess script in mpir considers anything
models 2 to 6 as being pentium2. Misdetection is already bad because
core 2 optimizations should be much better than pentium II ones. The
build then fails because for a pentium II, the configure logic forces
ABI=32, and this is wrong (configure complains about sizeof(long) not
being 4, indeed it is 8).
----
Of course, this seems to be a bug in kvm; but maybe it should be
workarounded? I don't think it is relevant, but just in case the host
cpu reports family=6, model=23 (it's a core 2 quad Q9550).
After the fact I discovered that one can use the following command
line switch when running kvm:
-cpu qemu64,family=6,model=15,+ssse3
to set family/model to a core2, and also set ssse3 cpu flag (disabled
by default). Unfortunately, this comand line switch doesn't support
models higher than 15, nor the sse4_1 flag.
Best, Gonzalo
In other words, with this patch, any intel processor running in 64 bit
mode is identified as either "nocona" (family 15) or "core2" (family
6). In particular, kvm 64 bits will be decided as "core2". Also, note
that if this patch had been in place before fixing atom and nehalem
model cases, they would have been decided as "core2" also when running
in 64 bit mode.
This (core2) seems a sensible default for intel family 6 processors
running in 64 bit mode (future proof for new models in this family)
Another question is: maybe the default for newer models in 32 bits
should also be set to something more sensible?
Right now, family 15 in 32 bits mode defaults to "p4???", and family 6
in 32 bits mode defaults to "p6???". The former family is most
probably dead already. But family 6 seems to be thriving... would it
make sense to default to "core2" instead?
Note that my patch doesn't change default for 32 bits mode as
suggested above... The changes only affect processors running in 64
bit mode.
Best, Gonzalo
The issue is not new 32 bit processors, but new 64 bit processors
running in 32 bit mode. Say, a new atom running in 32 bit mode (it
would be odd to have an i7 running 32 bit OS).
OTOH, defaulting a new processor in 32 bit mode to whatever won't
affect setting of ABI=32, but defaulting an unknown processor in 64
bit mode to "pentium2" sets ABI=32 instead of ABI=64, which causes a
build failure.
For example, in kvm in 32 bit mode in my core2, config.guess would
return "pentium2", which is probably non-optimal, but still works.
On Sat, Mar 14, 2009 at 5:37 PM, Bill Hart <goodwi...@googlemail.com> wrote:
> I applied Gonzalo's patch. I looked over it carefully. Essentially it
> assumes all 64 bit Intel chips fall into either family 6 (core 2) or
> family 15 (nocona).
Not quite; it assumes intel chips running in 64 bit mode are either
core 2 or nocona. For processors running in 32 bit mode, the behaviour
is not changed.
(unknown processors in 32 bit mode are still labeled as "p6???" or
"p4???" depending on family).
> Checking wikipedia, this appears to be a correct assumption from the
> point of view of mpir where it currently is, though we are eventually
> going to want to distinguish nehalem and atom.
Sure, but that's a longer patch (have config.guess return "atom" or
"nehalem", and have "configure" grok that).
> All core duo's are 32 bit (and long dead).
>
> There seems to be no point identifying atoms and nehalems in the 32
> bit section as they will never identify themselves as such. I think
> setting abi = 32 doesn't affect config.
An atom running in 32 bit mode will identify itself as an atom running
in 32 bit mode, i.e. "uname -m" will report "i686" or something like
that, "configfsf.guess" will pass that back to "config.guess", and the
32 bit sections of that file will apply... Am I getting this right? (I
don't have a 64 bit cpu running 32 bit linux to check)
> But we can do a whole pile of cleaning up in a service release.
>
> Maybe for unidentified 64 bit family we default to x86_64 and for
> unidentified 32 bit chip we default to p4. But again let's fix that in
> the next release.
It makes sense to default an unknown family=15 to "pentium4" or
"prescott", but an unknown family=6 may be better defaulted to
"pentium3" or "core2" ???
Gonzalo
A lot of people run linux 32bit in 64 bit processors. E.g. according
to michael sage binaries for linux 32bit are downloaded much more than
64 bit binaries -- despite most processors from the past 3 years (at
least) having 64 bit mode.
We recently got a new quad core 2 system (Q9550) with 8Gb of ram to
install a sage notebook server (that's me playing with kvm). Our
sysadmin was very kind to install the OS for me, and he installed
debian/lenny..... 32bits... :-)
So, yes, 64 bit processors running in 32 bit mode do exist.
> As for defaults, I definitely think we will change them in the next
> release. Currently what the defaults are, break the build altogether.
>
> p3 and p4 would be safe presumably, but not good if you have a new
> chip which is unrecognised. It is more likely to have something in
> common with core2.
>
> It's a case of damned if you do and damned if you don't. At least if
> it breaks, someone reports it and you get to fix it properly.
Safe is better than broken. However, it may be a good idea to print a
warning to stderr for an unknown processor... Something like
Unknown intel processor, family=FF, model=MM, default to "core2" --
please report to mpir-...@googlegroups.com.
Gonzalo
While we are at this... The kvm issue I originally reported, for intel
cpus, is now fixed in trunk. There's also the same (similar) issue for
kvm 64 bit using amd cpus. This is sage ticket #5186
(http://trac.sagemath.org/sage_trac/ticket/5186), and I think it was
also discussed in this mailing list some time ago.
Short story: kvm virtual cpu 64 bits reports family=6, model=2. Either
that could be special cased when in 64 bit mode, or else the default
for a cpu in 64 bit mode should be x86_64, IOW, don't return "athlon"
when in 64 bit mode, even if the cpuid says so...
Gonzalo