All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:x86/pti 4/5] arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used
@ 2021-01-16  3:21 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-01-16  3:21 UTC (permalink / raw)
  To: Balbir Singh; +Cc: kbuild-all, linux-kernel, x86, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 2077 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/pti
head:   767d46ab566dd489733666efe48732d523c8c332
commit: b6724f118d44606fddde391ba7527526b3cad211 [4/5] prctl: Hook L1D flushing in via prctl
config: i386-randconfig-r026-20210115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=b6724f118d44606fddde391ba7527526b3cad211
        git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
        git fetch --no-tags tip x86/pti
        git checkout b6724f118d44606fddde391ba7527526b3cad211
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/x86/mm/tlb.c: In function 'enable_l1d_flush_for_task':
>> arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used [-Wunused-but-set-variable]
     319 |  int cpu, ret = 0, i;
         |      ^~~


vim +/cpu +319 arch/x86/mm/tlb.c

   316	
   317	int enable_l1d_flush_for_task(struct task_struct *tsk)
   318	{
 > 319		int cpu, ret = 0, i;
   320	
   321		/*
   322		 * Do not enable L1D_FLUSH_OUT if
   323		 * b. The CPU is not affected by the L1TF bug
   324		 * c. The CPU does not have L1D FLUSH feature support
   325		 * c. The task's affinity is on cores with SMT on.
   326		 */
   327	
   328		if (!boot_cpu_has_bug(X86_BUG_L1TF) ||
   329				!static_cpu_has(X86_FEATURE_FLUSH_L1D))
   330			return -EINVAL;
   331	
   332		cpu = get_cpu();
   333	
   334		for_each_cpu(i, &tsk->cpus_mask) {
   335			if (cpu_data(i).smt_active == true) {
   336				put_cpu();
   337				return -EINVAL;
   338			}
   339		}
   340	
   341		set_ti_thread_flag(&tsk->thread_info, TIF_SPEC_L1D_FLUSH);
   342		put_cpu();
   343		return ret;
   344	}
   345	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34874 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/pti 4/5] arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used
@ 2021-01-16  3:21 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-01-16  3:21 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2139 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/pti
head:   767d46ab566dd489733666efe48732d523c8c332
commit: b6724f118d44606fddde391ba7527526b3cad211 [4/5] prctl: Hook L1D flushing in via prctl
config: i386-randconfig-r026-20210115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=b6724f118d44606fddde391ba7527526b3cad211
        git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
        git fetch --no-tags tip x86/pti
        git checkout b6724f118d44606fddde391ba7527526b3cad211
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/x86/mm/tlb.c: In function 'enable_l1d_flush_for_task':
>> arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used [-Wunused-but-set-variable]
     319 |  int cpu, ret = 0, i;
         |      ^~~


vim +/cpu +319 arch/x86/mm/tlb.c

   316	
   317	int enable_l1d_flush_for_task(struct task_struct *tsk)
   318	{
 > 319		int cpu, ret = 0, i;
   320	
   321		/*
   322		 * Do not enable L1D_FLUSH_OUT if
   323		 * b. The CPU is not affected by the L1TF bug
   324		 * c. The CPU does not have L1D FLUSH feature support
   325		 * c. The task's affinity is on cores with SMT on.
   326		 */
   327	
   328		if (!boot_cpu_has_bug(X86_BUG_L1TF) ||
   329				!static_cpu_has(X86_FEATURE_FLUSH_L1D))
   330			return -EINVAL;
   331	
   332		cpu = get_cpu();
   333	
   334		for_each_cpu(i, &tsk->cpus_mask) {
   335			if (cpu_data(i).smt_active == true) {
   336				put_cpu();
   337				return -EINVAL;
   338			}
   339		}
   340	
   341		set_ti_thread_flag(&tsk->thread_info, TIF_SPEC_L1D_FLUSH);
   342		put_cpu();
   343		return ret;
   344	}
   345	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34874 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  [tip:x86/pti 4/5] arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used
  2021-01-16  3:21 ` kernel test robot
  (?)
@ 2021-01-20 10:37 ` Singh, Balbir
  -1 siblings, 0 replies; 3+ messages in thread
From: Singh, Balbir @ 2021-01-20 10:37 UTC (permalink / raw)
  To: lkp; +Cc: kbuild-all, linux-kernel, tglx, x86

On Sat, 2021-01-16 at 11:21 +0800, kernel test robot wrote:
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/pti
> head:   767d46ab566dd489733666efe48732d523c8c332
> commit: b6724f118d44606fddde391ba7527526b3cad211 [4/5] prctl: Hook L1D flushing in via prctl
> config: i386-randconfig-r026-20210115 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce (this is a W=1 build):
>         # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=b6724f118d44606fddde391ba7527526b3cad211
>         git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
>         git fetch --no-tags tip x86/pti
>         git checkout b6724f118d44606fddde391ba7527526b3cad211
>         # save the attached .config to linux build tree
>         make W=1 ARCH=i386
>

There is a newer revision of the patches posted at 
 https://lore.kernel.org/lkml/20210108121056.21940-1-sblbir@amazon.com/T/

which should not have this problem/issue.

Balbir Singh.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-20 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-16  3:21 [tip:x86/pti 4/5] arch/x86/mm/tlb.c:319:6: warning: variable 'cpu' set but not used kernel test robot
2021-01-16  3:21 ` kernel test robot
2021-01-20 10:37 ` Singh, Balbir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.