All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/platform/x86/asus-armoury.c:676 apu_mem_current_value_store() warn: potential spectre issue 'apu_mem_map' [r] (local cap)
Date: Tue, 10 Mar 2026 15:47:53 +0800	[thread overview]
Message-ID: <202603101559.bP8YP28V-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-03-10  7:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603101559.bP8YP28V-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.