CC: [email protected]
CC: [email protected]
TO: Shuo Liu <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>
CC: Zhi Wang <[email protected]>
CC: Reinette Chatre <[email protected]>

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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

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/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to