2005-04-17 05:20:36 +07:00
|
|
|
#include <linux/kernel.h>
|
2006-02-17 05:41:58 +07:00
|
|
|
#include <linux/mm.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/msr.h>
|
|
|
|
#include "cpu.h"
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 05:23:59 +07:00
|
|
|
static void early_init_transmeta(struct cpuinfo_x86 *c)
|
2008-09-14 16:33:16 +07:00
|
|
|
{
|
|
|
|
u32 xlvl;
|
|
|
|
|
|
|
|
/* Transmeta-defined flags: level 0x80860001 */
|
|
|
|
xlvl = cpuid_eax(0x80860000);
|
|
|
|
if ((xlvl & 0xffff0000) == 0x80860000) {
|
|
|
|
if (xlvl >= 0x80860001)
|
|
|
|
c->x86_capability[2] = cpuid_edx(0x80860001);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 05:23:59 +07:00
|
|
|
static void init_transmeta(struct cpuinfo_x86 *c)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
|
|
|
unsigned int cap_mask, uk, max, dummy;
|
|
|
|
unsigned int cms_rev1, cms_rev2;
|
2007-02-13 19:26:25 +07:00
|
|
|
unsigned int cpu_rev, cpu_freq = 0, cpu_flags, new_cpu_rev;
|
2005-04-17 05:20:36 +07:00
|
|
|
char cpu_info[65];
|
|
|
|
|
2008-09-14 16:33:16 +07:00
|
|
|
early_init_transmeta(c);
|
|
|
|
|
2009-11-21 20:01:45 +07:00
|
|
|
cpu_detect_cache_sizes(c);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/* Print CMS and CPU revision */
|
|
|
|
max = cpuid_eax(0x80860000);
|
|
|
|
cpu_rev = 0;
|
2008-02-23 05:10:28 +07:00
|
|
|
if (max >= 0x80860001) {
|
|
|
|
cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
|
2005-04-17 05:20:36 +07:00
|
|
|
if (cpu_rev != 0x02000000) {
|
|
|
|
printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
|
|
|
|
(cpu_rev >> 24) & 0xff,
|
|
|
|
(cpu_rev >> 16) & 0xff,
|
|
|
|
(cpu_rev >> 8) & 0xff,
|
|
|
|
cpu_rev & 0xff,
|
|
|
|
cpu_freq);
|
|
|
|
}
|
|
|
|
}
|
2008-02-23 05:10:28 +07:00
|
|
|
if (max >= 0x80860002) {
|
2005-04-17 05:20:36 +07:00
|
|
|
cpuid(0x80860002, &new_cpu_rev, &cms_rev1, &cms_rev2, &dummy);
|
|
|
|
if (cpu_rev == 0x02000000) {
|
|
|
|
printk(KERN_INFO "CPU: Processor revision %08X, %u MHz\n",
|
|
|
|
new_cpu_rev, cpu_freq);
|
|
|
|
}
|
|
|
|
printk(KERN_INFO "CPU: Code Morphing Software revision %u.%u.%u-%u-%u\n",
|
|
|
|
(cms_rev1 >> 24) & 0xff,
|
|
|
|
(cms_rev1 >> 16) & 0xff,
|
|
|
|
(cms_rev1 >> 8) & 0xff,
|
|
|
|
cms_rev1 & 0xff,
|
|
|
|
cms_rev2);
|
|
|
|
}
|
2008-02-23 05:10:28 +07:00
|
|
|
if (max >= 0x80860006) {
|
2005-04-17 05:20:36 +07:00
|
|
|
cpuid(0x80860003,
|
|
|
|
(void *)&cpu_info[0],
|
|
|
|
(void *)&cpu_info[4],
|
|
|
|
(void *)&cpu_info[8],
|
|
|
|
(void *)&cpu_info[12]);
|
|
|
|
cpuid(0x80860004,
|
|
|
|
(void *)&cpu_info[16],
|
|
|
|
(void *)&cpu_info[20],
|
|
|
|
(void *)&cpu_info[24],
|
|
|
|
(void *)&cpu_info[28]);
|
|
|
|
cpuid(0x80860005,
|
|
|
|
(void *)&cpu_info[32],
|
|
|
|
(void *)&cpu_info[36],
|
|
|
|
(void *)&cpu_info[40],
|
|
|
|
(void *)&cpu_info[44]);
|
|
|
|
cpuid(0x80860006,
|
|
|
|
(void *)&cpu_info[48],
|
|
|
|
(void *)&cpu_info[52],
|
|
|
|
(void *)&cpu_info[56],
|
|
|
|
(void *)&cpu_info[60]);
|
|
|
|
cpu_info[64] = '\0';
|
|
|
|
printk(KERN_INFO "CPU: %s\n", cpu_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unhide possibly hidden capability flags */
|
|
|
|
rdmsr(0x80860004, cap_mask, uk);
|
|
|
|
wrmsr(0x80860004, ~0, uk);
|
|
|
|
c->x86_capability[0] = cpuid_edx(0x00000001);
|
|
|
|
wrmsr(0x80860004, cap_mask, uk);
|
2007-02-13 19:26:24 +07:00
|
|
|
|
|
|
|
/* All Transmeta CPUs have a constant TSC */
|
2008-02-26 14:52:39 +07:00
|
|
|
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
|
2008-02-23 05:10:28 +07:00
|
|
|
|
2005-08-02 11:11:44 +07:00
|
|
|
#ifdef CONFIG_SYSCTL
|
2008-02-23 05:10:28 +07:00
|
|
|
/*
|
|
|
|
* randomize_va_space slows us down enormously;
|
|
|
|
* it probably triggers retranslation of x86->native bytecode
|
|
|
|
*/
|
2005-08-01 12:34:42 +07:00
|
|
|
randomize_va_space = 0;
|
2005-08-02 11:11:44 +07:00
|
|
|
#endif
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
x86: delete __cpuinit usage from all x86 files
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
are flagged as __cpuinit -- so if we remove the __cpuinit from
arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
content into no-ops as early as possible, since that will get rid
of these warnings. In any case, they are temporary and harmless.
This removes all the arch/x86 uses of the __cpuinit macros from
all C files. x86 only had the one __CPUINIT used in assembly files,
and it wasn't paired off with a .previous or a __FINIT, so we can
delete it directly w/o any corresponding additional change there.
[1] https://lkml.org/lkml/2013/5/20/589
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-06-19 05:23:59 +07:00
|
|
|
static const struct cpu_dev transmeta_cpu_dev = {
|
2005-04-17 05:20:36 +07:00
|
|
|
.c_vendor = "Transmeta",
|
|
|
|
.c_ident = { "GenuineTMx86", "TransmetaCPU" },
|
2008-09-14 16:33:16 +07:00
|
|
|
.c_early_init = early_init_transmeta,
|
2005-04-17 05:20:36 +07:00
|
|
|
.c_init = init_transmeta,
|
2008-09-05 02:09:45 +07:00
|
|
|
.c_x86_vendor = X86_VENDOR_TRANSMETA,
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
2008-09-05 02:09:45 +07:00
|
|
|
cpu_dev_register(transmeta_cpu_dev);
|