Problem building gmp-5.0.2 on qemu-kvm

Alexandros Kosiaris alex at noc.grnet.gr
Fri Dec 9 12:55:13 CET 2011


On 08/12/2011 03:47 μμ, Torbjorn Granlund wrote:
> Alexandros Kosiaris <alex at noc.grnet.gr> writes:
> 
> The arguments passed to qemu-kvm were definitely non processor
> specific. You can find them below in case it helps.
> 
> /usr/bin/kvm -name snf-1119 -m 1024 -smp 1 -pidfile snf-1119
> -daemonize -boot c -drive
> file=snf-1119:0,format=raw,if=virtio,boot=on,cache=none -usb
> -usbdevice tablet -monitor unix:snf-1119.monitor,server,nowait 
> -serial none -netdev type=tap,id=netdev0,fd=10 -device 
> virtio-net-pci,mac=aa:0c:ea:63:c0:1e,netdev=netdev0
> 
> Also the output of cpuid2 (I only attach it once since there is no 
> difference in the output whether in freebsd or debian) is below.
> 
> snf-1119:~$ gcc cpuid2.c -o cpuid2 root at snf-1119:~$ ./cpuid2 
> GenuineIntel Highest value understood by CPUID: 4 Highest extended
> value understood by CPUID: 8000000a 00000623 Family   6 Model    2 
> Stepping 3
> 
> So qemu is telling GMP this is a 32bit processor.  GMP is DTRT.
> 
> You perhaps need to tell (your version of) qemu to emulate a 64-but 
> processor?  IIRC, the -M option can be used for that.
> 
> Please follow up to the list with the outcome.
> 

Hello,

So ... after some digging I 've come up with the following

-M option has little effect. It supports:

pc         Standard PC (alias of pc-0.12)
pc-0.12    Standard PC (default)
pc-0.11    Standard PC, qemu 0.11
pc-0.10    Standard PC, qemu 0.10
isapc      ISA-only PC

Apart from isapc which i did not try the rest have no effect on this
specific issue.

-cpu option supports:

x86           qemu64
x86           phenom
x86         core2duo
x86            kvm64
x86           qemu32
x86          coreduo
x86              486
x86          pentium
x86         pentium2
x86         pentium3
x86           athlon
x86             n270

the default is qemu64 (the one i supplied you the output with)

kvm64 produces the following output


On 08/12/2011 03:47 μμ, Torbjorn Granlund wrote:
> Alexandros Kosiaris <alex at noc.grnet.gr> writes:
>
>   The arguments passed to qemu-kvm were definitely non processor specific.
>   You can find them below in case it helps.
>
>   /usr/bin/kvm -name snf-1119 -m 1024 -smp 1 -pidfile snf-1119 -daemonize
>   -boot c -drive file=snf-1119:0,format=raw,if=virtio,boot=on,cache=none
>   -usb -usbdevice tablet -monitor unix:snf-1119.monitor,server,nowait
>   -serial none -netdev type=tap,id=netdev0,fd=10 -device
>   virtio-net-pci,mac=aa:0c:ea:63:c0:1e,netdev=netdev0
>
>   Also the output of cpuid2 (I only attach it once since there is no
>   difference in the output whether in freebsd or debian) is below.
>
>   snf-1119:~$ gcc cpuid2.c -o cpuid2
>   root at snf-1119:~$ ./cpuid2
>   GenuineIntel
>   Highest value understood by CPUID: 4
>   Highest extended value understood by CPUID: 8000000a
>   00000623
>   Family   6
>   Model    2
>   Stepping 3
>
> So qemu is telling GMP this is a 32bit processor.  GMP is DTRT.
>
> You perhaps need to tell (your version of) qemu to emulate a 64-but
> processor?  IIRC, the -M option can be used for that.
>
> Please follow up to the list with the outcome.
>

Hello,

So ... after some digging I 've come up with the following

-M option has little effect. It supports:

pc         Standard PC (alias of pc-0.12)
pc-0.12    Standard PC (default)
pc-0.11    Standard PC, qemu 0.11
pc-0.10    Standard PC, qemu 0.10
isapc      ISA-only PC

Apart from isapc which I did not try the rest have no effect on this
specific issue.

-cpu option supports:

x86           qemu64
x86           phenom
x86         core2duo
x86            kvm64
x86           qemu32
x86          coreduo
x86              486
x86          pentium
x86         pentium2
x86         pentium3
x86           athlon
x86             n270

the default is qemu64 (the one i supplied you the output with)

kvm64 produces the attached output in cpuid2.c and gmp compiles fine.
I did not test with the rest of the options. I assume they should be
emulating the CPU mentioned in the name.

However the 64 in qemu64 puzzled me. While reporting a Pentium II
processor it obviously supports 64-bit. So reading up a bit I realized
cpuid2.c does not call cpuid with EAX=0x80000001 and does not check if
the 29-bit of the extended feature flags (aka longmode-capable-bit) is
set. Maybe gmp ./configure process does the same thing...

Am I correct in the above?

-- 
Alexandros Kosiaris 	Network Operation Center , GRNET S.A.
e-mail : alex at noc.grnet.gr
Public Key Fingerprint :
D6B1 0634 BE65 719C 6C95  7492 8201 4B46 C478 F074


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kvm64
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20111209/90d541a8/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5649 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20111209/90d541a8/attachment.bin>


More information about the gmp-bugs mailing list