threads_per_core
int threads_per_core = 0;
threads_per_core = 1;
threads_per_core++;
cpu_smt_set_num_threads(threads_per_core, threads_per_core);
extern int threads_per_core;
return cpu & (threads_per_core - 1);
return cpu & ~(threads_per_core - 1);
return cpu | (threads_per_core - 1);
if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
for (i = first_cpu; i < first_cpu + threads_per_core; i++) {
for (i = first_cpu; i < first_cpu + threads_per_core; ++i) {
idx = cpu / threads_per_core;
int threads_per_core, threads_per_subcore, threads_shift __read_mostly;
EXPORT_SYMBOL_GPL(threads_per_core);
threads_per_core = tpc;
smt_enabled_at_boot = threads_per_core;
smt_enabled_at_boot = threads_per_core;
min(threads_per_core, smt);
smt_enabled_at_boot = threads_per_core;
int idx = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
cpu_smt_set_num_threads(num_threads, threads_per_core);
if (threads_per_core > 1 && secondaries_inhibited() &&
for (i = first_thread; i < first_thread + threads_per_core; i++)
return -cpu / threads_per_core;
for (i = first_thread; i < first_thread + threads_per_core; i++) {
cpu_smt_num_threads = threads_per_core;
possible_cpu_nodes = num_possible_cpus() / threads_per_core;
for (cpu = 0; cpu < nr_cpu_ids; cpu += threads_per_core) {
int first_cpu = i * threads_per_core;
for (j = 0; j < threads_per_core; j++) {
if (threads_per_core == 2)
if (threads_per_core == 2)
if (threads_per_core == 2)
kvmppc_init_lpid(KVMPPC_NR_LPIDS/threads_per_core);
for (i = 0; i < threads_per_core; i++) {
if (threads_per_core == 8)
core_id = smp_processor_id() / threads_per_core;
core_id = smp_processor_id() / threads_per_core;
int core_id = (cpu_id / threads_per_core);
int core_id = smp_processor_id() / threads_per_core;
int core_id = smp_processor_id() / threads_per_core;
int i, nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
nr_cores = DIV_ROUND_UP(num_possible_cpus(), threads_per_core);
int nid, rc = 0, core_id = (cpu / threads_per_core);
int core_id = (cpu / threads_per_core);
core_id = cpu / threads_per_core;
core_id = event->cpu / threads_per_core;
core_id = event->cpu / threads_per_core;
if (threads_per_core == 2) {
} else if (threads_per_core == 1) {
} else if (threads_per_core > 2) {
p->idle_state = (1 << threads_per_core) - 1;
unsigned long core_thread_mask = (1UL << threads_per_core) - 1;
== threads_per_core)
unsigned long core_thread_mask = (1UL << threads_per_core) - 1;
int need_awake = threads_per_core;
cpu0 = cpu & ~(threads_per_core - 1);
for (thr = 0; thr < threads_per_core; ++thr) {
for (thr = 0; thr < threads_per_core; ++thr) {
for (thr = 0; thr < threads_per_core; ++thr) {
for (thr = 0; thr < threads_per_core; ++thr) {
cpu0 = cpu & ~(threads_per_core - 1);
for (thr = 0; thr < threads_per_core; ++thr) {
unsigned long core_thread_mask = (1UL << threads_per_core) - 1;
for (i = cpu + 1; i < cpu + threads_per_core; i++)
for (i = cpu + 1; i < cpu + threads_per_core; i++)
threads_per_subcore = threads_per_core / subcores_per_core;
if (setup_max_cpus % threads_per_core)
vcpu_associativity = kcalloc(num_possible_cpus() / threads_per_core,
pcpu_associativity = kcalloc(NR_CPUS_H / threads_per_core,
assoc = &cpu_assoc[(int)(cpu / threads_per_core) * VPHN_ASSOC_BUFSIZE];
if (threads_per_core == 2) {
if (threads_per_core == 1)
for (i = 0; i < threads_per_core; i++)
for_each_cpu(cpu, ne_enclave->threads_per_core[i])
for_each_cpu(cpu, ne_enclave->threads_per_core[i])
free_cpumask_var(ne_enclave->threads_per_core[i]);
kfree(ne_enclave->threads_per_core);
ne_enclave->threads_per_core = kzalloc_objs(*ne_enclave->threads_per_core,
if (!ne_enclave->threads_per_core) {
if (!zalloc_cpumask_var(&ne_enclave->threads_per_core[i], GFP_KERNEL)) {
free_cpumask_var(ne_enclave->threads_per_core[i]);
kfree(ne_enclave->threads_per_core);
cpumask_set_cpu(cpu, ne_enclave->threads_per_core[core_id]);
for_each_cpu(cpu, ne_enclave->threads_per_core[i])
*vcpu_id = cpumask_any(ne_enclave->threads_per_core[core_id]);
if (cpumask_test_cpu(vcpu_id, ne_enclave->threads_per_core[i]))
cpumask_var_t *threads_per_core;
int threads_per_core;
topo.threads_per_core = max_siblings;
int num_threads = topo.threads_per_core * num_cores;