Re: [tglx-devel:x86/l1dflush 7/9] arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

              Linus



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux