All of lore.kernel.org
 help / color / mirror / Atom feed
* [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16  4:47 ` Sergey Senozhatsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2017-03-16  4:47 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Dmitry Vyukov, Ingo Molnar, Thomas Gleixner, H. Peter Anvin,
	Andrew Morton, linux-mm, x86, linux-kernel

Hello,

commit 4f86a82ff7df ("x86/atomic: move __arch_atomic_add_unless out of line")
moved __arch_atomic_add_unless() out atomic.h and new KASAN atomic
instrumentation [1] can't see it anymore


In file included from ./arch/x86/include/asm/atomic.h:257:0,
                 from ./include/linux/atomic.h:4,
                 from ./include/asm-generic/qspinlock_types.h:28,
                 from ./arch/x86/include/asm/spinlock_types.h:26,
                 from ./include/linux/spinlock_types.h:13,
                 from kernel/bounds.c:13:
./include/asm-generic/atomic-instrumented.h: In function ‘__atomic_add_unless’:
./include/asm-generic/atomic-instrumented.h:70:9: error: implicit declaration of function ‘__arch_atomic_add_unless’ [-Werror=implicit-function-declaration]
  return __arch_atomic_add_unless(v, a, u);
         ^~~~~~~~~~~~~~~~~~~~~~~~


so we need a declaration of __arch_atomic_add_unless() in arch/x86/include/asm/atomic.h


[1] lkml.kernel.org/r/7e450175a324bf93c602909c711bc34715d8e8f2.1489519233.git.dvyukov@google.com

	-ss

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16  4:47 ` Sergey Senozhatsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Senozhatsky @ 2017-03-16  4:47 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Dmitry Vyukov, Ingo Molnar, Thomas Gleixner, H. Peter Anvin,
	Andrew Morton, linux-mm, x86, linux-kernel

Hello,

commit 4f86a82ff7df ("x86/atomic: move __arch_atomic_add_unless out of line")
moved __arch_atomic_add_unless() out atomic.h and new KASAN atomic
instrumentation [1] can't see it anymore


In file included from ./arch/x86/include/asm/atomic.h:257:0,
                 from ./include/linux/atomic.h:4,
                 from ./include/asm-generic/qspinlock_types.h:28,
                 from ./arch/x86/include/asm/spinlock_types.h:26,
                 from ./include/linux/spinlock_types.h:13,
                 from kernel/bounds.c:13:
./include/asm-generic/atomic-instrumented.h: In function a??__atomic_add_unlessa??:
./include/asm-generic/atomic-instrumented.h:70:9: error: implicit declaration of function a??__arch_atomic_add_unlessa?? [-Werror=implicit-function-declaration]
  return __arch_atomic_add_unless(v, a, u);
         ^~~~~~~~~~~~~~~~~~~~~~~~


so we need a declaration of __arch_atomic_add_unless() in arch/x86/include/asm/atomic.h


[1] lkml.kernel.org/r/7e450175a324bf93c602909c711bc34715d8e8f2.1489519233.git.dvyukov@google.com

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
  2017-03-16  4:47 ` Sergey Senozhatsky
@ 2017-03-16  8:27   ` Dmitry Vyukov
  -1 siblings, 0 replies; 10+ messages in thread
From: Dmitry Vyukov @ 2017-03-16  8:27 UTC (permalink / raw)
  To: 20170315021431.13107-3-andi
  Cc: Andi Kleen, Ingo Molnar, Thomas Gleixner, H. Peter Anvin,
	Andrew Morton, linux-mm, x86, LKML

On Thu, Mar 16, 2017 at 5:47 AM, Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
> Hello,
>
> commit 4f86a82ff7df ("x86/atomic: move __arch_atomic_add_unless out of line")
> moved __arch_atomic_add_unless() out atomic.h and new KASAN atomic
> instrumentation [1] can't see it anymore
>
>
> In file included from ./arch/x86/include/asm/atomic.h:257:0,
>                  from ./include/linux/atomic.h:4,
>                  from ./include/asm-generic/qspinlock_types.h:28,
>                  from ./arch/x86/include/asm/spinlock_types.h:26,
>                  from ./include/linux/spinlock_types.h:13,
>                  from kernel/bounds.c:13:
> ./include/asm-generic/atomic-instrumented.h: In function ‘__atomic_add_unless’:
> ./include/asm-generic/atomic-instrumented.h:70:9: error: implicit declaration of function ‘__arch_atomic_add_unless’ [-Werror=implicit-function-declaration]
>   return __arch_atomic_add_unless(v, a, u);
>          ^~~~~~~~~~~~~~~~~~~~~~~~
>
>
> so we need a declaration of __arch_atomic_add_unless() in arch/x86/include/asm/atomic.h
>
>
> [1] lkml.kernel.org/r/7e450175a324bf93c602909c711bc34715d8e8f2.1489519233.git.dvyukov@google.com
>
>         -ss


Andi, why did you completely remove __arch_atomic_add_unless() from
the header? Don't we need at least a declaration there?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16  8:27   ` Dmitry Vyukov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Vyukov @ 2017-03-16  8:27 UTC (permalink / raw)
  To: 20170315021431.13107-3-andi
  Cc: Andi Kleen, Ingo Molnar, Thomas Gleixner, H. Peter Anvin,
	Andrew Morton, linux-mm, x86, LKML

On Thu, Mar 16, 2017 at 5:47 AM, Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
> Hello,
>
> commit 4f86a82ff7df ("x86/atomic: move __arch_atomic_add_unless out of line")
> moved __arch_atomic_add_unless() out atomic.h and new KASAN atomic
> instrumentation [1] can't see it anymore
>
>
> In file included from ./arch/x86/include/asm/atomic.h:257:0,
>                  from ./include/linux/atomic.h:4,
>                  from ./include/asm-generic/qspinlock_types.h:28,
>                  from ./arch/x86/include/asm/spinlock_types.h:26,
>                  from ./include/linux/spinlock_types.h:13,
>                  from kernel/bounds.c:13:
> ./include/asm-generic/atomic-instrumented.h: In function ‘__atomic_add_unless’:
> ./include/asm-generic/atomic-instrumented.h:70:9: error: implicit declaration of function ‘__arch_atomic_add_unless’ [-Werror=implicit-function-declaration]
>   return __arch_atomic_add_unless(v, a, u);
>          ^~~~~~~~~~~~~~~~~~~~~~~~
>
>
> so we need a declaration of __arch_atomic_add_unless() in arch/x86/include/asm/atomic.h
>
>
> [1] lkml.kernel.org/r/7e450175a324bf93c602909c711bc34715d8e8f2.1489519233.git.dvyukov@google.com
>
>         -ss


Andi, why did you completely remove __arch_atomic_add_unless() from
the header? Don't we need at least a declaration there?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
  2017-03-16  8:27   ` Dmitry Vyukov
@ 2017-03-16 16:27     ` Andi Kleen
  -1 siblings, 0 replies; 10+ messages in thread
From: Andi Kleen @ 2017-03-16 16:27 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	linux-mm, x86, LKML

> Andi, why did you completely remove __arch_atomic_add_unless() from
> the header? Don't we need at least a declaration there?

Yes the declaration should be there. I'll send a new patch.

-Andi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16 16:27     ` Andi Kleen
  0 siblings, 0 replies; 10+ messages in thread
From: Andi Kleen @ 2017-03-16 16:27 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	linux-mm, x86, LKML

> Andi, why did you completely remove __arch_atomic_add_unless() from
> the header? Don't we need at least a declaration there?

Yes the declaration should be there. I'll send a new patch.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
  2017-03-16  8:27   ` Dmitry Vyukov
@ 2017-03-16 16:41     ` Andi Kleen
  -1 siblings, 0 replies; 10+ messages in thread
From: Andi Kleen @ 2017-03-16 16:41 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: 20170315021431.13107-3-andi, Ingo Molnar, Thomas Gleixner,
	H. Peter Anvin, Andrew Morton, linux-mm, x86, LKML

> Andi, why did you completely remove __arch_atomic_add_unless() from
> the header? Don't we need at least a declaration there?

Actually it's there in my git version:

I wonder where it disappeared.

-/**
- * __atomic_add_unless - add unless the number is already a given value
- * @v: pointer of type atomic_t
- * @a: the amount to add to v...
- * @u: ...unless v is equal to u.
- *
- * Atomically adds @a to @v, so long as @v was not already @u.
- * Returns the old value of @v.
- */
-static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int c, old;
-       c = atomic_read(v);
-       for (;;) {
-               if (unlikely(c == (u)))
-                       break;
-               old = atomic_cmpxchg((v), c, c + (a));
-               if (likely(old == c))
-                       break;
-               c = old;
-       }
-       return c;
-}
+int __atomic_add_unless(atomic_t *v, int a, int u);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16 16:41     ` Andi Kleen
  0 siblings, 0 replies; 10+ messages in thread
From: Andi Kleen @ 2017-03-16 16:41 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: 20170315021431.13107-3-andi, Ingo Molnar, Thomas Gleixner,
	H. Peter Anvin, Andrew Morton, linux-mm, x86, LKML

> Andi, why did you completely remove __arch_atomic_add_unless() from
> the header? Don't we need at least a declaration there?

Actually it's there in my git version:

I wonder where it disappeared.

-/**
- * __atomic_add_unless - add unless the number is already a given value
- * @v: pointer of type atomic_t
- * @a: the amount to add to v...
- * @u: ...unless v is equal to u.
- *
- * Atomically adds @a to @v, so long as @v was not already @u.
- * Returns the old value of @v.
- */
-static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int c, old;
-       c = atomic_read(v);
-       for (;;) {
-               if (unlikely(c == (u)))
-                       break;
-               old = atomic_cmpxchg((v), c, c + (a));
-               if (likely(old == c))
-                       break;
-               c = old;
-       }
-       return c;
-}
+int __atomic_add_unless(atomic_t *v, int a, int u);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
  2017-03-16 16:41     ` Andi Kleen
@ 2017-03-16 18:45       ` Andrew Morton
  -1 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2017-03-16 18:45 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Dmitry Vyukov, 20170315021431.13107-3-andi, Ingo Molnar,
	Thomas Gleixner, H. Peter Anvin, linux-mm, x86, LKML

On Thu, 16 Mar 2017 09:41:10 -0700 Andi Kleen <ak@linux.intel.com> wrote:

> > Andi, why did you completely remove __arch_atomic_add_unless() from
> > the header? Don't we need at least a declaration there?
> 
> Actually it's there in my git version:
> 
> I wonder where it disappeared.
> 
> -/**
> - * __atomic_add_unless - add unless the number is already a given value
> - * @v: pointer of type atomic_t
> - * @a: the amount to add to v...
> - * @u: ...unless v is equal to u.
> - *
> - * Atomically adds @a to @v, so long as @v was not already @u.
> - * Returns the old value of @v.
> - */
> -static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
> -{
> -       int c, old;
> -       c = atomic_read(v);
> -       for (;;) {
> -               if (unlikely(c == (u)))
> -                       break;
> -               old = atomic_cmpxchg((v), c, c + (a));
> -               if (likely(old == c))
> -                       break;
> -               c = old;
> -       }
> -       return c;
> -}
> +int __atomic_add_unless(atomic_t *v, int a, int u);

That was me fixing rejects (from
asm-generic-x86-wrap-atomic-operations.patch), incompletely.

--- a/arch/x86/include/asm/atomic.h~x86-atomic-move-__atomic_add_unless-out-of-line-fix
+++ a/arch/x86/include/asm/atomic.h
@@ -235,6 +235,8 @@ ATOMIC_OPS(xor, ^)
 #undef ATOMIC_FETCH_OP
 #undef ATOMIC_OP
 
+int __arch_atomic_add_unless(atomic_t *v, int a, int u);
+
 /**
  * arch_atomic_inc_short - increment of a short integer
  * @v: pointer to type int

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error
@ 2017-03-16 18:45       ` Andrew Morton
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2017-03-16 18:45 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Dmitry Vyukov, 20170315021431.13107-3-andi, Ingo Molnar,
	Thomas Gleixner, H. Peter Anvin, linux-mm, x86, LKML

On Thu, 16 Mar 2017 09:41:10 -0700 Andi Kleen <ak@linux.intel.com> wrote:

> > Andi, why did you completely remove __arch_atomic_add_unless() from
> > the header? Don't we need at least a declaration there?
> 
> Actually it's there in my git version:
> 
> I wonder where it disappeared.
> 
> -/**
> - * __atomic_add_unless - add unless the number is already a given value
> - * @v: pointer of type atomic_t
> - * @a: the amount to add to v...
> - * @u: ...unless v is equal to u.
> - *
> - * Atomically adds @a to @v, so long as @v was not already @u.
> - * Returns the old value of @v.
> - */
> -static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u)
> -{
> -       int c, old;
> -       c = atomic_read(v);
> -       for (;;) {
> -               if (unlikely(c == (u)))
> -                       break;
> -               old = atomic_cmpxchg((v), c, c + (a));
> -               if (likely(old == c))
> -                       break;
> -               c = old;
> -       }
> -       return c;
> -}
> +int __atomic_add_unless(atomic_t *v, int a, int u);

That was me fixing rejects (from
asm-generic-x86-wrap-atomic-operations.patch), incompletely.

--- a/arch/x86/include/asm/atomic.h~x86-atomic-move-__atomic_add_unless-out-of-line-fix
+++ a/arch/x86/include/asm/atomic.h
@@ -235,6 +235,8 @@ ATOMIC_OPS(xor, ^)
 #undef ATOMIC_FETCH_OP
 #undef ATOMIC_OP
 
+int __arch_atomic_add_unless(atomic_t *v, int a, int u);
+
 /**
  * arch_atomic_inc_short - increment of a short integer
  * @v: pointer to type int

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-16 18:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16  4:47 [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error Sergey Senozhatsky
2017-03-16  4:47 ` Sergey Senozhatsky
2017-03-16  8:27 ` Dmitry Vyukov
2017-03-16  8:27   ` Dmitry Vyukov
2017-03-16 16:27   ` Andi Kleen
2017-03-16 16:27     ` Andi Kleen
2017-03-16 16:41   ` Andi Kleen
2017-03-16 16:41     ` Andi Kleen
2017-03-16 18:45     ` Andrew Morton
2017-03-16 18:45       ` Andrew Morton

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.