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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 12 May 2022 11:24:35 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     kernel test robot <lkp@...el.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Hans de Goede <hdegoede@...hat.com>,
        linux-kernel@...r.kernel.org, Tony Luck <tony.luck@...el.com>
Subject: Re: [pdx86-platform-drivers-x86:review-hans 46/59]
 kernel/stop_machine.c:638:35: error: call to undeclared function
 'cpu_smt_mask'; ISO C99 and later do not support implicit function
 declarations

On Thu, May 12 2022 at 09:29, kernel test robot wrote:
>>> kernel/stop_machine.c:638:35: error: call to undeclared function 'cpu_smt_mask'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>            const struct cpumask *smt_mask = cpu_smt_mask(cpu);

This warning with W=1 is not the worst of the problems.

The build will simply fail for CONFIG_SMP=y && CONFIG_SCHED_SMT=n
because cpu_smt_mask() cannot be resolved.

The other issue is CONFIG_SMP=n. This will fail to build the IFS driver
because stop_core_cpuslocked() is not available for SMP=n.

Something like the below should work as x86 selects SCHED_SMT when
SMP=y.

Thanks,

        tglx
---
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -156,6 +156,12 @@ static __always_inline int stop_machine_
 }
 
 static __always_inline int
+stop_core_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data)
+{
+	return stop_machine_cpuslocked(fn, data, NULL);
+}
+
+static __always_inline int
 stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)
 {
 	return stop_machine_cpuslocked(fn, data, cpus);
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -631,6 +631,7 @@ int stop_machine(cpu_stop_fn_t fn, void
 }
 EXPORT_SYMBOL_GPL(stop_machine);
 
+#ifdef CONFIG_SCHED_SMT
 int stop_core_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data)
 {
 	const struct cpumask *smt_mask = cpu_smt_mask(cpu);
@@ -649,6 +650,7 @@ int stop_core_cpuslocked(unsigned int cp
 	return stop_cpus(smt_mask, multi_cpu_stop, &msdata);
 }
 EXPORT_SYMBOL_GPL(stop_core_cpuslocked);
+#endif
 
 /**
  * stop_machine_from_inactive_cpu - stop_machine() from inactive CPU



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ