2021-04-29 15:11:22

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] smp: fix smp_call_function_single_async prototype

From: Arnd Bergmann <[email protected]>

As of commit 966a967116e6 ("smp: Avoid using two cache lines for struct
call_single_data"), the smp code prefers 32-byte aligned call_single_data
objects for performance reasons, but the block layer includes an instance
of this structure in the main 'struct request' that is more senstive
to size than to performance here, see 4ccafe032005 ("block: unalign
call_single_data in struct request").

The result is a violation of the calling conventions that clang correctly
points out:

block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch]
smp_call_function_single_async(cpu, &rq->csd);

It does seem that the usage of the call_single_data without cache line
alignment should still be allowed by the smp code, so just change the
function prototype so it accepts both, but leave the default alignment
unchanged for the other users. This seems better to me than adding
a local hack to shut up an otherwise correct warning in the caller.

Link: https://lore.kernel.org/linux-block/[email protected]/
Link: https://github.com/ClangBuiltLinux/linux/issues/1328
Cc: Jens Axboe <[email protected]>
Cc: Jian Cai <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
---
include/linux/smp.h | 2 +-
kernel/smp.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index 669e35c03be2..510519e8a1eb 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -53,7 +53,7 @@ int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
void *info, bool wait, const struct cpumask *mask);

-int smp_call_function_single_async(int cpu, call_single_data_t *csd);
+int smp_call_function_single_async(int cpu, struct __call_single_data *csd);

/*
* Cpus stopping functions in panic. All have default weak definitions.
diff --git a/kernel/smp.c b/kernel/smp.c
index e21074900006..1ec771d9f91c 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -401,7 +401,7 @@ static void __csd_lock_wait(call_single_data_t *csd)
smp_acquire__after_ctrl_dep();
}

-static __always_inline void csd_lock_wait(call_single_data_t *csd)
+static __always_inline void csd_lock_wait(struct __call_single_data *csd)
{
if (static_branch_unlikely(&csdlock_debug_enabled)) {
__csd_lock_wait(csd);
@@ -501,7 +501,7 @@ void __smp_call_single_queue(int cpu, struct llist_node *node)
* for execution on the given CPU. data must already have
* ->func, ->info, and ->flags set.
*/
-static int generic_exec_single(int cpu, call_single_data_t *csd)
+static int generic_exec_single(int cpu, struct __call_single_data *csd)
{
if (cpu == smp_processor_id()) {
smp_call_func_t func = csd->func;
@@ -784,7 +784,7 @@ EXPORT_SYMBOL(smp_call_function_single);
* NOTE: Be careful, there is unfortunately no current debugging facility to
* validate the correctness of this serialization.
*/
-int smp_call_function_single_async(int cpu, call_single_data_t *csd)
+int smp_call_function_single_async(int cpu, struct __call_single_data *csd)
{
int err = 0;

--
2.29.2


2021-04-29 15:55:07

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

On 4/29/21 9:09 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> As of commit 966a967116e6 ("smp: Avoid using two cache lines for struct
> call_single_data"), the smp code prefers 32-byte aligned call_single_data
> objects for performance reasons, but the block layer includes an instance
> of this structure in the main 'struct request' that is more senstive
> to size than to performance here, see 4ccafe032005 ("block: unalign
> call_single_data in struct request").
>
> The result is a violation of the calling conventions that clang correctly
> points out:
>
> block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch]
> smp_call_function_single_async(cpu, &rq->csd);
>
> It does seem that the usage of the call_single_data without cache line
> alignment should still be allowed by the smp code, so just change the
> function prototype so it accepts both, but leave the default alignment
> unchanged for the other users. This seems better to me than adding
> a local hack to shut up an otherwise correct warning in the caller.

I think that's the right approach, rather than work-around it in eg
blk-mq.

Acked-by: Jens Axboe <[email protected]>

--
Jens Axboe

2021-04-29 18:18:47

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

(replying manually to
https://lore.kernel.org/lkml/[email protected]/)

Thanks for the patch; with this applied I observe the following new warnings
though (for x86_64 defconfig; make LLVM=1 LLVM_IAS=1 -j72)

kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte
aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer
access [-Walign-mismatch]
csd_lock_record(csd);
^
kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte
aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
[-Walign-mismatch]
csd_unlock(csd);
^
kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte
aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
[-Walign-mismatch]
csd_unlock(csd);
^

2021-04-29 18:26:14

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

On Thu, Apr 29, 2021 at 11:17 AM Nick Desaulniers
<[email protected]> wrote:
>
> (replying manually to
> https://lore.kernel.org/lkml/[email protected]/)
>
> Thanks for the patch; with this applied I observe the following new warnings
> though (for x86_64 defconfig; make LLVM=1 LLVM_IAS=1 -j72)
>
> kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte
> aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer
> access [-Walign-mismatch]
> csd_lock_record(csd);
> ^
> kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte
> aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
> [-Walign-mismatch]
> csd_unlock(csd);
> ^
> kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte
> aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
> [-Walign-mismatch]
> csd_unlock(csd);
> ^

Perhaps roll this into a v2?

diff --git a/kernel/smp.c b/kernel/smp.c
index 1ec771d9f91c..499be1eb5189 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -226,7 +226,7 @@ static void __csd_lock_record(call_single_data_t *csd)
/* Or before unlock, as the case may be. */
}

-static __always_inline void csd_lock_record(call_single_data_t *csd)
+static __always_inline void csd_lock_record(struct __call_single_data *csd)
{
if (static_branch_unlikely(&csdlock_debug_enabled))
__csd_lock_record(csd);
@@ -431,7 +431,7 @@ static void __smp_call_single_queue_debug(int cpu,
struct llist_node *node)
#else
#define cfd_seq_store(var, src, dst, type)

-static void csd_lock_record(call_single_data_t *csd)
+static void csd_lock_record(struct __call_single_data *csd)
{
}

@@ -454,7 +454,7 @@ static __always_inline void
csd_lock(call_single_data_t *csd)
smp_wmb();
}

-static __always_inline void csd_unlock(call_single_data_t *csd)
+static __always_inline void csd_unlock(struct __call_single_data *csd)
{
WARN_ON(!(csd->node.u_flags & CSD_FLAG_LOCK));

--
Thanks,
~Nick Desaulniers

2021-04-29 18:28:13

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

On Thu, Apr 29, 2021 at 8:24 PM 'Nick Desaulniers' via Clang Built
Linux <[email protected]> wrote:
>
> On Thu, Apr 29, 2021 at 11:17 AM Nick Desaulniers
> <[email protected]> wrote:
> >
> > (replying manually to
> > https://lore.kernel.org/lkml/[email protected]/)
> >
> > Thanks for the patch; with this applied I observe the following new warnings
> > though (for x86_64 defconfig; make LLVM=1 LLVM_IAS=1 -j72)
> >
> > kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte
> > aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer
> > access [-Walign-mismatch]
> > csd_lock_record(csd);
> > ^
> > kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte
> > aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
> > [-Walign-mismatch]
> > csd_unlock(csd);
> > ^
> > kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte
> > aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access
> > [-Walign-mismatch]
> > csd_unlock(csd);
> > ^
>
> Perhaps roll this into a v2?
>

Right, I just did the same thing. I wonder if I failed to hit those because of
differences in configuration or because I tested the wrong way.

Either way, I'll give it some more time on the randconfig build machine
before I send out v2.

Arnd

2021-04-29 18:40:14

by Nick Desaulniers

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

On Thu, Apr 29, 2021 at 11:27 AM Arnd Bergmann <[email protected]> wrote:
>
> Either way, I'll give it some more time on the randconfig build machine
> before I send out v2.

SGTM and thanks for the fix. Perhaps worth a note that this isn't
just "a violation of the calling conventions" but straight up
undefined behavior, full stop.

UBSAN folks are working on adding a catch for this as well:
https://reviews.llvm.org/D100037, see the relevant citations from the
standard.
--
Thanks,
~Nick Desaulniers

2021-04-29 19:26:16

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20210429]
[cannot apply to linux/master soc/for-next linus/master v5.12 v5.12-rc8 v5.12-rc7 v5.12]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
base: 9e5cff2a1315fec1da1f497714395670366506b6
config: x86_64-randconfig-a013-20210429 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9131a078901b00e68248a27a4f8c4b11bb1db1ae)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/be40015a8e0990182fa440f75adecf40cf5d0062
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
git checkout be40015a8e0990182fa440f75adecf40cf5d0062
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer access [-Walign-mismatch]
csd_lock_record(csd);
^
>> kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
csd_unlock(csd);
^
kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
csd_unlock(csd);
^
kernel/smp.c:684:6: warning: no previous prototype for function 'flush_smp_call_function_from_idle' [-Wmissing-prototypes]
void flush_smp_call_function_from_idle(void)
^
kernel/smp.c:684:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void flush_smp_call_function_from_idle(void)
^
static
4 warnings generated.


vim +/csd_lock_record +515 kernel/smp.c

4b44a21dd640b6 Peter Zijlstra 2020-05-26 498
3d4422332711ef Jens Axboe 2008-06-26 499 /*
966a967116e699 Ying Huang 2017-08-08 500 * Insert a previously allocated call_single_data_t element
0b13fda1e0936b Ingo Molnar 2009-02-25 501 * for execution on the given CPU. data must already have
0b13fda1e0936b Ingo Molnar 2009-02-25 502 * ->func, ->info, and ->flags set.
3d4422332711ef Jens Axboe 2008-06-26 503 */
be40015a8e0990 Arnd Bergmann 2021-04-29 504 static int generic_exec_single(int cpu, struct __call_single_data *csd)
3d4422332711ef Jens Axboe 2008-06-26 505 {
8053871d0f7f67 Linus Torvalds 2015-02-11 506 if (cpu == smp_processor_id()) {
4b44a21dd640b6 Peter Zijlstra 2020-05-26 507 smp_call_func_t func = csd->func;
4b44a21dd640b6 Peter Zijlstra 2020-05-26 508 void *info = csd->info;
8b28499a71d343 Frederic Weisbecker 2014-02-24 509 unsigned long flags;
8b28499a71d343 Frederic Weisbecker 2014-02-24 510
8053871d0f7f67 Linus Torvalds 2015-02-11 511 /*
8053871d0f7f67 Linus Torvalds 2015-02-11 512 * We can unlock early even for the synchronous on-stack case,
8053871d0f7f67 Linus Torvalds 2015-02-11 513 * since we're doing this from the same CPU..
8053871d0f7f67 Linus Torvalds 2015-02-11 514 */
35feb60474bf4f Paul E. McKenney 2020-06-30 @515 csd_lock_record(csd);
8053871d0f7f67 Linus Torvalds 2015-02-11 @516 csd_unlock(csd);
8b28499a71d343 Frederic Weisbecker 2014-02-24 517 local_irq_save(flags);
8b28499a71d343 Frederic Weisbecker 2014-02-24 518 func(info);
35feb60474bf4f Paul E. McKenney 2020-06-30 519 csd_lock_record(NULL);
8b28499a71d343 Frederic Weisbecker 2014-02-24 520 local_irq_restore(flags);
8b28499a71d343 Frederic Weisbecker 2014-02-24 521 return 0;
8b28499a71d343 Frederic Weisbecker 2014-02-24 522 }
8b28499a71d343 Frederic Weisbecker 2014-02-24 523
5224b9613b91d9 Linus Torvalds 2015-04-19 524 if ((unsigned)cpu >= nr_cpu_ids || !cpu_online(cpu)) {
5224b9613b91d9 Linus Torvalds 2015-04-19 525 csd_unlock(csd);
8b28499a71d343 Frederic Weisbecker 2014-02-24 526 return -ENXIO;
5224b9613b91d9 Linus Torvalds 2015-04-19 527 }
8b28499a71d343 Frederic Weisbecker 2014-02-24 528
545b8c8df41f9e Peter Zijlstra 2020-06-15 529 __smp_call_single_queue(cpu, &csd->node.llist);
3d4422332711ef Jens Axboe 2008-06-26 530
8b28499a71d343 Frederic Weisbecker 2014-02-24 531 return 0;
3d4422332711ef Jens Axboe 2008-06-26 532 }
3d4422332711ef Jens Axboe 2008-06-26 533

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (5.56 kB)
.config.gz (32.78 kB)
Download all attachments

2021-04-29 21:47:20

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

Hi Arnd,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20210429]
[cannot apply to linux/master soc/for-next linus/master v5.12 v5.12-rc8 v5.12-rc7 v5.12]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
base: 9e5cff2a1315fec1da1f497714395670366506b6
config: arm64-randconfig-r022-20210429 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9131a078901b00e68248a27a4f8c4b11bb1db1ae)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/be40015a8e0990182fa440f75adecf40cf5d0062
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
git checkout be40015a8e0990182fa440f75adecf40cf5d0062
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> kernel/smp.c:407:19: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of '__csd_lock_wait' may result in an unaligned pointer access [-Walign-mismatch]
__csd_lock_wait(csd);
^
kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer access [-Walign-mismatch]
csd_lock_record(csd);
^
kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
csd_unlock(csd);
^
kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
csd_unlock(csd);
^
kernel/smp.c:684:6: warning: no previous prototype for function 'flush_smp_call_function_from_idle' [-Wmissing-prototypes]
void flush_smp_call_function_from_idle(void)
^
kernel/smp.c:684:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void flush_smp_call_function_from_idle(void)
^
static
5 warnings generated.


vim +/__csd_lock_wait +407 kernel/smp.c

35feb60474bf4f Paul E. McKenney 2020-06-30 403
be40015a8e0990 Arnd Bergmann 2021-04-29 404 static __always_inline void csd_lock_wait(struct __call_single_data *csd)
8d0968cc6b8ffd Juergen Gross 2021-03-01 405 {
8d0968cc6b8ffd Juergen Gross 2021-03-01 406 if (static_branch_unlikely(&csdlock_debug_enabled)) {
8d0968cc6b8ffd Juergen Gross 2021-03-01 @407 __csd_lock_wait(csd);
8d0968cc6b8ffd Juergen Gross 2021-03-01 408 return;
8d0968cc6b8ffd Juergen Gross 2021-03-01 409 }
8d0968cc6b8ffd Juergen Gross 2021-03-01 410
8d0968cc6b8ffd Juergen Gross 2021-03-01 411 smp_cond_load_acquire(&csd->node.u_flags, !(VAL & CSD_FLAG_LOCK));
8d0968cc6b8ffd Juergen Gross 2021-03-01 412 }
a5aabace5fb8ab Juergen Gross 2021-03-01 413

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (3.95 kB)
.config.gz (30.61 kB)
Download all attachments

2021-04-29 23:04:58

by Jian Cai

[permalink] [raw]
Subject: Re: [PATCH] smp: fix smp_call_function_single_async prototype

Thanks for the patch! Some of the stable kernels also have this
warning, but they don't seem to have the dependencies (4.14, 4,19,
5.4). Do we plan to fix those branches as well?


On Thu, Apr 29, 2021 at 2:46 PM kernel test robot <[email protected]> wrote:
>
> Hi Arnd,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on next-20210429]
> [cannot apply to linux/master soc/for-next linus/master v5.12 v5.12-rc8 v5.12-rc7 v5.12]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
>
> url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
> base: 9e5cff2a1315fec1da1f497714395670366506b6
> config: arm64-randconfig-r022-20210429 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9131a078901b00e68248a27a4f8c4b11bb1db1ae)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install arm64 cross compiling tool for clang build
> # apt-get install binutils-aarch64-linux-gnu
> # https://github.com/0day-ci/linux/commit/be40015a8e0990182fa440f75adecf40cf5d0062
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Arnd-Bergmann/smp-fix-smp_call_function_single_async-prototype/20210429-231235
> git checkout be40015a8e0990182fa440f75adecf40cf5d0062
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <[email protected]>
>
> All warnings (new ones prefixed by >>):
>
> >> kernel/smp.c:407:19: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of '__csd_lock_wait' may result in an unaligned pointer access [-Walign-mismatch]
> __csd_lock_wait(csd);
> ^
> kernel/smp.c:515:19: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_lock_record' may result in an unaligned pointer access [-Walign-mismatch]
> csd_lock_record(csd);
> ^
> kernel/smp.c:516:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
> csd_unlock(csd);
> ^
> kernel/smp.c:525:14: warning: passing 8-byte aligned argument to 32-byte aligned parameter 1 of 'csd_unlock' may result in an unaligned pointer access [-Walign-mismatch]
> csd_unlock(csd);
> ^
> kernel/smp.c:684:6: warning: no previous prototype for function 'flush_smp_call_function_from_idle' [-Wmissing-prototypes]
> void flush_smp_call_function_from_idle(void)
> ^
> kernel/smp.c:684:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> void flush_smp_call_function_from_idle(void)
> ^
> static
> 5 warnings generated.
>
>
> vim +/__csd_lock_wait +407 kernel/smp.c
>
> 35feb60474bf4f Paul E. McKenney 2020-06-30 403
> be40015a8e0990 Arnd Bergmann 2021-04-29 404 static __always_inline void csd_lock_wait(struct __call_single_data *csd)
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 405 {
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 406 if (static_branch_unlikely(&csdlock_debug_enabled)) {
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 @407 __csd_lock_wait(csd);
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 408 return;
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 409 }
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 410
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 411 smp_cond_load_acquire(&csd->node.u_flags, !(VAL & CSD_FLAG_LOCK));
> 8d0968cc6b8ffd Juergen Gross 2021-03-01 412 }
> a5aabace5fb8ab Juergen Gross 2021-03-01 413
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]