Nehelem & 64 bit, kern conf and /etc/make.conf

b. f. bf1783 at googlemail.com
Sun Jan 31 15:21:41 UTC 2010


>I just installed FreeBSD 8.0 (amd64) onto my new Nehalem-based system.
>
>CPU: Intel(R) Xeon(R) CPU           L5506  @ 2.13GHz (2128.00-MHz K8-class CPU)
>  Origin = "GenuineIntel"  Id = 0x106a5  Stepping = 5
>  >Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MC>A,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>  >Features2=0x9ce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,SSE4.2,POPCNT>
>  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
>  AMD Features2=0x1<LAHF>
>  TSC: P-state invariant
>
>
>I am now in the process of configuring the kernel config file.
>
>A few questions;
>
>1. Is the kernel config file I want to modify
>/usr/src/sys/amd64/conf/GENERIC ?  (Copy that file as /root/PORKY, and
>set up a symlink from /usr/src/sys/amd64/conf to /root/PORKY.)

You don't have to do this: you could just use GENERIC.  But if you
want to build a custom kernel, and you are not familiar with all of
the kernel options, GENERIC is a good starting point.

>
>2. What should I set this line to:
>cpu             HAMMER
>Right now it's "HAMMER", I have no idea what Hammer is.  What would be
>the best thing to set it to?  I want to be as specific as possible for
>my CPU type.

Leave this alone.  If you change it, you will break your kernel.  It's
not meant to be customized: it's just a name that was chosen because
it happened to be AMD's prototype 64-bit CPU at the time the amd64
port was being written.

>
>3. The instructions here:
>http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
>mention a line like this:
>machine        i386
>(which would probably by "amd64" in my case), but the "machine" line
>is missing entirely from GENERIC conf file.  Should I add it?

No, leave it alone.  The documentation is outdated; this option is now
set in DEFAULTS, which is a small list of very important stuff that
every kernel of a certain architecture must contain in order to
function properly.   It is not meant to be customizable.

>
>4. In /etc/make.conf, I'm used to having, for example:
>CPUTYPE?=core2
>What would be my CPU in this case (Xeon L5506)?  I know this line is
>not necessary, but I'd like to set it to the most specific kind of CPU
>possible for my case to gain any optimizations, so long as it does not
>make my system unstable.

This option is only used to set the flags for the C and C++ compilers.
 The base system compiler for FreeBSD 7-9 is a patched version of gcc
4.2, and is hooked up to a patched version of binutils 2.15.  This
compiler suite and tool-chain are not new enough to take full
advantage of your CPU: the best you can do is set it to auto-detect
your CPU, or hard-code it to the most modern compatible CPU that
existed when the compiler suite and tool-chain were written.  However,
some people have started to use newer compilers and tool-chains from
FreeBSD Ports (some ports even require it), and if you do that, you
may need a different value.  Probably, your best bet is to use:

CPUTYPE?= native

and to check to make sure that the base system compiler is actually
equating this with 'nocona', and enabling all of your SIMD extensions
that it supports.  This won't make a great deal of difference for
kernel performance, but it will affect other base system programs and
ports if you are using CFLAGS with -march or other optimization flags.


b.


More information about the freebsd-questions mailing list