Skip to contentSkip to conversation

Remove unnecessary code in 64bit CPU identification.

X86 Dave Jones 2 participants 10 messages May 20, 2008 – May 22, 2008 x86

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

arch/x86/kernel/setup_64.c +2 -11
index ff62838..0380726 100644
@@ -1042,20 +1042,11 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
 		}
 		if (xlvl >= 0x80000004)
 			get_model_name(c); /* Default name */
-	}
 
-	/* Transmeta-defined flags: level 0x80860001 */
-	xlvl = cpuid_eax(0x80860000);
-	if ((xlvl & 0xffff0000) == 0x80860000) {
-		/* Don't set x86_cpuid_level here for now to not confuse. */
-		if (xlvl >= 0x80860001)
-			c->x86_capability[2] = cpuid_edx(0x80860001);
+		if (xlvl >= 0x80000007)
+			c->x86_power = cpuid_edx(0x80000007);
 	}
 
-	c->extended_cpuid_level = cpuid_eax(0x80000000);
-	if (c->extended_cpuid_level >= 0x80000007)
-		c->x86_power = cpuid_edx(0x80000007);
-
 	switch (c->x86_vendor) {
 	case X86_VENDOR_AMD:
 		early_init_amd(c);
author
#1 lore raw
Quoted 4 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

argh, after reading this a dozen times, I send it, and then notice a typo. That should be ' eliminate calling cpuid 0x80000000 twice'

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#2 lore raw
In reply to Dave Jones
Quoted 6 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

I'd really like to avoid divergences between the 32-bit and 64-bit code if they can be avoided at this point. These codes need to be unified, not further split.

-hpa

author
#3 lore raw
Quoted 11 lines · H. Peter Anvin
Quoted 6 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

I'd really like to avoid divergences between the 32-bit and 64-bit code if they can be avoided at this point. These codes need to be unified, not further split.

Umm, the 32 bit code has the per-vendor stuff removed from setup.c, and factored out into per-vendor files in arch/x86/kernel/cpu/ Because the 64bit version doesn't do that (yet), my removal of this code actually gets us closer to unification. After my patch, neither of the setup.c files have the Transmeta bits :)

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#4 lore raw
Quoted 9 lines · Dave Jones
Quoted 8 lines · H. Peter Anvin
Quoted 6 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

Quoted 9 lines
Quoted 3 lines

I'd really like to avoid divergences between the 32-bit and 64-bit code if they can be avoided at this point. These codes need to be unified, not further split.

Umm, the 32 bit code has the per-vendor stuff removed from setup.c, and factored out into per-vendor files in arch/x86/kernel/cpu/ Because the 64bit version doesn't do that (yet), my removal of this code actually gets us closer to unification. After my patch, neither of the setup.c files have the Transmeta bits :)

*Shrug* ... it seems like pointless churn to code that really needs to die to me.

-hpa

author
#5 lore raw
Quoted 14 lines · H. Peter Anvin
Quoted 13 lines · Dave Jones
Quoted 11 lines · H. Peter Anvin
Quoted 6 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

I'd really like to avoid divergences between the 32-bit and 64-bit code if they can be avoided at this point. These codes need to be unified, not further split.

Quoted 8 lines
Quoted 5 lines

Umm, the 32 bit code has the per-vendor stuff removed from setup.c, and factored out into per-vendor files in arch/x86/kernel/cpu/ Because the 64bit version doesn't do that (yet), my removal of this code actually gets us closer to unification. After my patch, neither of the setup.c files have the Transmeta bits :)

*Shrug* ... it seems like pointless churn to code that really needs to die to me.

setup_64.c | 13 ++-----------

 1 file changed, 2 insertions(+), 11 deletions(-)

It's a slow death, but it's easier to chip away at the obvious parts..

Dave

Signature · 1 line
http://www.codemonkey.org.uk
author
#6 lore raw
In reply to H. Peter Anvin
Quoted 14 lines · H. Peter Anvin
Quoted 13 lines · Dave Jones
Quoted 11 lines · H. Peter Anvin
Quoted 6 lines · Dave Jones

There were no 64bit Transmeta CPUs made (and it'd be something of
a surprise if they started any time soon). To the best of my knowledge,
no CPU vendor cloned the 80860000 cpuid space claimed by Transmeta. By removing this code, we can also eliminate calling cpuid 0x80000007 twice.

I'd really like to avoid divergences between the 32-bit and 64-bit code if they can be avoided at this point. These codes need to be unified, not further split.

Quoted 8 lines
Quoted 5 lines

Umm, the 32 bit code has the per-vendor stuff removed from setup.c, and factored out into per-vendor files in arch/x86/kernel/cpu/ Because the 64bit version doesn't do that (yet), my removal of this code actually gets us closer to unification. After my patch, neither of the setup.c files have the Transmeta bits :)

*Shrug* ... it seems like pointless churn to code that really needs to die to me.

Moving along the same direction.. Moving the vendor specific bits out of setup_64.c into cpu/ would go a long way towards killing of setup64.c. I took a first pass at doing this in the diff below. So far I only looked at the AMD specific bits, and haven't done a complete conversion to cpu_dev style initialisation as done on 32bit, but that can easily be performed later after moving all the code out into its respective places. (downside: a bunch of externs in the interim).

comments on this before I go any further?

Dave

arch/x86/kernel/cpu/Makefile +1 -0
index a0c6f81..ef065c1 100644
@@ -7,6 +7,7 @@ obj-y			+= proc.o feature_names.o
 
 obj-$(CONFIG_X86_32)	+= common.o bugs.o
 obj-$(CONFIG_X86_32)	+= amd.o
+obj-$(CONFIG_X86_64)	+= amd_64.o
 obj-$(CONFIG_X86_32)	+= cyrix.o
 obj-$(CONFIG_X86_32)	+= centaur.o
 obj-$(CONFIG_X86_32)	+= transmeta.o
arch/x86/kernel/cpu/amd_64.c new file +252 -0

252 lines not on this page · raw message

arch/x86/kernel/setup_64.c +6 -225

261 lines not on this page · raw message

Signature · 1 line
http://www.codemonkey.org.uk
#7 lore raw
Quoted 10 lines · Dave Jones

Moving along the same direction.. Moving the vendor specific bits out of setup_64.c into cpu/ would go a long way towards killing of setup64.c. I took a first pass at doing this in the diff below. So far I only looked at the AMD specific bits, and haven't done a complete conversion to cpu_dev style initialisation as done on 32bit, but that can easily be performed later after moving all the code out into its respective places. (downside: a bunch of externs in the interim).

comments on this before I go any further?

Looks good to me at first glance, and would definitely be a good step on the way.

-hpa

#8 lore raw
In reply to Dave Jones
Quoted 10 lines · Dave Jones

Moving along the same direction.. Moving the vendor specific bits out of setup_64.c into cpu/ would go a long way towards killing of setup64.c. I took a first pass at doing this in the diff below. So far I only looked at the AMD specific bits, and haven't done a complete conversion to cpu_dev style initialisation as done on 32bit, but that can easily be performed later after moving all the code out into its respective places. (downside: a bunch of externs in the interim).

comments on this before I go any further?

Hi Dave,

I was going to pull this into -tip, but I need a Signed-off-by: line in order to do so. Could you resend this so we can add it to -tip?

-hpa

author
#9 lore raw
Quoted 9 lines · H. Peter Anvin
Quoted 8 lines · Dave Jones

Moving along the same direction.. Moving the vendor specific bits out of setup_64.c into cpu/ would go a long way towards killing of setup64.c. I took a first pass at doing this in the diff below. So far I only looked at the AMD specific bits, and haven't done a complete conversion to cpu_dev style initialisation as done on 32bit, but that can easily be performed later after moving all the code out into its respective places. (downside: a bunch of externs in the interim).

Quoted 7 lines
Quoted 2 lines

comments on this before I go any further?

Hi Dave,

I was going to pull this into -tip, but I need a Signed-off-by: line in order to do so. Could you resend this so we can add it to -tip?

Yeah, I was going to rediff against tip and resend them, but I went into the office instead yesterday, where nothing productive ever happens :-)

I'll get to it today.

Dave

Signature · 1 line
http://www.codemonkey.org.uk