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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 7D8DAC433E0 for ; Fri, 22 Jan 2021 02:04:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA4A5239EE for ; Fri, 22 Jan 2021 02:04:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA4A5239EE 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 41C7A6B0006; Thu, 21 Jan 2021 21:04:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CD806B0007; Thu, 21 Jan 2021 21:04:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2969B6B0008; Thu, 21 Jan 2021 21:04:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 0EED26B0006 for ; Thu, 21 Jan 2021 21:04:07 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CF18F180ACF17 for ; Fri, 22 Jan 2021 02:04:06 +0000 (UTC) X-FDA: 77731765692.15.body39_4f0659a27568 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id AD8C01814B0C7 for ; Fri, 22 Jan 2021 02:04:06 +0000 (UTC) X-HE-Tag: body39_4f0659a27568 X-Filterd-Recvd-Size: 5976 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Fri, 22 Jan 2021 02:04:06 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id g15so2875147pjd.2 for ; Thu, 21 Jan 2021 18:04:05 -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=ca93cJadUERqdaaRPfmfCnbqdAlVsxIg+FVYypBCZr8=; b=NMzz9+XyhRDY60HZWYX8GNcXkr5AVTkl/pu9k/K0M2IW1bS7/d+caNVlvYDpaRE5Xr qG47nKJDD0PMPWqoYxR5o4kt4tXjdgmr83T9ItF6Azfw0ykCjYLnL4/SablFKQ81b9wB Hv8zt5Ep26Ekz2rNLNK8CyuEbEgnS4recwkOkNsJdMTVPea2BG96Qsb/mMCcw1v08/dk P6AxPitvQ95Ht2K0CL6zS/+oX3BQUoEbNI/1m/NDhISzgv9Byco+z/U4bZx+oW7Vx3VC uRStHjBBxpS3uMOHT4V1ogvyGDayzUuI5cCjmvqCVKYMrDRHWCFJc5CFpyjSyApk6ZWV 2Wcw== 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=ca93cJadUERqdaaRPfmfCnbqdAlVsxIg+FVYypBCZr8=; b=JOgNuULyQ7s3a956hna4KqBUDzikY/ce23Hhg7p+YSGUZ443NuSAqgT0INK9Jqjba5 Au/NbYgSsOS1oI1ErX4ZiygqhVryfua2rHqFOr/xrmzOKpdJ1b/UlnxZR5N0Cwe+9uWq sYXC3T7QstTv47KI1H+I/cpAP8io72VnNr47m/484AZpOf8L0mTSi8nxiYafOpfvylKi XOoTAZOt+Ad+8Q2baaCBbv582uRtLuiVki3dC1iG2RwrmVubA3XWEPKOscZa+b5I1qex MwyTyMEXwIUUp45FIrG0v7CcGWq7qyFi+7NVBGAkSr3nGvFAY6gi7c/l0C4eDSMaGwFi UADg== X-Gm-Message-State: AOAM533n9+78aNW4KB5TtSNkPXm4Ij1c8ZobPBa1yFcL9LGGgGWFy+OY WDTtKEnK266e7p3D2ENHe6GDMGdDpCXPkpJpA5ASpw== X-Google-Smtp-Source: ABdhPJycp0vHcjRRAzZ6YVZuNW1dsYAqqfwOaIQhDawttR91hUzR+dWWH/9s4tBOBGtr1FdEBjNTvTV32ubp/VVOFc4= X-Received: by 2002:a17:902:9009:b029:dc:52a6:575 with SMTP id a9-20020a1709029009b02900dc52a60575mr2127389plp.57.1611281044968; Thu, 21 Jan 2021 18:04:04 -0800 (PST) MIME-Version: 1.0 References: <20200515171612.1020-1-catalin.marinas@arm.com> <20200515171612.1020-25-catalin.marinas@arm.com> In-Reply-To: From: Andrey Konovalov Date: Fri, 22 Jan 2021 03:03:52 +0100 Message-ID: Subject: Re: [PATCH v4 24/26] arm64: mte: Introduce early param to disable MTE support To: Catalin Marinas Cc: Linux ARM , Linux Memory Management List , linux-arch , Will Deacon , Dave P Martin , Vincenzo Frascino , Szabolcs Nagy , Kevin Brodsky , Peter Collingbourne 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 Thu, Jan 21, 2021 at 8:37 PM Andrey Konovalov wrote: > > On Fri, May 15, 2020 at 7:17 PM Catalin Marinas wrote: > > > > For performance analysis it may be desirable to disable MTE altogether > > via an early param. Introduce arm64.mte_disable and, if true, filter out > > the sanitised ID_AA64PFR1_EL1.MTE field to avoid exposing the HWCAP to > > user. > > > > Signed-off-by: Catalin Marinas > > Cc: Will Deacon > > --- > > > > Notes: > > New in v4. > > > > Documentation/admin-guide/kernel-parameters.txt | 4 ++++ > > arch/arm64/kernel/cpufeature.c | 11 +++++++++++ > > 2 files changed, 15 insertions(+) > > > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > > index f2a93c8679e8..7436e7462b85 100644 > > --- a/Documentation/admin-guide/kernel-parameters.txt > > +++ b/Documentation/admin-guide/kernel-parameters.txt > > @@ -373,6 +373,10 @@ > > arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards > > Format: ,, > > > > + arm64.mte_disable= > > + [ARM64] Disable Linux support for the Memory > > + Tagging Extension (both user and in-kernel). > > + > > ataflop= [HW,M68k] > > > > atarimouse= [HW,MOUSE] Atari Mouse > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > > index aaadc1cbc006..f7596830694f 100644 > > --- a/arch/arm64/kernel/cpufeature.c > > +++ b/arch/arm64/kernel/cpufeature.c > > @@ -126,12 +126,23 @@ static void cpu_enable_cnp(struct arm64_cpu_capabilities const *cap); > > static bool __system_matches_cap(unsigned int n); > > > > #ifdef CONFIG_ARM64_MTE > > +static bool mte_disable; > > + > > +static int __init arm64_mte_disable(char *buf) > > +{ > > + return strtobool(buf, &mte_disable); > > +} > > +early_param("arm64.mte_disable", arm64_mte_disable); > > + > > s64 mte_ftr_filter(const struct arm64_ftr_bits *ftrp, s64 val) > > { > > struct device_node *np; > > static bool memory_checked = false; > > static bool mte_capable = true; > > > > + if (mte_disable) > > + return ID_AA64PFR1_MTE_NI; > > + > > /* EL0-only MTE is not supported by Linux, don't expose it */ > > if (val < ID_AA64PFR1_MTE) > > return ID_AA64PFR1_MTE_NI; > > Hi Catalin, > > While this patch didn't land upstream, we need an MTE kill-switch for > Android GKI. Is this patch OK to take as is? Is it still valid? Looking at this more closely: looks like this code no longer exists. What would be the approach to add this kind of switch now? Thanks!