LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-23-2008, 12:33 PM   #1
stringZ
Member
 
Registered: Dec 2006
Posts: 42

Rep: Reputation: 15
2.6.27.7 - Why -mno-mmx is used when it's Pentium-MMX?


Hey,

I've been installing the latest Linux kernel 2.6.27.7 from source tarballs and saw a weird thing over the process. The compile scripts seem to ignore the fact I've chosen Pentium-MMX at CPU selection in `make menuconfig` and imply gcc flags like -mno-mmx -mcpu=i686, only -march=pentium-mmx seems to be correct.

Here is the whole parameter list (log of the compile):

gcc -E -D__GENKSYMS__ -Wp,-MD,net/ieee80211/.ieee80211_module.o.d -nostdinc -isystem /usr/lib/gcc-lib/i486-linux/3.3.5/include -D__KERNEL__ -Iinclude -I/usr/src/linux-2.6.27.7/arch/x86/include -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -m32 -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=pentium-mmx -mcpu=i686 -ffreestanding -DCONFIG_AS_CFI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Iinclude/asm-x86/mach-default -fomit-frame-pointer -DMODULE -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(ieee80211_module) -DKBUILD_MODNAME=KBUILD_STR(ieee80211) net/ieee80211/ieee80211_module.c

/usr/lib/gcc-lib/i486-linux/3.3.5/cc1 -E -quiet -nostdinc -Iinclude -I/usr/src/linux-2.6.27.7/arch/x86/include -Iinclude/asm-x86/mach-default -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=5 -D__GENKSYMS__ -D__KERNEL__ -DCONFIG_AS_CFI=1 -DMODULE -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(ieee80211_module) -DKBUILD_MODNAME=KBUILD_STR(ieee80211) -isystem /usr/lib/gcc-lib/i486-linux/3.3.5/include -include include/linux/autoconf.h -MD net/ieee80211/.ieee80211_module.o.d net/ieee80211/ieee80211_module.c -m32 -msoft-float -mregparm=3 -mpreferred-stack-boundary=2 -march=pentium-mmx -mcpu=i686 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -Werror-implicit-function-declaration -Wno-sign-compare -fno-strict-aliasing -fno-common -freg-struct-return -ffreestanding -fno-asynchronous-unwind-tables -fomit-frame-pointer -O2

Is this a known issue? Do the flags mean something else?

Thanks in advance
stringZ

Last edited by stringZ; 11-23-2008 at 12:44 PM.
 
Old 11-24-2008, 08:38 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
I once had something similar when compiling a kernel (2.6.18.1) - its menuconfig seemed a bit broken...

I fixed this by editing the .config file in the kernel source folder by hand. You might need to do this too?

E.g . I did

vi .config

in the kernel source tree, searched for the parameter I wanted (it had to with DMA) and I set that parameter on.

Parameters that are commented / off usually have the form

#FORCE_DMA_BLOCKS

which means it is not set. To set it change it to

FORCE_DMA_BLOCKS=y

(Note the above is only for illustrative purposes - I don't think such a parameter even exists... in any version of the kernel!)

E. g. in your case look for the parameter that you want sent, and see if in the .config you menuconfig produced,if it IS, in fact, set. If it is NOT set, set it like detailed above... It was the only way I managed to get certain options set the way I wanted them set.

Maybe you can do this too this way??
 
Old 11-24-2008, 09:18 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Within the configuration file, there are a set of options that determine the target CPU-type and model. I would very strongly suggest that you make sure that the one correct option has been specified, and "beyond that, leave it alone." One can presume that the Kernel Developers (and the other Lesser Gods) knew what they were about...

This is the World of the Arcane Mysteries. Step inside, breathe just a little of the heady incense, and then get the hell out of there...
 
Old 11-24-2008, 10:42 AM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Could you show us the actual value in your .config file just to verify that you saved it with the right CPU value?
 
Old 11-27-2008, 09:17 AM   #5
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 228

Rep: Reputation: 54
-march=pentium-mmx defines the CPU that the code will require to run.
-mcpu=i686 specifies the CPU that the code is to be optimized for. i686 is actually a synonym for generic and generates code that is not specifically optimized for any processor model, i.e., it should run well on all models.

-mno-mmx says that compiler-generated code must not use the new MMX registers. Only applications use MMX registers; kernel code is not allowed to use them because then the kernel would have to save and restore these registers every time a program makes a system call, which would be less efficient overall.
 
Old 11-27-2008, 11:12 AM   #6
stringZ
Member
 
Registered: Dec 2006
Posts: 42

Original Poster
Rep: Reputation: 15
cladisch: okay, so this is what makes my old PENTIUM I more efficient instead of slowing it down, right?
 
Old 11-27-2008, 11:58 AM   #7
cladisch
Member
 
Registered: Oct 2008
Location: Earth
Distribution: Slackware
Posts: 228

Rep: Reputation: 54
Quote:
Originally Posted by stringZ View Post
okay, so this is what makes my old PENTIUM I more efficient instead of slowing it down, right?
Yes.

You can get code optimized specifically for your CPU by disabling CONFIG_X86_GENERIC.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pentium MMX ekdya Linux - Hardware 5 03-05-2006 02:23 PM
Installation problem with a Pentium-MMX Paulo Góes Conectiva 1 08-30-2004 02:29 PM
devil-linux and pentium mmx zioponics Linux - Distributions 0 10-10-2003 05:18 AM
Overclocking a Pentium 200 w/MMX php General 7 08-23-2001 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration