Skip to contentSkip to conversation

Make common x86 arch area for i386 and x86_64

PATCH Linus Torvalds 6 participants 7 messages Mar 13, 2007 – Mar 14, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Steven Rostedt

What we have currently is a bunch of hacks. Seems that people can't make up their mind to what to do.

I don't mind the patches, but I'd be a lot happier if it also was a stated intention to actually make it be buildable as "x86", the same way that the separate 32-bit and 64-bit POWER architectures were merged into just one architecture that could be built either way.

For the POWER merge, we had (and probably still have) legacy platforms that could only be built the old way (ie if you needed to build for certain legacy 32-bit targets, you still needed to use the "ppc" architecture, so I'm not saying that it has to all be converted, but I think that we should at least *aim* for unifying 32-bit and 64-bit x86.

The "32-bit code has legcay issues" thing that Andi complained about (eg there's no guarantee of a HPET on 32-bit x86) doesn't really change the fact that yes, we have to support those legacy issues *anyway*, and 64-bit x86 certainly has its set of issues already too.

We've started to notice that the i386 build gets broken now that most developers tend to have newer CPU's and run mostly on x86-64 (and yes, that's me too), and while I don't think unifying things will guarantee that doesn't happen in the future, it will hopefully at least help make it not get much *worse*.

As it is, the build environment has to know to pass in "-m32/-m64" anyway..

Linus

#2 lore raw
Quoted 10 lines · Linus Torvalds
Quoted 3 lines · Steven Rostedt

What we have currently is a bunch of hacks. Seems that people can't make up their mind to what to do.

I don't mind the patches, but I'd be a lot happier if it also was a stated intention to actually make it be buildable as "x86", the same way that the separate 32-bit and 64-bit POWER architectures were merged into just one architecture that could be built either way.

That's actually a larger goal, but for the immediate future, I figure this would be a good first step. Start out by stating what's similar, and then build off of this for something bigger. But in the mean time, we can have a staging ground for work that's for both i386 and x86_64 archs. And for those that know these systems in a more intimate way (Andi :) they can work off of this to make that monster.

-- Steve

#3 lore raw
In reply to Linus Torvalds
Quoted 6 lines · Linus Torvalds
Quoted 3 lines · Steven Rostedt

What we have currently is a bunch of hacks. Seems that people can't make up their mind to what to do.

I think they work fine. I don't like such large scale renaming -- they are a pain for anybody with external patches and make regression hunting later painful. And the gain is about zero as far as I can see. It won't fix a single bug, just cause pain.

Quoted 5 lines

I don't mind the patches, but I'd be a lot happier if it also was a stated intention to actually make it be buildable as "x86", the same way that the separate 32-bit and 64-bit POWER architectures were merged into just one architecture that could be built either way.

I've thought about it, but it would be a lot of work and regression test on old hardware would be a nightmare.

Besides still x86-64 is a lot cleaner than i386 and imho easier to hack and with all the 32bit quirks readded it would probably become worse than current i386. The only good option would be a "modern 32bit only" but even that gets complicated quickly when you consider all the corner cases. And a clean 32bit port wouldn't cover enough hardware to be usable by distributions.

And I also don't have really time to work on that.

Quoted 2 lines

The "32-bit code has legcay issues" thing that Andi complained about (eg there's no guarantee of a HPET on 32-bit x86) doesn't really change the

Most 64bit doesn't neither.

Quoted 2 lines

fact that yes, we have to support those legacy issues *anyway*, and 64-bit x86 certainly has its set of issues already too.

Yes :/ The more supported systems, the more junk.

The recent nmi watchdog issues are a good example. All just because a few vendors write crappy AML/SMM code.

Quoted 5 lines

We've started to notice that the i386 build gets broken now that most developers tend to have newer CPU's and run mostly on x86-64 (and yes, that's me too), and while I don't think unifying things will guarantee that doesn't happen in the future, it will hopefully at least help make it not get much *worse*.

Build test would be needed anyways, doesn't make much difference I guess.

Quoted 2 lines

As it is, the build environment has to know to pass in "-m32/-m64" anyway..

It already does that.

-Andi

#4 lore raw
Quoted 9 lines · Andi Kleen
Quoted 6 lines · Linus Torvalds
Quoted 3 lines · Steven Rostedt

What we have currently is a bunch of hacks. Seems that people can't make up their mind to what to do.

I think they work fine.

My first instinct was to agree with Andi, or maybe have a "shared" directory a-la x86/. But I had a fruitful discussion with the PowerPC people, who went through (and are still completing) the transition to one directory.

Their verdict, surprisingly, was definitely positive. They started with a single powerpc dir which simply included ppc64/ or ppc/, then pulled parts into that directory until ppc64/ was gone. The things left in ppc/ are being slowly merged, and some may be dropped entirely.

They can obviously speak for themselves, but the cleanup caused by the movement was seen as a net win.

Rusty.

#5 lore raw
In reply to Linus Torvalds
Quoted 5 lines · Linus Torvalds

We've started to notice that the i386 build gets broken now that most developers tend to have newer CPU's and run mostly on x86-64 (and yes, that's me too), and while I don't think unifying things will guarantee that doesn't happen in the future, it will hopefully at least help make it not get much *worse*.

actually, even for 'cutting edge' testers, the number of 32-bit x86 systems outnumber the number of 64-bit test-systems by a factor of 5. For distributions with real users, the ratio is closer to 1:10...

so i typically get bugs reported on 32-bit first, and for 64-bit it is usually only reported if the bug is 64-bit /only/. That basic property is true for both upstream, -rt and rawhide kernels.

Andi's x86 merge tree /does/ break quite often on 32-bit, but that's not really due to testers, that's due to Andi being primarily the 64-bit maintainer ;)

Ingo

#6 lore raw
In reply to a message not in the archive
Quoted 5 lines · * Steven Rostedt ([email protected]) wrote:

Recently I've been doing some work that will affect both the i386 and x86_64 architectures. So there will be common code for both, as well as code that will be unique for the specific arch. So I was looking into a way to do this cleanly, and found that there is no clean way to share code between x86_64 and i386.

Thanks for taking this on. I'm sure Andi has a bunch of ideas on this topic, but it would be nice to see the consolidation.

Quoted 7 lines

So the move patches are a simple move of one file, with the slight exception of files that hold the speedstep-lib.h file. This file was moved from the arch/i386/kerne/cpu/cpufreq directory and put into the include/asm-i386 directory. This was due to the fact that some of the moved files included it, and some files that were not moved also included it. Instead of using the #include "../../x86/" hack again, I just simply moved it to the global i386 include directory. Only the arch/x86 will use the include/asm-i386

what about asm-x86/ dir? the asm/ symlink would still point to relevant arch, but the file there could be simply #include <asm-x86/file.h> ?

thanks,
-chris

#7 lore raw
Quoted 2 lines · Chris Wright

what about asm-x86/ dir? the asm/ symlink would still point to relevant arch, but the file there could be simply #include <asm-x86/file.h> ?

Would it be acceptable to have an include/asm-x86/ dir with one file? Of course it will open the door to merge current code and share it there too.

-- Steve