Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121300
b: refs/heads/master
c: 213cc06
h: refs/heads/master
v: v3
  • Loading branch information
Pekka J Enberg authored and Ingo Molnar committed Dec 19, 2008
1 parent 88bd6ac commit ea6e101
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 104 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3eeeefbf1cd1d142c52238cc19c75d14c3bc8d5
refs/heads/master: 213cc060797378059a28ebc5c539f3e9a80160bd
5 changes: 1 addition & 4 deletions trunk/arch/x86/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */
#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* "" FXSAVE leaks FOP/FIP/FOP */
#define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */
#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */
#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */
#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */
#define X86_FEATURE_SYSCALL32 (3*32+14) /* "" syscall in ia32 userspace */
Expand All @@ -91,8 +92,6 @@
#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */
#define X86_FEATURE_AMDC1E (3*32+21) /* AMD C1E detected */
#define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */
#define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */
#define X86_FEATURE_NONSTOP_TSC (3*32+24) /* TSC does not stop in C states */

/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */
Expand All @@ -118,7 +117,6 @@
#define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */
#define X86_FEATURE_OSXSAVE (4*32+27) /* "" XSAVE enabled in the OS */
#define X86_FEATURE_AVX (4*32+28) /* Advanced Vector Extensions */
#define X86_FEATURE_HYPERVISOR (4*32+31) /* Running on a hypervisor */

/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
#define X86_FEATURE_XSTORE (5*32+ 2) /* "rng" RNG present (xstore) */
Expand Down Expand Up @@ -239,7 +237,6 @@ extern const char * const x86_power_flags[32];
#define cpu_has_xmm4_2 boot_cpu_has(X86_FEATURE_XMM4_2)
#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC)
#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE)
#define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR)

#if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64)
# define cpu_has_invlpg 1
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/x86/kernel/cpu/addon_cpuid_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,9 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width)
& core_select_mask;
c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width);
/*
* Reinit the apicid, now that we have extended initial_apicid.
*/
c->apicid = phys_pkg_id(c->initial_apicid, 0);
#else
c->cpu_core_id = phys_pkg_id(ht_mask_width) & core_select_mask;
c->phys_proc_id = phys_pkg_id(core_plus_mask_width);
/*
* Reinit the apicid, now that we have extended initial_apicid.
*/
c->apicid = phys_pkg_id(0);
#endif
c->x86_max_cores = (core_level_siblings / smp_num_siblings);

Expand Down
9 changes: 2 additions & 7 deletions trunk/arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,9 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
{
early_init_amd_mc(c);

/*
* c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
* with P/T states and does not stop in deep C-states
*/
if (c->x86_power & (1 << 8)) {
/* c->x86_power is 8000_0007 edx. Bit 8 is constant TSC */
if (c->x86_power & (1<<8))
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
}

#ifdef CONFIG_X86_64
set_cpu_cap(c, X86_FEATURE_SYSCALL32);
Expand Down
18 changes: 1 addition & 17 deletions trunk/arch/x86/kernel/cpu/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
if (c->x86 == 15 && c->x86_cache_alignment == 64)
c->x86_cache_alignment = 128;
#endif

/*
* c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
* with P/T states and does not stop in deep C-states
*/
if (c->x86_power & (1 << 8)) {
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
}

}

#ifdef CONFIG_X86_32
Expand Down Expand Up @@ -251,13 +241,6 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)

intel_workarounds(c);

/*
* Detect the extended topology information if available. This
* will reinitialise the initial_apicid which will be used
* in init_intel_cacheinfo()
*/
detect_extended_topology(c);

l2 = init_intel_cacheinfo(c);
if (c->cpuid_level > 9) {
unsigned eax = cpuid_eax(10);
Expand Down Expand Up @@ -325,6 +308,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
set_cpu_cap(c, X86_FEATURE_P3);
#endif

detect_extended_topology(c);
if (!cpu_has(c, X86_FEATURE_XTOPOLOGY)) {
/*
* let's use the legacy cpuid vector 0x1 and 0x4 for topology
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static void c1e_idle(void)
rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
if (lo & K8_INTP_C1E_ACTIVE_MASK) {
c1e_detected = 1;
if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
mark_tsc_unstable("TSC halt in AMD C1E");
printk(KERN_INFO "System has AMD C1E enabled\n");
set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ static int tsc_halts_in_c(int state)
{
switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
case X86_VENDOR_INTEL:
/*
* AMD Fam10h TSC will tick in all
* C/P/S0/S1 states when this bit is set.
*/
if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
return 0;

/*FALL THROUGH*/
case X86_VENDOR_INTEL:
/* Several cases known where TSC halts in C2 too */
default:
return state > ACPI_STATE_C1;
}
Expand Down
10 changes: 10 additions & 0 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,16 @@ void tracing_reset(struct trace_array *tr, int cpu)
ftrace_enable_cpu();
}

void tracing_reset_online_cpus(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

#define SAVED_CMDLINES 128
static unsigned map_pid_to_cmdline[PID_MAX_DEFAULT+1];
static unsigned map_cmdline_to_pid[SAVED_CMDLINES];
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ struct trace_iterator {
int tracing_is_enabled(void);
void trace_wake_up(void);
void tracing_reset(struct trace_array *tr, int cpu);
void tracing_reset_online_cpus(struct trace_array *tr);
int tracing_open_generic(struct inode *inode, struct file *filp);
struct dentry *tracing_init_dentry(void);
void init_tracer_sysprof_debugfs(struct dentry *d_tracer);
Expand Down
12 changes: 1 addition & 11 deletions trunk/kernel/trace/trace_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ void disable_boot_trace(void)
tracing_stop_sched_switch_record();
}

static void reset_boot_trace(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static int boot_trace_init(struct trace_array *tr)
{
int cpu;
Expand Down Expand Up @@ -130,7 +120,7 @@ struct tracer boot_tracer __read_mostly =
{
.name = "initcall",
.init = boot_trace_init,
.reset = reset_boot_trace,
.reset = tracing_reset_online_cpus,
.print_line = initcall_print_line,
};

Expand Down
14 changes: 2 additions & 12 deletions trunk/kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@

#include "trace.h"

static void function_reset(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static void start_function_trace(struct trace_array *tr)
{
tr->cpu = get_cpu();
function_reset(tr);
tracing_reset_online_cpus(tr);
put_cpu();

tracing_start_cmdline_record();
Expand All @@ -55,7 +45,7 @@ static void function_trace_reset(struct trace_array *tr)

static void function_trace_start(struct trace_array *tr)
{
function_reset(tr);
tracing_reset_online_cpus(tr);
}

static struct tracer function_trace __read_mostly =
Expand Down
14 changes: 2 additions & 12 deletions trunk/kernel/trace/trace_hw_branches.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ static DEFINE_PER_CPU(unsigned char[SIZEOF_BTS], buffer);
#define this_buffer per_cpu(buffer, smp_processor_id())


static void bts_trace_reset(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static void bts_trace_start_cpu(void *arg)
{
if (this_tracer)
Expand All @@ -54,7 +44,7 @@ static void bts_trace_start(struct trace_array *tr)
{
int cpu;

bts_trace_reset(tr);
tracing_reset_online_cpus(tr);

for_each_cpu_mask(cpu, cpu_possible_map)
smp_call_function_single(cpu, bts_trace_start_cpu, NULL, 1);
Expand All @@ -78,7 +68,7 @@ static void bts_trace_stop(struct trace_array *tr)

static int bts_trace_init(struct trace_array *tr)
{
bts_trace_reset(tr);
tracing_reset_online_cpus(tr);
bts_trace_start(tr);

return 0;
Expand Down
6 changes: 1 addition & 5 deletions trunk/kernel/trace/trace_mmiotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ static unsigned long prev_overruns;

static void mmio_reset_data(struct trace_array *tr)
{
int cpu;

overrun_detected = false;
prev_overruns = 0;
tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
tracing_reset_online_cpus(tr);
}

static int mmio_trace_init(struct trace_array *tr)
Expand Down
14 changes: 2 additions & 12 deletions trunk/kernel/trace/trace_sched_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee)
local_irq_restore(flags);
}

static void sched_switch_reset(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static int tracing_sched_register(void)
{
int ret;
Expand Down Expand Up @@ -197,7 +187,7 @@ void tracing_sched_switch_assign_trace(struct trace_array *tr)

static void start_sched_trace(struct trace_array *tr)
{
sched_switch_reset(tr);
tracing_reset_online_cpus(tr);
tracing_start_sched_switch_record();
}

Expand All @@ -221,7 +211,7 @@ static void sched_switch_trace_reset(struct trace_array *tr)

static void sched_switch_trace_start(struct trace_array *tr)
{
sched_switch_reset(tr);
tracing_reset_online_cpus(tr);
tracing_start_sched_switch();
}

Expand Down
12 changes: 1 addition & 11 deletions trunk/kernel/trace/trace_sysprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,20 +234,10 @@ static void stop_stack_timers(void)
stop_stack_timer(cpu);
}

static void stack_reset(struct trace_array *tr)
{
int cpu;

tr->time_start = ftrace_now(tr->cpu);

for_each_online_cpu(cpu)
tracing_reset(tr, cpu);
}

static void start_stack_trace(struct trace_array *tr)
{
mutex_lock(&sample_timer_lock);
stack_reset(tr);
tracing_reset_online_cpus(tr);
start_stack_timers();
tracer_enabled = 1;
mutex_unlock(&sample_timer_lock);
Expand Down

0 comments on commit ea6e101

Please sign in to comment.