DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st October 2008
Deluted Deluted is offline
New User
 
Join Date: Oct 2008
Posts: 5
Thanked 0 Times in 0 Posts
Default CPUTYPE for VIA C7-M

Hello, I'm planning to install FreeBSD 7.0 on a HP 2133 Mini-Note. However, I have tried to find the CPUTYPE to use in make.conf and I cannot find a concrete answer.

The closest ones in make.conf seem to be c3 or c3-m but I'm not sure whether that will work on a C7-M type. The Safe CFLAGS on Gentoo-Wiki says "i686" but I'm not sure whether that is a valid CPUTYPE. Searching this forum turns up "native" as an alternative, but there are reports of it not working properly in FreeBSD 7.0 due to some bug.

Any ideas?
Reply With Quote
  #2   (View Single Post)  
Old 21st October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Gentoo != FreeBSD
Do nothing, just skip editing make.conf....
Reply With Quote
  #3   (View Single Post)  
Old 21st October 2008
Deluted Deluted is offline
New User
 
Join Date: Oct 2008
Posts: 5
Thanked 0 Times in 0 Posts
Default

I know FreeBSD is not the same as Gentoo, but I came across a post on checking out the Safe CFLAGS page here so I'd thought it could give me a clue on what to use.

So, you think I should just leave make.conf alone? Would it make my programs slower than if CPUTYPE was set, or would the difference be minuscule?
Reply With Quote
  #4   (View Single Post)  
Old 21st October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

you won't probably notice significant difference.

Another thing on FreeBSD, you NEVER edit Cflags, they break things...



Show output of
Code:
$ dmesg | grep cpu
Reply With Quote
  #5   (View Single Post)  
Old 21st October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

The gcc man page has a list of CPUTYPE options, which are -march flags to gcc.

I always set my CPUTYPE, and it works great. Since I compile everything locally, I come up with a fairly optimized system overall, and I'm very happy with the performance of it.
Reply With Quote
  #6   (View Single Post)  
Old 21st October 2008
Deluted Deluted is offline
New User
 
Join Date: Oct 2008
Posts: 5
Thanked 0 Times in 0 Posts
Default

Code:
$ dmesg | grep cpu
cpu0: <ACPI CPU> on acpi0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
I have also looked at the man page for gcc and found generic, native, i686, c3 and c3-2 under the -mtune=cpu-type section. Are any of those right?
Reply With Quote
  #7   (View Single Post)  
Old 21st October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

ups, my mistake, i mean
show output of
Code:
$ dmesg | grep CPU
Reply With Quote
  #8   (View Single Post)  
Old 21st October 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by Deluted View Post
So, you think I should just leave make.conf alone? Would it make my programs slower than if CPUTYPE was set, or would the difference be minuscule?
If you really want to notice a difference, try FreeBSD amd64 with a pair of high end server CPUs and a crap load of RAM.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #9   (View Single Post)  
Old 21st October 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

The list of known CPUTYPEs and what CPUs they can be used for is listed in /usr/share/examples/etc/make.conf

For FreeBSD 7.0, there's nothing listed specifically for the VIA C7.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 22nd October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Any or all of i686, c3, and c3-2 could be correct for your chip. I can't say which one is correct. If in doubt, use i686 as that will most certainly produce sane, compatible code. One of c3 or c3-2 will likely produce more optimized code, but I have no way to know which would work for you. Study the gcc man page and what it says about it of those options, then compare that data to what you know about the CPU you have.

As someone who knows something about VIA chips, do you happen to know the core model of your chip? I am not as familiar with C7's. One other thing you'll want to remember to do is to enable the Padlock functionality in your kernel by enabling it in your kernel config, or running kldload padlock.

Last edited by mdh; 22nd October 2008 at 03:35 AM.
Reply With Quote
Old 22nd October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by phoenix View Post
For FreeBSD 7.0, there's nothing listed specifically for the VIA C7.
This is because there aren't signifigant enough differences between what VIA sells as C3 and what they sell as C7, architecturally, therefore GCC doesn't have a seperate optimization profile for those sold as C7s. It's marketing terminology more than a genuine difference in technology. That said, there are some very signifigant differences between some early (Cyrix design based) C3 chips, and the latter chips which forked very far from the early Cyrix designs and implemented some really cool stuff like the Padlock RNG and crypto instruction sets.
Reply With Quote
Old 22nd October 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

Quote:
Originally Posted by mdh View Post
That said, there are some very signifigant differences between some early (Cyrix design based) C3 chips, and the latter chips which forked very far from the early Cyrix designs and implemented some really cool stuff like the Padlock RNG and crypto instruction sets.
That sounds to me like c3-2 is the best one.
So, cpu I686_CPU in your kernel config file, and CPUTYPE=c3-2 in make.conf

And leave CFLAGS and COPTFLAGS alone!
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
Old 22nd October 2008
Deluted Deluted is offline
New User
 
Join Date: Oct 2008
Posts: 5
Thanked 0 Times in 0 Posts
Default

Code:
$ dmesg | grep CPU
CPU: VIA/IDT Unknown (1596.01-MHz 686-class CPU)
cpu0: <ACPI CPU> on acpi0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
At the moment, I'm leaning towards i686 for CPUTYPE considering the information above. Any last suggestions?
Reply With Quote
Old 22nd October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Code:
# The CPUTYPE variable controls which processor should be targeted for
# generated code.  This controls processor-specific optimizations in
# certain code (currently only OpenSSL) as well as modifying the value
# of CFLAGS to contain the appropriate optimization directive to gcc.
# The automatic setting of CFLAGS may be overridden using the
# NO_CPU_CFLAGS variable below.
# Currently the following CPU types are recognized:
#   Intel x86 architecture:
#       (AMD CPUs)      opteron athlon64 athlon-mp athlon-xp athlon-4
#                       athlon-tbird athlon k8 k6-3 k6-2 k6 k5
#       (Intel CPUs)    core2 core nocona pentium4m pentium4 prescott
#                       pentium3m pentium3 pentium-m pentium2
#                       pentiumpro pentium-mmx pentium i486 i386
#       (Via CPUs)      c3 c3-2
#   Alpha/AXP architecture: ev67 ev6 pca56 ev56 ev5 ev45 ev4
#   AMD64 architecture: opteron, athlon64, nocona, prescott, core2
#   Intel ia64 architecture: itanium2, itanium
CPUTYPE=i686 ain't supported by make.conf
i686 is something like Pentium 2 (i'f i'mm correct, hold on i'll check), but who know's how compitable via's chip is
just leave it alone (or use i486 or c3 or c3-2)
Reply With Quote
Old 22nd October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

yup, i686 was introduced with name Pentium Pro and Pentium 2, the i686 still lives on.... in nowadays chips

and pentium 1 was i586

Last edited by graudeejs; 22nd October 2008 at 06:39 PM.
Reply With Quote
Old 22nd October 2008
Deluted Deluted is offline
New User
 
Join Date: Oct 2008
Posts: 5
Thanked 0 Times in 0 Posts
Default

I've looked at a normal dmesg and found this:
Code:
CPU: VIA/IDT Unknown (1596.01-MHz 686-class CPU)
  Origin = "CentaurHauls"  Id = 0x6d0  Stepping = 0
  Features=0xa7c9bbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,
CMOV,PAT,CLFLUSH,ACPI,MMX,FXSR,SSE,SSE2,TM,PBE>
Features2=0x4181<SSE3,EST,TM2,xTPR>
I then found this in bsd.cpu.mk:
Code:
.  elif ${CPUTYPE} == "c3"
MACHINE_CPU = 3dnow mmx i586 i486 i386
.  elif ${CPUTYPE} == "c3-2"
MACHINE_CPU = sse mmx i586 i486 i386
Since my CPU apparently supports SSE and c3-2 has it included, I'm going to try using c3-2 as my CPUTYPE. If it all goes wrong, then I'll revert back to a blank configuration.

I have also left the FLAGS stuff alone.

Thanks to all of you for helping me!
Reply With Quote
Old 22nd October 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,067
Thanked 198 Times in 156 Posts
Default

Quote:
Another thing on FreeBSD, you NEVER edit Cflags, they break things...
Only if you don't know what you're doing.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 22nd October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
Only if you don't know what you're doing.
i know..., that's why i always say to leave them alone
Reply With Quote
Old 22nd October 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
Only if you don't know what you're doing.
In my opinion, that rules out most people who lack commit access to the FreeBSD src ;-)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 23rd October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by robbak View Post
That sounds to me like c3-2 is the best one.
So, cpu I686_CPU in your kernel config file, and CPUTYPE=c3-2 in make.conf

And leave CFLAGS and COPTFLAGS alone!
No. Use CPUTYPE?=, not CPUTYPE=. This allows the build system to override it if necessary.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick