lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YmGEL2klp4S97UiH@agluck-desk3.sc.intel.com>
Date:   Thu, 21 Apr 2022 09:19:59 -0700
From:   "Luck, Tony" <tony.luck@...el.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: [PATCH v2] topology/sysfs: Fix allnoconfig build breakage.

drivers/base/topology.c: In function 'topology_is_visible':
drivers/base/topology.c:158:24: warning: unused variable 'dev' [-Wunused-variable]
  158 |         struct device *dev = kobj_to_dev(kobj);

This is because the topology_ppin(dev->id) macro expands to:

	(cpu_data(dev->id).ppin)

and with CONFIG_SMP=n the cpu_data() macro expands to boot_cpu_data
(ignoring its argument) with the end result:

	boot_cpu_data.ppin

Fix by just checking whether the boot_cpu has a PPIN instead of whether
this specific CPU has one.

Fixes: c3702a746ff5 ("topology/sysfs: Hide PPIN on systems that do not support it.")
Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Tony Luck <tony.luck@...el.com>

---
I don't believe it will ever be possible to have no PPIN on the boot CPU,
but somehow have PPINs on other CPUs (or vice versa)

 drivers/base/topology.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/base/topology.c b/drivers/base/topology.c
index 706dbf8bf249..11a56a10188d 100644
--- a/drivers/base/topology.c
+++ b/drivers/base/topology.c
@@ -155,9 +155,7 @@ static struct attribute *default_attrs[] = {
 static umode_t topology_is_visible(struct kobject *kobj,
 				   struct attribute *attr, int unused)
 {
-	struct device *dev = kobj_to_dev(kobj);
-
-	if (attr == &dev_attr_ppin.attr && !topology_ppin(dev->id))
+	if (attr == &dev_attr_ppin.attr && !boot_cpu_data.ppin)
 		return 0;
 
 	return attr->mode;
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ