linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* x86 merge: Keep kernel/cpu for CPU specific code?
@ 2007-11-13 11:44 Robert Richter
  2007-11-13 12:02 ` Adrian Bunk
  2007-11-13 13:53 ` Andi Kleen
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Richter @ 2007-11-13 11:44 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: LKML

x86 CPU specific code is currently implemented in different ways for
64 and 32 bit. While there are almost no CPU specific files for 64
bit, there is the arch/x86/kernel/cpu/ directory for 32 bit. Is there
already an idea about whether to use kernel/cpu also for 64 bit?

Thanks,

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86 merge: Keep kernel/cpu for CPU specific code?
  2007-11-13 11:44 x86 merge: Keep kernel/cpu for CPU specific code? Robert Richter
@ 2007-11-13 12:02 ` Adrian Bunk
  2007-11-13 14:14   ` Robert Richter
  2007-11-13 13:53 ` Andi Kleen
  1 sibling, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2007-11-13 12:02 UTC (permalink / raw)
  To: Robert Richter; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, LKML

On Tue, Nov 13, 2007 at 12:44:43PM +0100, Robert Richter wrote:
> x86 CPU specific code is currently implemented in different ways for
> 64 and 32 bit. While there are almost no CPU specific files for 64
> bit, there is the arch/x86/kernel/cpu/ directory for 32 bit. Is there
> already an idea about whether to use kernel/cpu also for 64 bit?

It is also used for 64bit for years.

> Thanks,
> 
> -Robert

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86 merge: Keep kernel/cpu for CPU specific code?
  2007-11-13 11:44 x86 merge: Keep kernel/cpu for CPU specific code? Robert Richter
  2007-11-13 12:02 ` Adrian Bunk
@ 2007-11-13 13:53 ` Andi Kleen
  1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2007-11-13 13:53 UTC (permalink / raw)
  To: Robert Richter; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, LKML

"Robert Richter" <robert.richter@amd.com> writes:

> x86 CPU specific code is currently implemented in different ways for
> 64 and 32 bit. While there are almost no CPU specific files for 64
> bit, there is the arch/x86/kernel/cpu/ directory for 32 bit. Is there
> already an idea about whether to use kernel/cpu also for 64 bit?

Well it's already used as it has been pointed out. 

Regarding the core initialization code:

The 32bit set up here is kind of crappy. Initcalls that are commented
out, weird ordering, unrelated stuff mixed toegether etc. If you
consider "improving" 64bit here then I would suggest to do some major
clean up in the 32bit parts first.

I personally consider the single file cleaner to hack, but then 64bit
is already vastly simpler anyways because it has much less CPUs to support.

If anything it would probably make sense to separate out generic
stuff (like GDT initialization) from CPU specific initialization.
64bit already separates that better too, but it's also not fully complete.

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86 merge: Keep kernel/cpu for CPU specific code?
  2007-11-13 12:02 ` Adrian Bunk
@ 2007-11-13 14:14   ` Robert Richter
  2007-11-13 17:59     ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Richter @ 2007-11-13 14:14 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Andi Kleen, LKML

On 13.11.07 13:02:08, Adrian Bunk wrote:
> On Tue, Nov 13, 2007 at 12:44:43PM +0100, Robert Richter wrote:
> > x86 CPU specific code is currently implemented in different ways for
> > 64 and 32 bit. While there are almost no CPU specific files for 64
> > bit, there is the arch/x86/kernel/cpu/ directory for 32 bit. Is there
> > already an idea about whether to use kernel/cpu also for 64 bit?
> 
> It is also used for 64bit for years.

Yes, but almost all files in arch/x86/kernel/cpu/ depend on
CONFIG_X86_32.

Here is an example for similiar implementations:

arch/x86/kernel/cpu/amd.c:static void __cpuinit init_amd(struct cpuinfo_x86 *c)
arch/x86/kernel/setup_64.c:static void __cpuinit init_amd(struct cpuinfo_x86 *c)

The question is, will there be a CPU specific file such as amd.c?

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86 merge: Keep kernel/cpu for CPU specific code?
  2007-11-13 14:14   ` Robert Richter
@ 2007-11-13 17:59     ` H. Peter Anvin
  0 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2007-11-13 17:59 UTC (permalink / raw)
  To: Robert Richter
  Cc: Adrian Bunk, Thomas Gleixner, Ingo Molnar, Andi Kleen, LKML

Robert Richter wrote:
> On 13.11.07 13:02:08, Adrian Bunk wrote:
>> On Tue, Nov 13, 2007 at 12:44:43PM +0100, Robert Richter wrote:
>>> x86 CPU specific code is currently implemented in different ways for
>>> 64 and 32 bit. While there are almost no CPU specific files for 64
>>> bit, there is the arch/x86/kernel/cpu/ directory for 32 bit. Is there
>>> already an idea about whether to use kernel/cpu also for 64 bit?
>> It is also used for 64bit for years.
> 
> Yes, but almost all files in arch/x86/kernel/cpu/ depend on
> CONFIG_X86_32.
> 
> Here is an example for similiar implementations:
> 
> arch/x86/kernel/cpu/amd.c:static void __cpuinit init_amd(struct cpuinfo_x86 *c)
> arch/x86/kernel/setup_64.c:static void __cpuinit init_amd(struct cpuinfo_x86 *c)
> 
> The question is, will there be a CPU specific file such as amd.c?
> 

That's my current intent, as I consider the 32-bit code cleaner even 
though Andi disagrees.  That doesn't mean it's good enough as-is, of 
course, but I would like to maintain things reasonably well separated out.

	-hpa


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-13 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 11:44 x86 merge: Keep kernel/cpu for CPU specific code? Robert Richter
2007-11-13 12:02 ` Adrian Bunk
2007-11-13 14:14   ` Robert Richter
2007-11-13 17:59     ` H. Peter Anvin
2007-11-13 13:53 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).