From: Hans de Goede <hdegoede@redhat.com> To: Thomas Gleixner <tglx@linutronix.de>, kernel test robot <lkp@intel.com>, Peter Zijlstra <peterz@infradead.org> Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-kernel@vger.kernel.org, Tony Luck <tony.luck@intel.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 Date: Thu, 12 May 2022 11:53:00 +0200 [thread overview] Message-ID: <ce8e9601-f514-5227-f9f7-87594218f95f@redhat.com> (raw) In-Reply-To: <87zgjnw1bg.ffs@tglx> Hi, On 5/12/22 11:24, Thomas Gleixner wrote: > 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. The IFS Kconfig already depends on SMP : config INTEL_IFS tristate "Intel In Field Scan" depends on X86 && 64BIT && SMP select INTEL_IFS_DEVICE help Enable ... So I don't think we need the non-SMP implementation inside include/linux/stop_machine.h, we only need the #ifdef you suggest in kernel/stop_machine.c ? I think it is best to just squash this into the original patch, do you agree ? Regards, Hans > 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 > > >
WARNING: multiple messages have this Message-ID (diff)
From: Hans de Goede <hdegoede@redhat.com> To: kbuild-all@lists.01.org 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 Date: Thu, 12 May 2022 11:53:00 +0200 [thread overview] Message-ID: <ce8e9601-f514-5227-f9f7-87594218f95f@redhat.com> (raw) In-Reply-To: <87zgjnw1bg.ffs@tglx> [-- Attachment #1: Type: text/plain, Size: 2404 bytes --] Hi, On 5/12/22 11:24, Thomas Gleixner wrote: > 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. The IFS Kconfig already depends on SMP : config INTEL_IFS tristate "Intel In Field Scan" depends on X86 && 64BIT && SMP select INTEL_IFS_DEVICE help Enable ... So I don't think we need the non-SMP implementation inside include/linux/stop_machine.h, we only need the #ifdef you suggest in kernel/stop_machine.c ? I think it is best to just squash this into the original patch, do you agree ? Regards, Hans > 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 > > >
next prev parent reply other threads:[~2022-05-12 9:53 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-12 1:29 [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 kernel test robot 2022-05-12 9:24 ` Thomas Gleixner 2022-05-12 9:24 ` Thomas Gleixner 2022-05-12 9:53 ` Hans de Goede [this message] 2022-05-12 9:53 ` Hans de Goede 2022-05-12 11:42 ` Thomas Gleixner 2022-05-12 11:42 ` Thomas Gleixner 2022-05-12 13:40 ` Hans de Goede 2022-05-12 13:40 ` Hans de Goede
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=ce8e9601-f514-5227-f9f7-87594218f95f@redhat.com \ --to=hdegoede@redhat.com \ --cc=andriy.shevchenko@linux.intel.com \ --cc=kbuild-all@lists.01.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lkp@intel.com \ --cc=llvm@lists.linux.dev \ --cc=peterz@infradead.org \ --cc=tglx@linutronix.de \ --cc=tony.luck@intel.com \ /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: linkBe 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.