From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2BE4C433E0 for ; Thu, 11 Feb 2021 17:30:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8833F601FF for ; Thu, 11 Feb 2021 17:30:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8833F601FF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 232176B013B; Thu, 11 Feb 2021 12:30:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 20A2C6B013C; Thu, 11 Feb 2021 12:30:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 146616B013D; Thu, 11 Feb 2021 12:30:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id F1A366B013B for ; Thu, 11 Feb 2021 12:30:24 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9A81B1EE6 for ; Thu, 11 Feb 2021 17:30:24 +0000 (UTC) X-FDA: 77806675968.25.death60_2d08c0c2761a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 695761804E3B2 for ; Thu, 11 Feb 2021 17:30:24 +0000 (UTC) X-HE-Tag: death60_2d08c0c2761a X-Filterd-Recvd-Size: 5393 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Feb 2021 17:30:23 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id a17so8353851ljq.2 for ; Thu, 11 Feb 2021 09:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a0sLUNT5ihF6g2jXFc7aCUKZ679+kNYXd0ZfZV5p2dc=; b=dAcQsC5HYrfkZM/GE98EwdI2y0mWsIusVAq9JtSCwl3f13U/wivhWy2MzuVR4Y8+wL 8sAq6u7NV1XDgpQWmg/11xriebzmckL/eOBPIXYjS7hUpW8GD7fpDSABx42mxfSrEskT K6XrCOzBiwice33qsStLWYj0WFj0i7Yxx+g1o18bujh9Hi4O7CCyv++wX7SkeEPxkOzT TXNH2oM36HoCELx8+qIF0MKMuOTIrSVlgIdqgtgBAy5ViRy1AMglX633EvHsk0FxOwY2 J3eW7BTDgxmsK3+kITJb+JBAxXqIF7uJTKOaGnrh18sy3YlzctuDtZuT+OxlQrEtHJR5 lRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a0sLUNT5ihF6g2jXFc7aCUKZ679+kNYXd0ZfZV5p2dc=; b=nv6yMe0D+Kbps37V7lSzmisLHDo5/lh27C5nrKwgwfrw7iQIqSOB/xXQy/uUuYsZBr nl2OPHjOzVWueT6ByIsqlIBiN89qWpmiaRbXqAzwlhpy5xIGy3dEVLE/bFHyft7VRvLE T7Xz2siHc1Rm0KYv9l8xcg6kl0fcUAydxbfBzUJzPsRMgZhyRxa9atMaAdozg+GEZbPA OdHJQzS3VUi+w701QrTn+x+L2QO+ZMDWa/yJ4ZCsOPzt9JxLQ47xjORDDjGcffzS55XF JJkfUX5Fp7iGOSEKrihH7QVZ0au+K7hNuiCSrKDKktWkRJPgkIpS4/9ZOR4tLW562MbG M6AQ== X-Gm-Message-State: AOAM532QJm3AhdMrWtD3HKRNLv/ty2hSP4+C4mALTx/uqpRz9SGPsUau 7pmyUlbTgkZw5xGCPbkrTUC0j7pTnM6Xf3TzJuTxxQ== X-Google-Smtp-Source: ABdhPJzJII1LCTkHS23ScyYW8lJwDEJ68Mx8ChMjGfa1JLZXX7P66uGIoUR5RgRI/nLWC1bpECVT27hN4PFJDk+uMKg= X-Received: by 2002:a05:651c:233:: with SMTP id z19mr5391008ljn.486.1613064622185; Thu, 11 Feb 2021 09:30:22 -0800 (PST) MIME-Version: 1.0 References: <20210209170255.GG1435@arm.com> <20210209104515.75eaa00dea03175e49e70d6c@linux-foundation.org> In-Reply-To: <20210209104515.75eaa00dea03175e49e70d6c@linux-foundation.org> From: Andrey Konovalov Date: Thu, 11 Feb 2021 18:30:10 +0100 Message-ID: Subject: Re: [PATCH mm] arm64: kasan: fix MTE symbols exports To: Andrew Morton Cc: Catalin Marinas , Vincenzo Frascino , Will Deacon , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Christoph Hellwig , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 9, 2021 at 7:45 PM Andrew Morton wrote: > > On Tue, 9 Feb 2021 17:02:56 +0000 Catalin Marinas wrote: > > > On Tue, Feb 09, 2021 at 04:32:30PM +0100, Andrey Konovalov wrote: > > > diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c > > > index a66c2806fc4d..788ef0c3a25e 100644 > > > --- a/arch/arm64/kernel/mte.c > > > +++ b/arch/arm64/kernel/mte.c > > > @@ -113,13 +113,17 @@ void mte_enable_kernel(void) > > > sysreg_clear_set(sctlr_el1, SCTLR_ELx_TCF_MASK, SCTLR_ELx_TCF_SYNC); > > > isb(); > > > } > > > +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) > > > EXPORT_SYMBOL_GPL(mte_enable_kernel); > > > +#endif > > > > > > void mte_set_report_once(bool state) > > > { > > > WRITE_ONCE(report_fault_once, state); > > > } > > > +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST) > > > EXPORT_SYMBOL_GPL(mte_set_report_once); > > > +#endif > > > > Do we actually care about exporting them when KASAN_KUNIT_TEST=n? It > > looks weird to have these #ifdefs in the arch code. Either the > > arch-kasan API requires these symbols to be exported to modules or not. > > I'm not keen on such kasan internals trickling down into the arch code. Understood. > > If you don't want to export them in the KASAN_KUNIT_TEST=n case, add a > > wrapper in the kasan built-in code (e.g. kasan_test_enable_tagging, > > kasan_test_set_report_once) and conditionally compile them based on > > KASAN_KUNIT_TEST. This might be a better approach indeed. > In other words, the patch's changelog was poor! It told us what the > patch does (which is often obvious from the code) but it failed to > explain why the patch does what it does. > > The same goes for code comments, folks - please explain "why it does > this" rather than "what it does". I'm sorry, Andrew. Could you please drop the "arm64: kasan: export MTE symbols for KASAN tests" patch from the mm tree (but keep the rest of that series)? I'll post a separate patch with a fix. Thanks!