From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id D4EBD2802FE for ; Thu, 29 Jun 2017 02:48:17 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id i185so612185wmi.7 for ; Wed, 28 Jun 2017 23:48:17 -0700 (PDT) Received: from Galois.linutronix.de (Galois.linutronix.de. [2a01:7a0:2:106d:700::1]) by mx.google.com with ESMTPS id i23si3289862wrb.180.2017.06.28.23.48.16 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 28 Jun 2017 23:48:16 -0700 (PDT) Date: Thu, 29 Jun 2017 08:47:46 +0200 (CEST) From: Thomas Gleixner Subject: Re: [PATCH] locking/atomics: don't alias ____ptr In-Reply-To: Message-ID: References: <85d51d3551b676ba1fc40e8fbddd2eadd056d8dd.1498140838.git.dvyukov@google.com> <20170628100246.7nsvhblgi3xjbc4m@breakpoint.cc> <1c1cbbfb-8e34-dd33-0e73-bbb2a758e962@virtuozzo.com> <20170628121246.qnk2csgzbgpqrmw3@linutronix.de> <20170628141420.GK5981@leverpostej> <20170628155445.GD8252@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Mark Rutland Cc: Sebastian Andrzej Siewior , Andrey Ryabinin , Ingo Molnar , Dmitry Vyukov , Peter Zijlstra , Will Deacon , "H. Peter Anvin" , kasan-dev , "x86@kernel.org" , LKML , Andrew Morton , "linux-mm@kvack.org" , Linus Torvalds On Wed, 28 Jun 2017, Thomas Gleixner wrote: > On Wed, 28 Jun 2017, Mark Rutland wrote: > > On Wed, Jun 28, 2017 at 05:24:24PM +0200, Thomas Gleixner wrote: > > Given we're gonig to clean things up, we may as well avoid the backwards > > include of , whcih was only there as > > a bodge: > > > > For the UP arches we do: > > # echo '#include ' >arch/xxx/include/asm/atomic.h > > # mv include/asm-generic/atomic.h include/asm-generic/atomic_up.h > > > > Then we add a : > > > > #ifndef __LINUX_ATOMIC_INSTRUMENTED_H > > #define __LINUX_ATOMIC INSTRUMENTED_H > > > > #include > > > > #if CONFIG_ATOMIC_INSTRUMENTED_H > > > > #endif > > > > #endif /* __LINUX_ATOMIC_ARCH_H */ > > > > ... and make incldue that rather than . > > > > That way the instrumentation's orthogonal to the UP-ness of the arch, > > and we can fold any other instrumentation in there, or later move it > > directly into > > Sounds like a plan. Actually we should make it slightly different and make asm-generic/atomic.h the central point for everything. It should contain the wrapper macro and the central inlines including the kasan stuff and include either arch/arch_atomic.h or asm-generic/atomic_up.h. That way all potential instrumentation happens in the generic header (which is a NOP for archs which do not support it) and pull in the appropriate arch specific or generic UP low level implementations. Thanks, tglx -- 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: email@kvack.org