All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/virt/acrn/hsm.c:391 remove_cpu_store() warn: potential spectre issue '__per_cpu_offset' (local cap)
@ 2021-02-27 19:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-27 19:08 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Shuo Liu <shuo.a.liu@intel.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Zhi Wang <zhi.a.wang@intel.com>
CC: Reinette Chatre <reinette.chatre@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: 279dcf693ac76c9d16b91ffc41280babaff26bb2 virt: acrn: Introduce an interface for Service VM to control vCPU
date:   3 weeks ago
:::::: branch date: 3 hours ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-m001-20210228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
drivers/virt/acrn/hsm.c:391 remove_cpu_store() warn: potential spectre issue '__per_cpu_offset' [w] (local cap)

vim +/__per_cpu_offset +391 drivers/virt/acrn/hsm.c

666834c47d3b41 Shuo Liu 2021-02-07  374  
279dcf693ac76c Shuo Liu 2021-02-07  375  static ssize_t remove_cpu_store(struct device *dev,
279dcf693ac76c Shuo Liu 2021-02-07  376  				struct device_attribute *attr,
279dcf693ac76c Shuo Liu 2021-02-07  377  				const char *buf, size_t count)
279dcf693ac76c Shuo Liu 2021-02-07  378  {
279dcf693ac76c Shuo Liu 2021-02-07  379  	u64 cpu, lapicid;
279dcf693ac76c Shuo Liu 2021-02-07  380  	int ret;
279dcf693ac76c Shuo Liu 2021-02-07  381  
279dcf693ac76c Shuo Liu 2021-02-07  382  	if (kstrtoull(buf, 0, &cpu) < 0)
279dcf693ac76c Shuo Liu 2021-02-07  383  		return -EINVAL;
279dcf693ac76c Shuo Liu 2021-02-07  384  
279dcf693ac76c Shuo Liu 2021-02-07  385  	if (cpu >= num_possible_cpus() || cpu == 0 || !cpu_is_hotpluggable(cpu))
279dcf693ac76c Shuo Liu 2021-02-07  386  		return -EINVAL;
279dcf693ac76c Shuo Liu 2021-02-07  387  
279dcf693ac76c Shuo Liu 2021-02-07  388  	if (cpu_online(cpu))
279dcf693ac76c Shuo Liu 2021-02-07  389  		remove_cpu(cpu);
279dcf693ac76c Shuo Liu 2021-02-07  390  
279dcf693ac76c Shuo Liu 2021-02-07 @391  	lapicid = cpu_data(cpu).apicid;
279dcf693ac76c Shuo Liu 2021-02-07  392  	dev_dbg(dev, "Try to remove cpu %lld with lapicid %lld\n", cpu, lapicid);
279dcf693ac76c Shuo Liu 2021-02-07  393  	ret = hcall_sos_remove_cpu(lapicid);
279dcf693ac76c Shuo Liu 2021-02-07  394  	if (ret < 0) {
279dcf693ac76c Shuo Liu 2021-02-07  395  		dev_err(dev, "Failed to remove cpu %lld!\n", cpu);
279dcf693ac76c Shuo Liu 2021-02-07  396  		goto fail_remove;
279dcf693ac76c Shuo Liu 2021-02-07  397  	}
279dcf693ac76c Shuo Liu 2021-02-07  398  
279dcf693ac76c Shuo Liu 2021-02-07  399  	return count;
279dcf693ac76c Shuo Liu 2021-02-07  400  
279dcf693ac76c Shuo Liu 2021-02-07  401  fail_remove:
279dcf693ac76c Shuo Liu 2021-02-07  402  	add_cpu(cpu);
279dcf693ac76c Shuo Liu 2021-02-07  403  	return ret;
279dcf693ac76c Shuo Liu 2021-02-07  404  }
279dcf693ac76c Shuo Liu 2021-02-07  405  static DEVICE_ATTR_WO(remove_cpu);
279dcf693ac76c Shuo Liu 2021-02-07  406  

---
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: 42135 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-27 19:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 19:08 drivers/virt/acrn/hsm.c:391 remove_cpu_store() warn: potential spectre issue '__per_cpu_offset' (local cap) kernel test robot

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.