Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2346416pxb; Thu, 11 Feb 2021 10:02:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWd5NURXsPIK9aHbIi1Q812Kf4jKiMh8LwRDSe7CRa6AJUNfO6VeUgxbRwOlcKykksJd9S X-Received: by 2002:aa7:db16:: with SMTP id t22mr9300903eds.301.1613066520518; Thu, 11 Feb 2021 10:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613066520; cv=none; d=google.com; s=arc-20160816; b=zaYrVZIlfy0Q+dr/wlgMcw5s1sz40lSVq2pO90EmAJLdf+7y5LDlKLlaqs2JZ8GJJf d670/GHi3es86q2EtSKMFnryNUHEy/M+iJ9iy48rKunqL6pCjgfw3cMG2996auEjTuMD bOK8EFLL5+Jj64FM+awkFuGI5/FzAtsB2hYF/abBUUz+ivChaVJiYp0oKDVswUN6k5Hx mVI5n3Jdd2mNTSeo3z/ZjtVa9//lULAsTj4jI6vwc66GRk7bZp/2c7wxhxvAyeqBR+j0 yuSbEbYV6YYQCxoZKu+WmXw0be2VvsqdIayxEOi3bMDiRd75UzKNzL77YRfh+olBou+w P18w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a0sLUNT5ihF6g2jXFc7aCUKZ679+kNYXd0ZfZV5p2dc=; b=KlAqoSKrG3JFLR3NlEAIk2L/wHdbMCW5vIh6ZYmzXjiOS5oLRYiwhLIUNC+RQS1AaH RdqYTCnmMUNCyVj/hf1wQj6Qu+VphqZ75cR43YzxQaXvpttY/u0R5WRfkz6W+6PfeX25 S7e7k0MX9qV6vIRuOR4tKWvQsMmbq6f4FYwfGXYpzV77BbrH3mtVnX0ojSlfOPqC8YbQ lAuMJrJXVod5BI2ysokn2n9RoIy1J8Ir5k9uo/JZuCUACnNi/fpyU2JlQWl2G2njLRvv yrF29RF51f7YI8hga5sLIcBVvRhNZIZ5/efTV1gXKUSdqsohK2Nje/aO484Mm3z6BYOt e8uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dAcQsC5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg11si791432ejb.428.2021.02.11.10.01.35; Thu, 11 Feb 2021 10:02:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dAcQsC5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232779AbhBKR6r (ORCPT + 99 others); Thu, 11 Feb 2021 12:58:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbhBKRbH (ORCPT ); Thu, 11 Feb 2021 12:31:07 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C4FC06178B for ; Thu, 11 Feb 2021 09:30:24 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id a22so8289658ljp.10 for ; Thu, 11 Feb 2021 09:30:24 -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=YukzpXjTPb0MP+Y0v+m5ryqqZKqbSOmSpTTRAFIVeHZQ6nrEiPcx8HK5lt3mcAY/+2 096weTmV3SMi5YYWraV5dDox5Be1DWLWORcwADGk8hM2/bq9/q1K7ZYqkxcvKWqcUOJm qAR1jTlmK64Pn35WRSBCjS+P1NoDpD69dfDtUqwFG5uvT/pIGHDPO7JYhR71YnzgBLJo dypR1J/SY2kL/B+7poRg7xBP6Vr0pMFlSb0gJO+P1Pl3taZQmBjbcPZ9FNzEtFtn21Ns UN42PuQcNYUZ3MtJRQctK+GK+nXHRKL2fHOS/YG3tebJzZDzrNYIptB4JizXOuevnadf YyrQ== X-Gm-Message-State: AOAM530KKxSmOLhDev+HJmVwR05nV9SezsS8hh9RU7CWVgHF9oGm88rc fJpnwnxWHtpEELp8eZJOXkk5zNTsN/g40fryj+pF4g== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!