| Subject | Re: [PATCH 4/4] x86/cpu/topology: Implement the CPU type sysfs interface | From | Randy Dunlap <> | Date | Fri, 2 Oct 2020 20:33:09 -0700 |
| |
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
|