Gentoo Archives: gentoo-user

From: Nilesh Govindrajan <me@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] -march=? for this cpu
Date: Tue, 09 Apr 2013 12:53:53
Message-Id: 51640F47.6090300@nileshgr.com
In Reply to: Re: [gentoo-user] -march=? for this cpu by Pandu Poluan
1 On Tuesday 09 April 2013 12:31:44 PM IST, Pandu Poluan wrote:
2 >
3 > On Apr 9, 2013 1:16 PM, "Michael Hampicke" <gentoo-user@××××.biz
4 > <mailto:gentoo-user@××××.biz>> wrote:
5 > >
6 > > Am 09.04.2013 05:50, schrieb Nilesh Govindrajan:
7 > > > I have two Gentoo VMs at Hetzner and the CPU supports 64 bit (grep lm
8 > > > /proc/cpuinfo = true).
9 > > >
10 > > > But something funny, gcc -march=native -mtune=native -v -E - 2>&1
11 > > > </dev/null returns this:
12 > > >
13 > > > Using built-in specs.
14 > > > COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc
15 > > >
16 > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper
17 > > > Target: x86_64-pc-linux-gnu
18 > > > Configured with:
19 > > > /var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure
20 > > > --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3
21 > > > --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
22 > > > --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3
23 > > > --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/man
24 > > > --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/info
25 > > >
26 > --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4
27 > > > --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
28 > --disable-altivec
29 > > > --disable-fixed-point --without-ppl --without-cloog --enable-lto
30 > > > --enable-nls --without-included-gettext --with-system-zlib
31 > > > --enable-obsolete --disable-werror --enable-secureplt
32 > --enable-multilib
33 > > > --enable-libmudflap --disable-libssp --enable-libgomp
34 > > > --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/python
35 > > > --enable-checking=release --disable-libgcj --enable-libstdcxx-time
36 > > > --enable-languages=c,c++,fortran --enable-shared
37 > --enable-threads=posix
38 > > > --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all
39 > > > --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.6.3
40 > > > p1.11, pie-0.5.2'
41 > > > Thread model: posix
42 > > > gcc version 4.6.3 (Gentoo 4.6.3 p1.11, pie-0.5.2)
43 > > > COLLECT_GCC_OPTIONS='-march=native' '-mtune=native' '-v' '-E'
44 > > > /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v -
45 > > > -march=pentium-m -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul
46 > -mpopcnt
47 > > > -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mbmi -mno-tbm -mno-avx
48 > > > -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=32 --param
49 > > > l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=generic
50 > > > ignoring nonexistent directory "/usr/local/include"
51 > > > ignoring nonexistent directory
52 > > >
53 > "/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/include"
54 > > >
55 > > > #include "..." search starts here:
56 > > > #include <...> search starts here:
57 > > > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include
58 > > > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include-fixed
59 > > > /usr/include
60 > > > End of search list.
61 > > > # 1 "<stdin>"
62 > > > <stdin>:1:0: error: CPU you selected does not support x86-64
63 > instruction
64 > > > set
65 > > >
66 > > > It is returning pentium-m as architecture, which indeed is 32bit. I'm
67 > > > presently running the VM with -march=core2, but this is very weird.
68 > > >
69 > > > This is the /proc/cpuinfo:
70 > > >
71 > > > processor : 0
72 > > > vendor_id : GenuineIntel
73 > > > cpu family : 6
74 > > > model : 2
75 > > > model name : QEMU Virtual CPU version 1.0
76 > > > stepping : 3
77 > > > microcode : 0x1
78 > > > cpu MHz : 3399.998
79 > > > cache size : 4096 KB
80 > > > fpu : yes
81 > > > fpu_exception : yes
82 > > > cpuid level : 4
83 > > > wp : yes
84 > > > flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca
85 > > > cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl
86 > pni vmx
87 > > > cx16 popcnt hypervisor lahf_lm
88 > > > bogomips : 6799.99
89 > > > clflush size : 64
90 > > > cache_alignment : 64
91 > > > address sizes : 40 bits physical, 48 bits virtual
92 > > > power management:
93 > > >
94 > > > Any idea what should be the march/mtune value?
95 > > >
96 > >
97 > > I don't have any experience with Hetzner's VMs - I only use their
98 > > dedicated machines :)
99 > >
100 > > But as a more generic tip, you should install gentoo in VMs only with
101 > > generic optimization. You can not safely rely on what CPU your VM will
102 > > get. Maybe in 6 months the host your vm is on crashes, and your vm will
103 > > be migrated to a new system with totally different cpu (actual hardware
104 > > cpu or the cpu configuration that qemu is going to emulate).
105 > >
106 >
107 > One tip for me: If your VMs are 64-bit, obviously the underlying CPU
108 > must be 64-bit. So, setting -march=nocona should be safe (Nocona is
109 > Intel's first AMD64-compatible CPU).
110 >
111 > Rgds,
112 > --
113 >
114
115 Well, it's a KVM virtual machine. And I'm *currently running* it with
116 -march=core2 on 64bit, but that isn't very safe because it may be
117 migrated any time in case the host fails. I guess it would be best to
118 use generic x86_64?
119 Or perhaps switch to 32bit because it's just 2 GB of RAM and it can't
120 be bumped up any further (top end config).
121
122 Some search reveals that it's an upstream bug where the CPU is detected
123 as pentium m which happens to be 32 bit.

Attachments

File name MIME type
smime.p7s application/pkcs7-signature

Replies

Subject Author
Re: [gentoo-user] -march=? for this cpu Michael Hampicke <gentoo-user@××××.biz>