All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/platform/x86/asus-armoury.c:676 apu_mem_current_value_store() warn: potential spectre issue 'apu_mem_map' [r] (local cap)
@ 2026-03-10  7:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-10  7:47 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Luke D. Jones" <luke@ljones.dev>
CC: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
CC: Denis Benato <denis.benato@linux.dev>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
commit: 9c7dacf5d51910f34a3bd709403f6a82ffc8c960 platform/x86: asus-armoury: add apu-mem control support
date:   4 months ago
:::::: branch date: 32 hours ago
:::::: commit date: 4 months ago
config: x86_64-randconfig-r073-20260310 (https://download.01.org/0day-ci/archive/20260310/202603101559.bP8YP28V-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
smatch: v0.5.0-9004-gb810ac53

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202603101559.bP8YP28V-lkp@intel.com/

New smatch warnings:
drivers/platform/x86/asus-armoury.c:676 apu_mem_current_value_store() warn: potential spectre issue 'apu_mem_map' [r] (local cap)
drivers/platform/x86/asus-armoury.c:678 apu_mem_current_value_store() warn: possible spectre second half.  'mem'

Old smatch warnings:
drivers/platform/x86/asus-armoury.c:380 mini_led_mode_current_value_store() warn: potential spectre issue 'mini_led_mode_map' [r] (local cap)
drivers/platform/x86/asus-armoury.c:518 egpu_enable_current_value_store() warn: potential spectre issue 'egpu_status_map' [r] (local cap)
drivers/platform/x86/asus-armoury.c:522 egpu_enable_current_value_store() warn: possible spectre second half.  'enable'

vim +/apu_mem_map +676 drivers/platform/x86/asus-armoury.c

9c7dacf5d51910 Luke D. Jones 2025-11-02  663  
9c7dacf5d51910 Luke D. Jones 2025-11-02  664  static ssize_t apu_mem_current_value_store(struct kobject *kobj, struct kobj_attribute *attr,
9c7dacf5d51910 Luke D. Jones 2025-11-02  665  					   const char *buf, size_t count)
9c7dacf5d51910 Luke D. Jones 2025-11-02  666  {
9c7dacf5d51910 Luke D. Jones 2025-11-02  667  	int result, err;
9c7dacf5d51910 Luke D. Jones 2025-11-02  668  	u32 requested, mem;
9c7dacf5d51910 Luke D. Jones 2025-11-02  669  
9c7dacf5d51910 Luke D. Jones 2025-11-02  670  	result = kstrtou32(buf, 10, &requested);
9c7dacf5d51910 Luke D. Jones 2025-11-02  671  	if (result)
9c7dacf5d51910 Luke D. Jones 2025-11-02  672  		return result;
9c7dacf5d51910 Luke D. Jones 2025-11-02  673  
9c7dacf5d51910 Luke D. Jones 2025-11-02  674  	if (requested >= ARRAY_SIZE(apu_mem_map))
9c7dacf5d51910 Luke D. Jones 2025-11-02  675  		return -EINVAL;
9c7dacf5d51910 Luke D. Jones 2025-11-02 @676  	mem = apu_mem_map[requested];
9c7dacf5d51910 Luke D. Jones 2025-11-02  677  
9c7dacf5d51910 Luke D. Jones 2025-11-02 @678  	err = armoury_set_devstate(attr, mem, NULL, ASUS_WMI_DEVID_APU_MEM);
9c7dacf5d51910 Luke D. Jones 2025-11-02  679  	if (err) {
9c7dacf5d51910 Luke D. Jones 2025-11-02  680  		pr_warn("Failed to set apu_mem 0x%x: %d\n", mem, err);
9c7dacf5d51910 Luke D. Jones 2025-11-02  681  		return err;
9c7dacf5d51910 Luke D. Jones 2025-11-02  682  	}
9c7dacf5d51910 Luke D. Jones 2025-11-02  683  
9c7dacf5d51910 Luke D. Jones 2025-11-02  684  	pr_info("APU memory changed to %uGB, reboot required\n", requested + 1);
9c7dacf5d51910 Luke D. Jones 2025-11-02  685  	sysfs_notify(kobj, NULL, attr->attr.name);
9c7dacf5d51910 Luke D. Jones 2025-11-02  686  
9c7dacf5d51910 Luke D. Jones 2025-11-02  687  	asus_set_reboot_and_signal_event();
9c7dacf5d51910 Luke D. Jones 2025-11-02  688  
9c7dacf5d51910 Luke D. Jones 2025-11-02  689  	return count;
9c7dacf5d51910 Luke D. Jones 2025-11-02  690  }
9c7dacf5d51910 Luke D. Jones 2025-11-02  691  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2026-03-10  7:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10  7:47 drivers/platform/x86/asus-armoury.c:676 apu_mem_current_value_store() warn: potential spectre issue 'apu_mem_map' [r] (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.