Re: [PATCH v2a 3/6] x86/microcode/intel: Establish staging control logic

From: Chang S. Bae
Date: Fri Mar 28 2025 - 10:15:08 EST


On 3/26/2025 6:44 PM, Chao Gao wrote:

The check I suggested can also achieve the goal and is simpler, right?
Okay, I’d (finally) define this mask compilable for CONFIG_SMP=n, in topology.h:

#define cpu_primary_thread_mask cpu_none_mask

Then,

for_each_cpu(cpu, cpu_primary_thread_mask) {
if (topology_logical_package_id(cpu) == pkg_id)
continue;
...
}

This still looks simpler. Plus, while timing isn’t a major concern on this staging path, cpumask_first() on every CPU appears costly. On my measurements, this takes about a third of the time compared to yours.

Thanks,
Chang