From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f71.google.com (mail-oi0-f71.google.com [209.85.218.71]) by kanga.kvack.org (Postfix) with ESMTP id 7BC4D6B0008 for ; Mon, 5 Mar 2018 09:29:31 -0500 (EST) Received: by mail-oi0-f71.google.com with SMTP id a9so8359996oia.1 for ; Mon, 05 Mar 2018 06:29:31 -0800 (PST) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id e23si3958799otc.391.2018.03.05.06.29.30 for ; Mon, 05 Mar 2018 06:29:30 -0800 (PST) Date: Mon, 5 Mar 2018 14:29:07 +0000 From: Mark Rutland Subject: Re: [RFC PATCH 06/14] khwasan: enable top byte ignore for the kernel Message-ID: <20180305142907.uvrvwmtfl7o45myf@lakrids.cambridge.arm.com> References: <739eecf573b6342fc41c4f89d7f64eb8c183e312.1520017438.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <739eecf573b6342fc41c4f89d7f64eb8c183e312.1520017438.git.andreyknvl@google.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Konovalov Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Jonathan Corbet , Catalin Marinas , Will Deacon , Theodore Ts'o , Jan Kara , Christopher Li , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Masahiro Yamada , Michal Marek , Ard Biesheuvel , Yury Norov , Nick Desaulniers , Marc Zyngier , Bob Picco , Suzuki K Poulose , Kristina Martsenko , Punit Agrawal , Dave Martin , James Morse , Julien Thierry , Michael Weiser , Steve Capper , Ingo Molnar , Thomas Gleixner , Sandipan Das , Paul Lawrence , David Woodhouse , Kees Cook , Geert Uytterhoeven , Josh Poimboeuf , Arnd Bergmann , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Kees Cook , Jann Horn , Mark Brand On Fri, Mar 02, 2018 at 08:44:25PM +0100, Andrey Konovalov wrote: > +#ifdef CONFIG_KASAN_TAGS > +#define TCR_TBI_FLAGS (TCR_TBI0 | TCR_TBI1) > +#else > +#define TCR_TBI_FLAGS TCR_TBI0 > +#endif Rather than pulling TBI0 into this, I think it'd make more sense to have: #ifdef CONFIG_KASAN_TAGS #define KASAN_TCR_FLAGS TCR_TBI1 #else #define KASAN_TCR_FLAGS #endif > + > #define MAIR(attr, mt) ((attr) << ((mt) * 8)) > > /* > @@ -432,7 +438,7 @@ ENTRY(__cpu_setup) > * both user and kernel. > */ > ldr x10, =TCR_TxSZ(VA_BITS) | TCR_CACHE_FLAGS | TCR_SMP_FLAGS | \ > - TCR_TG_FLAGS | TCR_ASID16 | TCR_TBI0 | TCR_A1 > + TCR_TG_FLAGS | TCR_ASID16 | TCR_TBI_FLAGS | TCR_A1 ... and just append KASAN_TCR_FLAGS to the flags here. That's roughtly what we do with ENDIAN_SET_EL1 for SCTLR_EL1. Thanks, Mark. -- 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