On Mon, Mar 28, 2016 at 11:29:52AM +0200, Borislav Petkov wrote:
> I think you want something like this: iterate over each core and put one
> of them into the mask.
> 
>       core = -1;
> 
>       for_each_online_cpu(cpu) {
>               this_core = topology_core_id(cpu);
> 
>               if (this_core == core)
>                       continue;
> 
>               core = this_core;
> 
>               /* get any CPU on this compute unit */
>               cpumask_set_cpu(cpumask_any(topology_sibling_cpumask(cpu)), 
> mask);
>       }

This will not in fact work for Intel, nor if I manage to one day
randomize our CPU numbers on AMD.

Reply via email to