On 10/2/20 6:17 PM, Ricardo Neri wrote: > +u32 arch_get_cpu_type(int cpu) > +{ > + struct cpuinfo_x86 *c = &cpu_data(cpu); > + > + if (cpu < 0 || cpu >= nr_cpu_ids) > + return 0; > + > + return c->x86_cpu_type;> +}
Hi, Consider using #include <linux/nospec.h> and array_index_nospec() to avoid speculation problems on cpu_data. cheers. -- ~Randy