On Tue, Apr 27 2021 at 10:00, Linus Torvalds wrote: > On Mon, Apr 26, 2021 at 11:37 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote: >> >> > > 354 if (this_cpu_read(cpu_info.smt_active)) { >> >> That's a valid construct and the kernel of full of percpuvar.member reads/writes. > > Hmm. "cpu_info" doesn't seem to be marked as a percpu data structure. > > Is this perhaps a UP config? Because we have: > > extern struct cpuinfo_x86 boot_cpu_data; > ... > #ifdef CONFIG_SMP > DECLARE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); > #define cpu_data(cpu) per_cpu(cpu_info, cpu) > #else > #define cpu_info boot_cpu_data > #define cpu_data(cpu) boot_cpu_data > #endif > > and notice how if CONFIG_SMP isn't set, 'cpu_info' just turns into a > regular non-percpu thing. > > But the sparse checking doesn't go away just because it's compiled for UP. Duh yes. I'm a moron.