* Re: [tglx-devel:x86/l1dflush 7/9] arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces)
[not found] <202104271144.G4fgnYlt-lkp@intel.com>
@ 2021-04-27 6:37 ` Thomas Gleixner
2021-04-27 17:00 ` Linus Torvalds
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2021-04-27 6:37 UTC (permalink / raw)
To: kernel test robot, Balbir Singh
Cc: kbuild-all, linux-sparse, luc.vanoostenryck
On Tue, Apr 27 2021 at 11:00, kernel test robot wrote:
Cc+ sparse folks
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/l1dflush
> head: 6955fbfdad4241331d1e33362306aec3a410803a
> commit: 193cb89595f7f3f4549b03ab9392fb9838d123e3 [7/9] x86/mm: Prepare for opt-in based L1D flush in switch_mm()
> config: i386-randconfig-s032-20210426 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.3-341-g8af24329-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/commit/?id=193cb89595f7f3f4549b03ab9392fb9838d123e3
> git remote add tglx-devel https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git
> git fetch --no-tags tglx-devel x86/l1dflush
> git checkout 193cb89595f7f3f4549b03ab9392fb9838d123e3
> # save the attached .config to linux build tree
> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>>> arch/x86/mm/tlb.c:354:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got bool * @@
> arch/x86/mm/tlb.c:354:13: sparse: expected void const [noderef] __percpu *__vpp_verify
> arch/x86/mm/tlb.c:354:13: sparse: got bool *
>
> vim +354 arch/x86/mm/tlb.c
>
> 336
> 337 static void l1d_flush_evaluate(unsigned long prev_mm, unsigned long next_mm,
> 338 struct task_struct *next)
> 339 {
> 340 /* Flush L1D if the outgoing task requests it */
> 341 if (prev_mm & LAST_USER_MM_L1D_FLUSH)
> 342 wrmsrl(MSR_IA32_FLUSH_CMD, L1D_FLUSH);
> 343
> 344 /* Check whether the incoming task opted in for L1D flush */
> 345 if (likely(!(next_mm & LAST_USER_MM_L1D_FLUSH)))
> 346 return;
> 347
> 348 /*
> 349 * Validate that it is not running on an SMT sibling as this would
> 350 * make the excercise pointless because the siblings share L1D. If
> 351 * it runs on a SMT sibling, notify it with SIGBUS on return to
> 352 * user/guest
> 353 */
> > 354 if (this_cpu_read(cpu_info.smt_active)) {
That's a valid construct and the kernel of full of percpuvar.member reads/writes.
> 355 clear_ti_thread_flag(&next->thread_info, TIF_SPEC_L1D_FLUSH);
> 356 next->l1d_flush_kill.func = l1d_flush_force_sigbus;
> 357 task_work_add(next, &next->l1d_flush_kill, TWA_RESUME);
> 358 }
> 359 }
> 360
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread